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 00042 protected: 00043 virtual void close_window(); 00044 virtual bool open_window(); 00045 00046 private: 00047 void setup_colormap(const PIXELFORMATDESCRIPTOR &pixelformat); 00048 00049 #ifdef NOTIFY_DEBUG 00050 static void print_pfd(PIXELFORMATDESCRIPTOR *pfd, char *msg); 00051 #endif 00052 00053 HDC _hdc; 00054 HPALETTE _colormap; 00055 00056 public: 00057 static TypeHandle get_class_type() { 00058 return _type_handle; 00059 } 00060 static void init_type() { 00061 WinGraphicsWindow::init_type(); 00062 register_type(_type_handle, "wglGraphicsWindow", 00063 WinGraphicsWindow::get_class_type()); 00064 } 00065 virtual TypeHandle get_type() const { 00066 return get_class_type(); 00067 } 00068 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00069 00070 private: 00071 static TypeHandle _type_handle; 00072 }; 00073 00074 #include "wglGraphicsWindow.I" 00075 00076 #endif