00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WGLGRAPHICSWINDOW_H
00016 #define WGLGRAPHICSWINDOW_H
00017
00018 #include "pandabase.h"
00019 #include "winGraphicsWindow.h"
00020
00021
00022
00023
00024
00025
00026 class EXPCL_PANDAGL wglGraphicsWindow : public WinGraphicsWindow {
00027 public:
00028 wglGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
00029 const string &name,
00030 const FrameBufferProperties &fb_prop,
00031 const WindowProperties &win_prop,
00032 int flags,
00033 GraphicsStateGuardian *gsg,
00034 GraphicsOutput *host);
00035 virtual ~wglGraphicsWindow();
00036
00037 virtual bool begin_frame(FrameMode mode, Thread *current_thread);
00038 virtual void end_frame(FrameMode mode, Thread *current_thread);
00039
00040 virtual void begin_flip();
00041 virtual void ready_flip();
00042 virtual void end_flip();
00043
00044 protected:
00045 virtual void close_window();
00046 virtual bool open_window();
00047
00048 private:
00049 void setup_colormap(const PIXELFORMATDESCRIPTOR &pixelformat);
00050
00051 #ifdef NOTIFY_DEBUG
00052 static void print_pfd(PIXELFORMATDESCRIPTOR *pfd, char *msg);
00053 #endif
00054
00055 HDC _hdc;
00056 HPALETTE _colormap;
00057
00058 public:
00059 static TypeHandle get_class_type() {
00060 return _type_handle;
00061 }
00062 static void init_type() {
00063 WinGraphicsWindow::init_type();
00064 register_type(_type_handle, "wglGraphicsWindow",
00065 WinGraphicsWindow::get_class_type());
00066 }
00067 virtual TypeHandle get_type() const {
00068 return get_class_type();
00069 }
00070 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00071
00072 private:
00073 static TypeHandle _type_handle;
00074 };
00075
00076 #include "wglGraphicsWindow.I"
00077
00078 #endif