Panda3D
tinyWinGraphicsWindow.h
1 // Filename: tinyWinGraphicsWindow.h
2 // Created by: drose (06May08)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef TINYWINGRAPHICSWINDOW_H
16 #define TINYWINGRAPHICSWINDOW_H
17 
18 #include "pandabase.h"
19 
20 #ifdef WIN32
21 
22 #include "winGraphicsWindow.h"
23 #include "tinyWinGraphicsPipe.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : TinyWinGraphicsWindow
27 // Description : Opens a window on Microsoft Windows to display the
28 // TinyPanda software rendering.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_TINYDISPLAY TinyWinGraphicsWindow : public WinGraphicsWindow {
31 public:
32  TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
33  const string &name,
34  const FrameBufferProperties &fb_prop,
35  const WindowProperties &win_prop,
36  int flags,
38  GraphicsOutput *host);
39  virtual ~TinyWinGraphicsWindow();
40 
41  virtual bool begin_frame(FrameMode mode, Thread *current_thread);
42  virtual void end_frame(FrameMode mode, Thread *current_thread);
43 
44  virtual void end_flip();
45  virtual bool supports_pixel_zoom() const;
46 
47 protected:
48  virtual void close_window();
49  virtual bool open_window();
50 
51  virtual void handle_reshape();
52  virtual bool do_fullscreen_resize(int x_size, int y_size);
53 
54 private:
55  void create_frame_buffer();
56  void setup_bitmap_info();
57 
58 private:
59  ZBuffer *_frame_buffer;
60  HDC _hdc;
61  BITMAPINFO _bitmap_info;
62 
63 public:
64  static TypeHandle get_class_type() {
65  return _type_handle;
66  }
67  static void init_type() {
68  WinGraphicsWindow::init_type();
69  register_type(_type_handle, "TinyWinGraphicsWindow",
70  WinGraphicsWindow::get_class_type());
71  }
72  virtual TypeHandle get_type() const {
73  return get_class_type();
74  }
75  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
76 
77 private:
78  static TypeHandle _type_handle;
79 };
80 
81 #include "tinyWinGraphicsWindow.I"
82 
83 #endif // WIN32
84 
85 #endif
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An abstract base class for glGraphicsWindow and dxGraphicsWindow (and, in general, graphics windows that interface with the Microsoft Windows API).
virtual bool supports_pixel_zoom() const
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored...
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
This is a base class for the various different classes that represent the result of a frame of render...
A thread; that is, a lightweight process.
Definition: thread.h:51
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame...