tinyWinGraphicsWindow.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #ifndef TINYWINGRAPHICSWINDOW_H
  15. #define TINYWINGRAPHICSWINDOW_H
  16. #include "pandabase.h"
  17. #ifdef WIN32
  18. #include "winGraphicsWindow.h"
  19. #include "tinyWinGraphicsPipe.h"
  20. ////////////////////////////////////////////////////////////////////
  21. // Class : TinyWinGraphicsWindow
  22. // Description : Opens a window on Microsoft Windows to display the
  23. // TinyPanda software rendering.
  24. ////////////////////////////////////////////////////////////////////
  25. class EXPCL_TINYDISPLAY TinyWinGraphicsWindow : public WinGraphicsWindow {
  26. public:
  27. TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
  28. const string &name,
  29. const FrameBufferProperties &fb_prop,
  30. const WindowProperties &win_prop,
  31. int flags,
  32. GraphicsStateGuardian *gsg,
  33. GraphicsOutput *host);
  34. virtual ~TinyWinGraphicsWindow();
  35. virtual bool begin_frame(FrameMode mode, Thread *current_thread);
  36. virtual void end_frame(FrameMode mode, Thread *current_thread);
  37. virtual void end_flip();
  38. virtual bool supports_pixel_zoom() const;
  39. protected:
  40. virtual void close_window();
  41. virtual bool open_window();
  42. virtual void handle_reshape();
  43. virtual bool do_fullscreen_resize(int x_size, int y_size);
  44. private:
  45. void create_frame_buffer();
  46. void setup_bitmap_info();
  47. private:
  48. ZBuffer *_frame_buffer;
  49. HDC _hdc;
  50. BITMAPINFO _bitmap_info;
  51. public:
  52. static TypeHandle get_class_type() {
  53. return _type_handle;
  54. }
  55. static void init_type() {
  56. WinGraphicsWindow::init_type();
  57. register_type(_type_handle, "TinyWinGraphicsWindow",
  58. WinGraphicsWindow::get_class_type());
  59. }
  60. virtual TypeHandle get_type() const {
  61. return get_class_type();
  62. }
  63. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  64. private:
  65. static TypeHandle _type_handle;
  66. };
  67. #include "tinyWinGraphicsWindow.I"
  68. #endif // WIN32
  69. #endif