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

panda/src/dxgsg8/wdxGraphicsPipe8.h

Go to the documentation of this file.
00001 // Filename: wdxGraphicsPipe8.h
00002 // Created by:  drose (20Dec02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 //       Class : wdxGraphicsPipe8
00040 // Description : This graphics pipe represents the interface for
00041 //               creating DirectX graphics windows.
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   // CardID is used in DX7 lowmem card-classification pass so DX8 can
00093   // establish correspondence b/w DX7 mem info & DX8 device
00094   struct CardID {
00095     HMONITOR hMon;
00096     DWORD MaxAvailVidMem;
00097     bool  bIsLowVidMemCard;
00098     GUID  DX7_DeviceGUID;
00099     DWORD VendorID, DeviceID;
00100     //   char  szDriver[MAX_DEVICE_IDENTIFIER_STRING];
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

Generated on Fri May 2 00:37:20 2003 for Panda by doxygen1.3