Panda3D

tinyWinGraphicsWindow.h

00001 // Filename: tinyWinGraphicsWindow.h
00002 // Created by:  drose (06May08)
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 TINYWINGRAPHICSWINDOW_H
00016 #define TINYWINGRAPHICSWINDOW_H
00017 
00018 #include "pandabase.h"
00019 
00020 #ifdef WIN32
00021 
00022 #include "winGraphicsWindow.h"
00023 #include "tinyWinGraphicsPipe.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : TinyWinGraphicsWindow
00027 // Description : Opens a window on Microsoft Windows to display the
00028 //               TinyPanda software rendering.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_TINYDISPLAY TinyWinGraphicsWindow : public WinGraphicsWindow {
00031 public:
00032   TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
00033                         const string &name,
00034                         const FrameBufferProperties &fb_prop,
00035                         const WindowProperties &win_prop,
00036                         int flags,
00037                         GraphicsStateGuardian *gsg,
00038                         GraphicsOutput *host);
00039   virtual ~TinyWinGraphicsWindow();
00040 
00041   virtual bool begin_frame(FrameMode mode, Thread *current_thread);
00042   virtual void end_frame(FrameMode mode, Thread *current_thread);
00043 
00044   virtual void end_flip();
00045   virtual bool supports_pixel_zoom() const;
00046 
00047 protected:
00048   virtual void close_window();
00049   virtual bool open_window();
00050 
00051   virtual void handle_reshape();
00052   virtual bool do_fullscreen_resize(int x_size, int y_size);
00053 
00054 private:
00055   void create_frame_buffer();
00056   void setup_bitmap_info();
00057 
00058 private:
00059   ZBuffer *_frame_buffer;
00060   HDC _hdc;
00061   BITMAPINFO _bitmap_info;
00062 
00063 public:
00064   static TypeHandle get_class_type() {
00065     return _type_handle;
00066   }
00067   static void init_type() {
00068     WinGraphicsWindow::init_type();
00069     register_type(_type_handle, "TinyWinGraphicsWindow",
00070                   WinGraphicsWindow::get_class_type());
00071   }
00072   virtual TypeHandle get_type() const {
00073     return get_class_type();
00074   }
00075   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00076 
00077 private:
00078   static TypeHandle _type_handle;
00079 };
00080 
00081 #include "tinyWinGraphicsWindow.I"
00082 
00083 #endif  // WIN32
00084 
00085 #endif
 All Classes Functions Variables Enumerations