Panda3D
|
00001 // Filename: wglGraphicsWindow.h 00002 // Created by: drose (20Dec02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef WGLGRAPHICSWINDOW_H 00016 #define WGLGRAPHICSWINDOW_H 00017 00018 #include "pandabase.h" 00019 #include "winGraphicsWindow.h" 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Class : wglGraphicsWindow 00023 // Description : A single graphics window for rendering OpenGL under 00024 // Microsoft Windows. 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