00001 // Filename: wdxGraphicsWindow7.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 WDXGRAPHICSWINDOW7_H 00020 #define WDXGRAPHICSWINDOW7_H 00021 00022 #include "pandabase.h" 00023 #include "winGraphicsWindow.h" 00024 #include "pvector.h" 00025 00026 class DXGraphicsStateGuardian7; 00027 00028 typedef struct { 00029 char szDriver[MAX_DDDEVICEID_STRING]; 00030 char szDescription[MAX_DDDEVICEID_STRING]; 00031 GUID guidDeviceIdentifier; 00032 HMONITOR hMon; 00033 } DXDeviceInfo; 00034 typedef pvector<DXDeviceInfo> DXDeviceInfoVec; 00035 00036 typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter); 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Class : wdxGraphicsWindow7 00040 // Description : A single graphics window for rendering DirectX under 00041 // Microsoft Windows. 00042 //////////////////////////////////////////////////////////////////// 00043 class EXPCL_PANDADX wdxGraphicsWindow7 : public WinGraphicsWindow { 00044 public: 00045 wdxGraphicsWindow7(GraphicsPipe *pipe, GraphicsStateGuardian *gsg); 00046 virtual ~wdxGraphicsWindow7(); 00047 virtual void end_flip(); 00048 //virtual bool begin_frame(); 00049 virtual void make_current(void); 00050 virtual bool open_window(void); 00051 00052 protected: 00053 virtual void fullscreen_restored(WindowProperties &properties); 00054 virtual void handle_reshape(); 00055 virtual bool do_fullscreen_resize(int x_size, int y_size); 00056 00057 private: 00058 bool set_to_temp_rendertarget(); 00059 void create_screen_buffers_and_device(DXScreenData &Display, 00060 bool force_16bpp_zbuffer); 00061 bool choose_device(int devnum, DXDeviceInfo *pDevinfo); 00062 void set_coop_levels_and_display_modes(); 00063 00064 DXGraphicsStateGuardian7 *_dxgsg; 00065 DXScreenData _wcontext; 00066 00067 public: 00068 static TypeHandle get_class_type() { 00069 return _type_handle; 00070 } 00071 static void init_type() { 00072 WinGraphicsWindow::init_type(); 00073 register_type(_type_handle, "wdxGraphicsWindow7", 00074 WinGraphicsWindow::get_class_type()); 00075 } 00076 virtual TypeHandle get_type() const { 00077 return get_class_type(); 00078 } 00079 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00080 00081 private: 00082 static TypeHandle _type_handle; 00083 }; 00084 00085 #include "wdxGraphicsWindow7.I" 00086 00087 #endif