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