Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

dxgsg8base.h File Reference

#include <windows.h>
#include <d3d8.h>
#include <d3dx8.h>
#include <dxerr8.h>
#include "pandabase.h"
#include "graphicsWindow.h"

Go to the source code of this file.

Compounds

struct  DXScreenData

Defines

#define _WIN32_WINNT   0x0502
#define WIN32_LEAN_AND_MEAN
#define D3D_OVERLOADS
#define D3DERRORSTRING(HRESULT)   " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString8(HRESULT) << ": " << DXGetErrorDescription8(HRESULT) << endl
#define IS_NVIDIA(DDDEVICEID)   ((DDDEVICEID.VendorId==0x10DE) || (DDDEVICEID.VendorId==0x12D2))
#define IS_ATI(DDDEVICEID)   (DDDEVICEID.VendorId==0x1002)
#define IS_MATROX(DDDEVICEID)   (DDDEVICEID.VendorId==0x102B)
#define D3D_MAXTEXTURESTAGES   8
#define ISPOW2(X)   (((X) & ((X)-1))==0)
#define IS_VALID_PTR(PTR)   (!IsBadWritePtr(PTR,sizeof(void*)))
#define DX_DECLARE_CLEAN(type, var)
#define SAFE_DELSHADER(TYPE, HANDLE, PDEVICE)   if((HANDLE!=NULL)&&IS_VALID_PTR(PDEVICE)) { PDEVICE->Delete##TYPE##Shader(HANDLE); HANDLE=NULL; }
#define SAFE_DELETE(p)   { if(p) { assert(IS_VALID_PTR(p)); delete (p); (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p)   { if(p) { assert(IS_VALID_PTR(p)); delete [] (p); (p)=NULL; } }
#define SAFE_RELEASE(p)   { if(p) { assert(IS_VALID_PTR(p)); (p)->Release(); (p)=NULL; } }
#define SAFE_FREELIB(hDLL)   { if(hDLL!=NULL) { FreeLibrary(hDLL);hDLL = NULL; } }
#define RELEASE_DOWN_TO_ZERO   true
#define RELEASE_ONCE   false
#define DEBUG_RELEASES
#define RELEASE(OBJECT, MODULE, DBGSTR, bDoDownToZero)
#define PRINT_REFCNT(MODULE, p)
#define DO_PSTATS_STUFF(XX)
#define PANDA_MAXNUMVERTS   0xFFFF
#define FLG(NN)   (1<<NN)
#define MAX_POSSIBLE_TEXFMTS   32
#define DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT1_FLAG
#define DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT2_FLAG
#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_STENCIL_FORMAT(FMT)   (((FMT)==D3DFMT_D24S8) || ((FMT)==D3DFMT_D15S1) || ((FMT)==D3DFMT_D24X4S4))
#define RECT_XSIZE(REC)   (REC.right-REC.left)
#define RECT_YSIZE(REC)   (REC.bottom-REC.top)

Typedefs

typedef DWORD DXShaderHandle

Enumerations

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

Functions

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

Variables

map< D3DFORMAT_FLAG, D3DFORMAT > g_D3DFORMATmap


Define Documentation

#define _WIN32_WINNT   0x0502
 

Definition at line 25 of file dxgsg8base.h.

#define D3D_MAXTEXTURESTAGES   8
 

Definition at line 69 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::dx_cleanup(), and DXGraphicsStateGuardian8::free_d3d_device().

#define D3D_OVERLOADS
 

Definition at line 35 of file dxgsg8base.h.

#define D3DERRORSTRING HRESULT   )     " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString8(HRESULT) << ": " << DXGetErrorDescription8(HRESULT) << endl
 

Definition at line 60 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::begin_scene(), DXGraphicsStateGuardian8::CheckCooperativeLevel(), wdxGraphicsWindow8::choose_device(), ConvertD3DSurftoPixBuf(), DXGraphicsStateGuardian8::copy_pixel_buffer(), DXGraphicsStateGuardian8::copy_texture(), wdxGraphicsWindow8::create_screen_buffers_and_device(), DInput8Info::CreateJoystickOrPad(), DXTextureContext8::CreateTexture(), DXGraphicsStateGuardian8::do_clear(), DXGraphicsStateGuardian8::dx_init(), DXGraphicsStateGuardian8::end_scene(), CD3DFont::EndText(), EnumObjectsCallbackJoystick(), DXTextureContext8::FillDDSurfTexturePixels(), wdxGraphicsPipe8::find_all_card_memavails(), wdxGraphicsPipe8::find_best_depth_format(), wdxGraphicsWindow8::init_resized_window(), DXGraphicsStateGuardian8::init_shader(), CD3DFont::InitDeviceObjects(), DInput8Info::InitDirectInput(), DXGraphicsStateGuardian8::issue_transform(), DXGraphicsStateGuardian8::prepare_display_region(), DXGraphicsStateGuardian8::read_pixel_shader(), DXGraphicsStateGuardian8::read_vertex_shader(), DInput8Info::ReadJoystick(), DXGraphicsStateGuardian8::report_texmgr_stats(), wdxGraphicsWindow8::reset_device_resize_window(), CD3DFont::RestoreDeviceObjects(), wdxGraphicsWindow8::search_for_device(), wdxGraphicsPipe8::search_for_valid_displaymode(), DXGraphicsStateGuardian8::show_frame(), and TestDrawPrimFailure().

#define DEBUG_RELEASES
 

Definition at line 98 of file dxgsg8base.h.

#define DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT2_FLAG
 

Definition at line 184 of file dxgsg8base.h.

Referenced by wdxGraphicsPipe8::search_for_valid_displaymode().

#define DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG   DXT1_FLAG
 

Definition at line 183 of file dxgsg8base.h.

Referenced by wdxGraphicsPipe8::search_for_valid_displaymode().

#define DO_PSTATS_STUFF XX   ) 
 

Definition at line 140 of file dxgsg8base.h.

#define DX_DECLARE_CLEAN type,
var   ) 
 

Value:

type var;                       \
    ZeroMemory(&var, sizeof(type)); \
    var.dwSize = sizeof(type);

Definition at line 77 of file dxgsg8base.h.

#define FLG NN   )     (1<<NN)
 

Definition at line 145 of file dxgsg8base.h.

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

Definition at line 186 of file dxgsg8base.h.

Referenced by wdxGraphicsWindow8::create_screen_buffers_and_device(), wdxGraphicsWindow8::do_fullscreen_resize(), DXGraphicsStateGuardian8::dx_init(), wdxGraphicsPipe8::find_best_depth_format(), and wdxGraphicsPipe8::search_for_valid_displaymode().

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

Definition at line 187 of file dxgsg8base.h.

Referenced by wdxGraphicsPipe8::find_best_depth_format(), and wdxGraphicsPipe8::search_for_valid_displaymode().

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

Definition at line 66 of file dxgsg8base.h.

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

Definition at line 67 of file dxgsg8base.h.

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

Definition at line 65 of file dxgsg8base.h.

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

Definition at line 188 of file dxgsg8base.h.

Referenced by wdxGraphicsWindow8::create_screen_buffers_and_device(), DXGraphicsStateGuardian8::do_clear(), wdxGraphicsWindow8::do_fullscreen_resize(), and wdxGraphicsWindow8::verify_window_sizes().

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

Definition at line 75 of file dxgsg8base.h.

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

Definition at line 74 of file dxgsg8base.h.

#define MAX_POSSIBLE_TEXFMTS   32
 

Definition at line 146 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::dx_init().

#define PANDA_MAXNUMVERTS   0xFFFF
 

Definition at line 143 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::draw_point(), DXGraphicsStateGuardian8::draw_sphere(), DXGraphicsStateGuardian8::draw_sprite(), DXGraphicsStateGuardian8::dx_init(), and DXGraphicsStateGuardian8::GenerateSphere().

#define PRINT_REFCNT MODULE,
p   ) 
 

Value:

{ ULONG refcnt;  (p)->AddRef();  refcnt=(p)->Release(); \
                                 MODULE##_cat.debug() << #p << " has refcnt = " << refcnt << " at " << __FILE__ << ":" << __LINE__ << endl; }

Definition at line 117 of file dxgsg8base.h.

Referenced by wdxGraphicsWindow8::create_screen_buffers_and_device(), CD3DFont::DeleteDeviceObjects(), DXGraphicsStateGuardian8::dx_cleanup(), DXGraphicsStateGuardian8::dx_init(), CD3DFont::InvalidateDeviceObjects(), and CD3DFont::RestoreDeviceObjects().

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

Definition at line 189 of file dxgsg8base.h.

Referenced by ConvertD3DSurftoPixBuf(), and DXGraphicsStateGuardian8::copy_pixel_buffer().

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

Definition at line 190 of file dxgsg8base.h.

Referenced by ConvertD3DSurftoPixBuf(), and DXGraphicsStateGuardian8::copy_pixel_buffer().

#define RELEASE OBJECT,
MODULE,
DBGSTR,
bDoDownToZero   ) 
 

Value:

{  \
   ULONG refcnt;                                                \
   if(IS_VALID_PTR(OBJECT)) {                                   \
        refcnt = (OBJECT)->Release();                           \
        MODULE##_cat.debug() << DBGSTR << " released, refcnt = " << refcnt << " at " << __FILE__ << ":" << __LINE__ << endl; \
        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) = NULL;                          \
      } else {                                    \
        MODULE##_cat.debug() << DBGSTR << " not released, ptr == NULL" << endl;  \
      }}

Definition at line 101 of file dxgsg8base.h.

#define RELEASE_DOWN_TO_ZERO   true
 

Definition at line 93 of file dxgsg8base.h.

#define RELEASE_ONCE   false
 

Definition at line 94 of file dxgsg8base.h.

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

Definition at line 85 of file dxgsg8base.h.

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

Definition at line 86 of file dxgsg8base.h.

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

Definition at line 82 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::DeleteAllDeviceObjects(), and DXGraphicsStateGuardian8::dx_cleanup().

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

Definition at line 90 of file dxgsg8base.h.

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

Definition at line 89 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::copy_texture(), DXGraphicsStateGuardian8::DeleteAllDeviceObjects(), CD3DFont::DeleteDeviceObjects(), DXGraphicsStateGuardian8::dx_cleanup(), CD3DFont::EndText(), CD3DFont::InvalidateDeviceObjects(), DXGraphicsStateGuardian8::read_pixel_shader(), DXGraphicsStateGuardian8::read_vertex_shader(), and DInput8Info::~DInput8Info().

#define WIN32_LEAN_AND_MEAN
 

Definition at line 27 of file dxgsg8base.h.


Typedef Documentation

typedef DWORD DXShaderHandle
 

Definition at line 72 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::read_pixel_shader(), and DXGraphicsStateGuardian8::read_vertex_shader().


Enumeration Type Documentation

enum D3DFORMAT_FLAG
 

Enumeration values:
R8G8B8_FLAG 
A8R8G8B8_FLAG 
X8R8G8B8_FLAG 
R5G6B5_FLAG 
X1R5G5B5_FLAG 
A1R5G5B5_FLAG 
A4R4G4B4_FLAG 
R3G3B2_FLAG 
A8_FLAG 
A8R3G3B2_FLAG 
X4R4G4B4_FLAG 
A2B10G10R10_FLAG 
G16R16_FLAG 
A8P8_FLAG 
P8_FLAG 
L8_FLAG 
A8L8_FLAG 
A4L4_FLAG 
V8U8_FLAG 
L6V5U5_FLAG 
X8L8V8U8_FLAG 
Q8W8V8U8_FLAG 
V16U16_FLAG 
W11V11U10_FLAG 
A2W10V10U10_FLAG 
UYVY_FLAG 
YUY2_FLAG 
DXT1_FLAG 
DXT2_FLAG 
DXT3_FLAG 
DXT4_FLAG 
DXT5_FLAG 

Definition at line 147 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::dx_init().

enum ShaderType
 

Enumeration values:
VertexShader 
PixelShader 

Definition at line 71 of file dxgsg8base.h.


Function Documentation

const char* D3DFormatStr D3DFORMAT  fmt  ) 
 

Definition at line 838 of file wdxGraphicsPipe8.cxx.

Referenced by ConvertD3DSurftoPixBuf(), wdxGraphicsWindow8::create_screen_buffers_and_device(), DXTextureContext8::CreateTexture(), wdxGraphicsPipe8::find_best_depth_format(), and wdxGraphicsPipe8::search_for_valid_displaymode().

void Init_D3DFORMAT_map void   ) 
 

Definition at line 797 of file wdxGraphicsPipe8.cxx.

References g_D3DFORMATmap.

Referenced by wdxGraphicsPipe8::init().


Variable Documentation

map<D3DFORMAT_FLAG,D3DFORMAT> g_D3DFORMATmap
 

Definition at line 216 of file dxgsg8base.h.

Referenced by DXGraphicsStateGuardian8::dx_init(), and Init_D3DFORMAT_map().


Generated on Fri Apr 18 00:10:42 2003 for Panda by doxygen1.3