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

panda/src/dxgsg8/wdxGraphicsWindow8.h

Go to the documentation of this file.
00001 // Filename: wdxGraphicsWindow8.h
00002 // Created by:  mike (09Jan97)
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 wdxGraphicsWindow8_H
00020 #define wdxGraphicsWindow8_H
00021 
00022 #include "pandabase.h"
00023 #include "winGraphicsWindow.h"
00024 #include "dxGraphicsStateGuardian8.h"
00025 #include "dxInput8.h"
00026 #include "wdxGraphicsPipe8.h"
00027 
00028 class wdxGraphicsPipe8;
00029 
00030 static const int WDXWIN_CONFIGURE = 4;
00031 static const int WDXWIN_EVENT = 8;
00032 
00033 //#define FIND_CARD_MEMAVAILS
00034 
00035 ////////////////////////////////////////////////////////////////////
00036 //       Class : wdxGraphicsWindow8
00037 // Description : A single graphics window for rendering DirectX under
00038 //               Microsoft Windows.
00039 ////////////////////////////////////////////////////////////////////
00040 class EXPCL_PANDADX wdxGraphicsWindow8 : public WinGraphicsWindow {
00041 public:
00042   wdxGraphicsWindow8(GraphicsPipe *pipe, GraphicsStateGuardian *gsg);
00043   virtual ~wdxGraphicsWindow8();
00044   virtual bool open_window(void);
00045 
00046   virtual int verify_window_sizes(int numsizes, int *dimen);
00047 
00048   virtual bool begin_frame();
00049   virtual void end_flip();
00050   virtual LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
00051   virtual bool handle_mouse_motion(int x, int y);
00052 
00053 protected:
00054   virtual void fullscreen_restored(WindowProperties &properties);
00055   virtual void handle_reshape();
00056   virtual bool do_fullscreen_resize(int x_size, int y_size);
00057 
00058 private:
00059   //  bool set_to_temp_rendertarget();
00060   void create_screen_buffers_and_device(DXScreenData &Display,
00061                                         bool force_16bpp_zbuffer);
00062 
00063   bool choose_device(void);
00064   bool search_for_device(wdxGraphicsPipe8 *dxpipe, DXDeviceInfo *device_info);
00065 
00066   //  void set_coop_levels_and_display_modes();
00067 /*
00068   void search_for_valid_displaymode(UINT RequestedX_Size, UINT RequestedY_Size,
00069                                     bool bWantZBuffer, bool bWantStencil,
00070                                     UINT *pSupportedScreenDepthsMask,
00071                                     bool *pCouldntFindAnyValidZBuf,
00072                                     D3DFORMAT *pSuggestedPixFmt,
00073                                     bool bVerboseMode = false);
00074 */
00075   bool reset_device_resize_window(UINT new_xsize, UINT new_ysize);
00076   void init_resized_window();
00077   static int D3DFMT_to_DepthBits(D3DFORMAT fmt);
00078   static bool is_badvidmem_card(D3DADAPTER_IDENTIFIER8 *pDevID);
00079 
00080   DXGraphicsStateGuardian8 *_dxgsg;
00081   DXScreenData _wcontext;
00082 
00083   int _depth_buffer_bpp;
00084   bool _awaiting_restore;
00085 
00086 public:
00087   static TypeHandle get_class_type() {
00088     return _type_handle;
00089   }
00090   static void init_type() {
00091     WinGraphicsWindow::init_type();
00092     register_type(_type_handle, "wdxGraphicsWindow8",
00093                   WinGraphicsWindow::get_class_type());
00094   }
00095   virtual TypeHandle get_type() const {
00096     return get_class_type();
00097   }
00098   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00099   virtual void make_current(void);
00100 
00101 private:
00102   static TypeHandle _type_handle;
00103   friend class wdxGraphicsPipe8;
00104 };
00105 
00106 //extern bool is_badvidmem_card(D3DADAPTER_IDENTIFIER8 *pDevID);
00107 
00108 #include "wdxGraphicsWindow8.I"
00109 
00110 #endif

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