00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00034
00035
00036
00037
00038
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
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
00067
00068
00069
00070
00071
00072
00073
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
00107
00108 #include "wdxGraphicsWindow8.I"
00109
00110 #endif