Panda3D
Loading...
Searching...
No Matches
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

◆ D3D_MAXTEXTURESTAGES

#define D3D_MAXTEXTURESTAGES   8

Definition at line 71 of file dxgsg9base.h.

◆ D3D_OVERLOADS

#define D3D_OVERLOADS

Definition at line 31 of file dxgsg9base.h.

◆ D3DERRORSTRING

#define D3DERRORSTRING ( HRESULT)    " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << ": " << DX_GET_ERROR_DESCRIPTION_FUNC(HRESULT) << std::endl

Definition at line 61 of file dxgsg9base.h.

◆ D3DFMT_ATI1

#define D3DFMT_ATI1   ((D3DFORMAT)MAKEFOURCC('A', 'T', 'I', '1'))

Definition at line 184 of file dxgsg9base.h.

◆ D3DFMT_ATI2

#define D3DFMT_ATI2   ((D3DFORMAT)MAKEFOURCC('A', 'T', 'I', '2'))

Definition at line 185 of file dxgsg9base.h.

◆ D3DFMT_INTZ

#define D3DFMT_INTZ   ((D3DFORMAT)MAKEFOURCC('I', 'N', 'T', 'Z'))

Definition at line 183 of file dxgsg9base.h.

◆ DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG

#define DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT2_FLAG

Definition at line 190 of file dxgsg9base.h.

◆ DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG

#define DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT1_FLAG

Definition at line 189 of file dxgsg9base.h.

◆ DO_PSTATS_STUFF

#define DO_PSTATS_STUFF ( XX)

Definition at line 141 of file dxgsg9base.h.

◆ 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.

◆ DX_GET_ERROR_DESCRIPTION_FUNC

#define DX_GET_ERROR_DESCRIPTION_FUNC   DXGetErrorDescription9

Definition at line 48 of file dxgsg9base.h.

◆ DX_GET_ERROR_STRING_FUNC

#define DX_GET_ERROR_STRING_FUNC   DXGetErrorString9

Definition at line 47 of file dxgsg9base.h.

◆ FLG

#define FLG ( NN)    (1<<NN)

Definition at line 146 of file dxgsg9base.h.

◆ IS_16BPP_DISPLAY_FORMAT

#define IS_16BPP_DISPLAY_FORMAT ( FMT)    (((FMT)==D3DFMT_R5G6B5)||((FMT)==D3DFMT_X1R5G5B5)||((FMT)==D3DFMT_A1R5G5B5))

Definition at line 192 of file dxgsg9base.h.

◆ IS_16BPP_ZBUFFER

#define IS_16BPP_ZBUFFER ( FMT)    ((FMT==D3DFMT_D16)||(FMT==D3DFMT_D15S1))

Definition at line 193 of file dxgsg9base.h.

◆ IS_ATI

#define IS_ATI ( DDDEVICEID)    (DDDEVICEID.VendorId==0x1002)

Definition at line 68 of file dxgsg9base.h.

◆ IS_MATROX

#define IS_MATROX ( DDDEVICEID)    (DDDEVICEID.VendorId==0x102B)

Definition at line 69 of file dxgsg9base.h.

◆ IS_NVIDIA

#define IS_NVIDIA ( DDDEVICEID)    ((DDDEVICEID.VendorId==0x10DE) || (DDDEVICEID.VendorId==0x12D2))

Definition at line 67 of file dxgsg9base.h.

◆ IS_STENCIL_FORMAT

#define IS_STENCIL_FORMAT ( FMT)    (((FMT)==D3DFMT_D24S8) || ((FMT)==D3DFMT_D15S1) || ((FMT)==D3DFMT_D24X4S4))

Definition at line 194 of file dxgsg9base.h.

◆ IS_VALID_PTR

#define IS_VALID_PTR ( PTR)    (!IsBadWritePtr(PTR,sizeof(void*)))

Definition at line 77 of file dxgsg9base.h.

◆ ISPOW2

#define ISPOW2 ( X)    (((X) & ((X)-1))==0)

Definition at line 76 of file dxgsg9base.h.

◆ MAX_POSSIBLE_TEXFMTS

#define MAX_POSSIBLE_TEXFMTS   32

Definition at line 147 of file dxgsg9base.h.

◆ PANDA_MAXNUMVERTS

#define PANDA_MAXNUMVERTS   0xFFFF

Definition at line 144 of file dxgsg9base.h.

◆ PRINT_REFCNT

#define PRINT_REFCNT ( MODULE,
p )

Definition at line 135 of file dxgsg9base.h.

◆ RECT_XSIZE

#define RECT_XSIZE ( REC)    (REC.right-REC.left)

Definition at line 195 of file dxgsg9base.h.

◆ RECT_YSIZE

#define RECT_YSIZE ( REC)    (REC.bottom-REC.top)

Definition at line 196 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.

◆ RELEASE_DOWN_TO_ZERO

#define RELEASE_DOWN_TO_ZERO   true

Definition at line 95 of file dxgsg9base.h.

◆ RELEASE_ONCE

#define RELEASE_ONCE   false

Definition at line 96 of file dxgsg9base.h.

◆ SAFE_DELETE

#define SAFE_DELETE ( p)    { if(p) { assert(IS_VALID_PTR(p)); delete (p); (p)=nullptr; } }

Definition at line 87 of file dxgsg9base.h.

◆ SAFE_DELETE_ARRAY

#define SAFE_DELETE_ARRAY ( p)    { if(p) { assert(IS_VALID_PTR(p)); delete [] (p); (p)=nullptr; } }

Definition at line 88 of file dxgsg9base.h.

◆ SAFE_DELSHADER

#define SAFE_DELSHADER ( TYPE,
HANDLE,
PDEVICE )    if((HANDLE!=nullptr)&&IS_VALID_PTR(PDEVICE)) { PDEVICE->Delete##TYPE##Shader(HANDLE); HANDLE=nullptr; }

Definition at line 84 of file dxgsg9base.h.

◆ SAFE_FREELIB

#define SAFE_FREELIB ( hDLL)    { if(hDLL!=nullptr) { FreeLibrary(hDLL);hDLL = nullptr; } }

Definition at line 92 of file dxgsg9base.h.

◆ SAFE_RELEASE

#define SAFE_RELEASE ( p)    { if(p) { assert(IS_VALID_PTR(p)); (p)->Release(); (p)=nullptr; } }

Definition at line 91 of file dxgsg9base.h.

◆ STRICT

#define STRICT

Definition at line 26 of file dxgsg9base.h.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN   1

Definition at line 22 of file dxgsg9base.h.

Typedef Documentation

◆ DXShaderHandle

typedef DWORD DXShaderHandle

Definition at line 74 of file dxgsg9base.h.

Enumeration Type Documentation

◆ D3DFORMAT_FLAG

enum D3DFORMAT_FLAG

Definition at line 148 of file dxgsg9base.h.

◆ ShaderType

enum ShaderType

Definition at line 73 of file dxgsg9base.h.

Function Documentation

◆ D3DFormatStr()

const char * D3DFormatStr ( D3DFORMAT fmt)
extern

Definition at line 878 of file wdxGraphicsPipe9.cxx.

◆ Init_D3DFORMAT_map()

void Init_D3DFORMAT_map ( )
extern

Definition at line 836 of file wdxGraphicsPipe9.cxx.

Variable Documentation

◆ g_D3DFORMATmap

pmap<D3DFORMAT_FLAG,D3DFORMAT> g_D3DFORMATmap
extern

Definition at line 834 of file wdxGraphicsPipe9.cxx.