Panda3D
Classes | Macros | Typedefs | Enumerations | Functions | Variables
dxgsg9base.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "pandabase.h"
#include "graphicsWindow.h"
#include "pmap.h"
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr9.h>

Go to the source code of this file.

Classes

struct  DXScreenData
 

Macros

#define D3D_MAXTEXTURESTAGES   8
 
#define D3D_OVERLOADS
 
#define D3DERRORSTRING(HRESULT)   " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << ": " << DX_GET_ERROR_DESCRIPTION_FUNC(HRESULT) << std::endl
 
#define D3DFMT_ATI1   ((D3DFORMAT)MAKEFOURCC('A', 'T', 'I', '1'))
 
#define D3DFMT_ATI2   ((D3DFORMAT)MAKEFOURCC('A', 'T', 'I', '2'))
 
#define D3DFMT_INTZ   ((D3DFORMAT)MAKEFOURCC('I', 'N', 'T', 'Z'))
 
#define DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT2_FLAG
 
#define DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT1_FLAG
 
#define DO_PSTATS_STUFF(XX)
 
#define DX_DECLARE_CLEAN(type, var)
 
#define DX_GET_ERROR_DESCRIPTION_FUNC   DXGetErrorDescription9
 
#define DX_GET_ERROR_STRING_FUNC   DXGetErrorString9
 
#define FLG(NN)   (1<<NN)
 
#define IS_16BPP_DISPLAY_FORMAT(FMT)   (((FMT)==D3DFMT_R5G6B5)||((FMT)==D3DFMT_X1R5G5B5)||((FMT)==D3DFMT_A1R5G5B5))
 
#define IS_16BPP_ZBUFFER(FMT)   ((FMT==D3DFMT_D16)||(FMT==D3DFMT_D15S1))
 
#define IS_ATI(DDDEVICEID)   (DDDEVICEID.VendorId==0x1002)
 
#define IS_MATROX(DDDEVICEID)   (DDDEVICEID.VendorId==0x102B)
 
#define IS_NVIDIA(DDDEVICEID)   ((DDDEVICEID.VendorId==0x10DE) || (DDDEVICEID.VendorId==0x12D2))
 
#define IS_STENCIL_FORMAT(FMT)   (((FMT)==D3DFMT_D24S8) || ((FMT)==D3DFMT_D15S1) || ((FMT)==D3DFMT_D24X4S4))
 
#define IS_VALID_PTR(PTR)   (!IsBadWritePtr(PTR,sizeof(void*)))
 
#define ISPOW2(X)   (((X) & ((X)-1))==0)
 
#define MAX_POSSIBLE_TEXFMTS   32
 
#define PANDA_MAXNUMVERTS   0xFFFF
 
#define PRINT_REFCNT(MODULE, p)
 
#define RECT_XSIZE(REC)   (REC.right-REC.left)
 
#define RECT_YSIZE(REC)   (REC.bottom-REC.top)
 
#define RELEASE(OBJECT, MODULE, DBGSTR, bDoDownToZero)
 
#define RELEASE_DOWN_TO_ZERO   true
 
#define RELEASE_ONCE   false
 
#define SAFE_DELETE(p)   { if(p) { assert(IS_VALID_PTR(p)); delete (p); (p)=nullptr; } }
 
#define SAFE_DELETE_ARRAY(p)   { if(p) { assert(IS_VALID_PTR(p)); delete [] (p); (p)=nullptr; } }
 
#define SAFE_DELSHADER(TYPE, HANDLE, PDEVICE)   if((HANDLE!=nullptr)&&IS_VALID_PTR(PDEVICE)) { PDEVICE->Delete##TYPE##Shader(HANDLE); HANDLE=nullptr; }
 
#define SAFE_FREELIB(hDLL)   { if(hDLL!=nullptr) { FreeLibrary(hDLL);hDLL = nullptr; } }
 
#define SAFE_RELEASE(p)   { if(p) { assert(IS_VALID_PTR(p)); (p)->Release(); (p)=nullptr; } }
 
#define STRICT
 
#define WIN32_LEAN_AND_MEAN   1
 

Typedefs

typedef DWORD DXShaderHandle
 

Enumerations

enum  D3DFORMAT_FLAG {
  R8G8B8_FLAG = (1<< 0 ), A8R8G8B8_FLAG = (1<< 1 ), X8R8G8B8_FLAG = (1<< 2 ), R5G6B5_FLAG = (1<< 3 ),
  X1R5G5B5_FLAG = (1<< 4 ), A1R5G5B5_FLAG = (1<< 5 ), A4R4G4B4_FLAG = (1<< 6 ), R3G3B2_FLAG = (1<< 7 ),
  A8_FLAG = (1<< 8 ), A8R3G3B2_FLAG = (1<< 9 ), X4R4G4B4_FLAG = (1<< 10 ), A2B10G10R10_FLAG = (1<< 11 ),
  G16R16_FLAG = (1<< 12 ), A8P8_FLAG = (1<< 13 ), P8_FLAG = (1<< 14 ), L8_FLAG = (1<< 15 ),
  A8L8_FLAG = (1<< 16 ), A4L4_FLAG = (1<< 17 ), D16_FLAG = (1<< 18 ), D24X8_FLAG = (1<< 19 ),
  D24S8_FLAG = (1<< 20 ), D32_FLAG = (1<< 21 ), INTZ_FLAG = (1<< 22 ), W11V11U10_FLAG = (1<< 23 ),
  A2W10V10U10_FLAG = (1<< 24 ), ATI1_FLAG = (1<< 25 ), ATI2_FLAG = (1<< 26 ), DXT1_FLAG = (1<< 27 ),
  DXT2_FLAG = (1<< 28 ), DXT3_FLAG = (1<< 29 ), DXT4_FLAG = (1<< 30 ), DXT5_FLAG = (1<< 31 )
}
 
enum  ShaderType { VertexShader, PixelShader }
 

Functions

const char * D3DFormatStr (D3DFORMAT fmt)
 
void Init_D3DFORMAT_map ()
 

Variables

pmap< D3DFORMAT_FLAG, D3DFORMAT > g_D3DFORMATmap
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
georges
Date
2001-10-07

Definition in file dxgsg9base.h.

Macro Definition Documentation

◆ DX_DECLARE_CLEAN

#define DX_DECLARE_CLEAN (   type,
  var 
)
Value:
type var; \
ZeroMemory(&var, sizeof(type)); \
var.dwSize = sizeof(type);

Definition at line 79 of file dxgsg9base.h.

◆ RELEASE

#define RELEASE (   OBJECT,
  MODULE,
  DBGSTR,
  bDoDownToZero 
)
Value:
{ \
ULONG refcnt; \
if(IS_VALID_PTR(OBJECT)) { \
refcnt=(OBJECT)->Release(); \
if((bDoDownToZero) && (refcnt>0)) { \
MODULE##_cat.warning() << DBGSTR << " released but still has a non-zero refcnt(" << refcnt << "), multi-releasing it down to zero!\n"; \
do { \
refcnt = (OBJECT)->Release(); \
} while(refcnt>0); \
} \
(OBJECT) = nullptr; \
}}

Definition at line 122 of file dxgsg9base.h.