00001 // Filename: wglGraphicsWindow.h 00002 // Created by: drose (20Dec02) 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 WGLGRAPHICSWINDOW_H 00020 #define WGLGRAPHICSWINDOW_H 00021 00022 #include "pandabase.h" 00023 #include "winGraphicsWindow.h" 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : wglGraphicsWindow 00027 // Description : A single graphics window for rendering OpenGL under 00028 // Microsoft Windows. 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDAGL wglGraphicsWindow : public WinGraphicsWindow { 00031 public: 00032 wglGraphicsWindow(GraphicsPipe *pipe, GraphicsStateGuardian *gsg); 00033 virtual ~wglGraphicsWindow(); 00034 00035 virtual void make_current(); 00036 virtual void release_gsg(); 00037 00038 virtual void begin_flip(); 00039 00040 protected: 00041 virtual void close_window(); 00042 virtual bool open_window(); 00043 virtual void reconsider_fullscreen_size(DWORD &x_size, DWORD &y_size, 00044 DWORD &bitdepth); 00045 00046 private: 00047 void setup_colormap(const PIXELFORMATDESCRIPTOR &pixelformat); 00048 00049 #ifdef _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