00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef WDXGRAPHICSPIPE8_H
00020 #define WDXGRAPHICSPIPE8_H
00021
00022 #include "pandabase.h"
00023 #include "winGraphicsPipe.h"
00024 #include "pvector.h"
00025 #include "dxgsg8base.h"
00026 #include <ddraw.h>
00027
00028 typedef struct {
00029 UINT cardID;
00030 char szDriver[MAX_DEVICE_IDENTIFIER_STRING];
00031 char szDescription[MAX_DEVICE_IDENTIFIER_STRING];
00032 GUID guidDeviceIdentifier;
00033 DWORD VendorID, DeviceID;
00034 HMONITOR hMon;
00035 } DXDeviceInfo;
00036 typedef pvector<DXDeviceInfo> DXDeviceInfoVec;
00037
00038
00039
00040
00041
00042
00043 class EXPCL_PANDADX wdxGraphicsPipe8 : public WinGraphicsPipe {
00044 public:
00045 wdxGraphicsPipe8();
00046 virtual ~wdxGraphicsPipe8();
00047
00048 virtual string get_interface_name() const;
00049 static PT(GraphicsPipe) pipe_constructor();
00050
00051 virtual PT(GraphicsStateGuardian) make_gsg(const FrameBufferProperties &properties);
00052
00053 bool find_best_depth_format(DXScreenData &Display, D3DDISPLAYMODE &TestDisplayMode,
00054 D3DFORMAT *pBestFmt, bool bWantStencil,
00055 bool bForce16bpp, bool bVerboseMode = false) const;
00056
00057 void search_for_valid_displaymode(DXScreenData &scrn,
00058 UINT RequestedX_Size, UINT RequestedY_Size,
00059 bool bWantZBuffer, bool bWantStencil,
00060 UINT *pSupportedScreenDepthsMask,
00061 bool *pCouldntFindAnyValidZBuf,
00062 D3DFORMAT *pSuggestedPixFmt,
00063 bool bForce16bppZBuffer,
00064 bool bVerboseMode = false);
00065
00066 bool special_check_fullscreen_resolution(DXScreenData &scrn, UINT x_size,UINT y_size);
00067
00068 protected:
00069 virtual PT(GraphicsWindow) make_window(GraphicsStateGuardian *gsg);
00070
00071 private:
00072 bool init();
00073 bool find_all_card_memavails();
00074
00075 static BOOL WINAPI
00076 dx7_driver_enum_callback(GUID *pGUID, TCHAR *strDesc, TCHAR *strName,
00077 VOID *argptr, HMONITOR hm);
00078
00079 private:
00080 HINSTANCE _hDDrawDLL;
00081 HINSTANCE _hD3D8_DLL;
00082 LPDIRECT3D8 _pD3D8;
00083
00084
00085 typedef LPDIRECT3D8 (WINAPI *Direct3DCreate8_ProcPtr)(UINT SDKVersion);
00086 typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter);
00087
00088 LPDIRECTDRAWCREATEEX _DirectDrawCreateEx;
00089 LPDIRECTDRAWENUMERATEEX _DirectDrawEnumerateExA;
00090 Direct3DCreate8_ProcPtr _Direct3DCreate8;
00091
00092
00093
00094 struct CardID {
00095 HMONITOR hMon;
00096 DWORD MaxAvailVidMem;
00097 bool bIsLowVidMemCard;
00098 GUID DX7_DeviceGUID;
00099 DWORD VendorID, DeviceID;
00100
00101 };
00102
00103 typedef pvector<CardID> CardIDs;
00104 CardIDs _card_ids;
00105 bool _bIsDX81;
00106
00107 public:
00108 static TypeHandle get_class_type() {
00109 return _type_handle;
00110 }
00111 static void init_type() {
00112 WinGraphicsPipe::init_type();
00113 register_type(_type_handle, "wdxGraphicsPipe8",
00114 WinGraphicsPipe::get_class_type());
00115 }
00116 virtual TypeHandle get_type() const {
00117 return get_class_type();
00118 }
00119 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00120
00121 private:
00122 static TypeHandle _type_handle;
00123
00124 friend class wdxGraphicsWindow8;
00125 };
00126
00127 #include "wdxGraphicsPipe8.I"
00128
00129 #endif