tinyWinGraphicsWindow.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file tinyWinGraphicsWindow.h
  10. * @author drose
  11. * @date 2008-05-06
  12. */
  13. #ifndef TINYWINGRAPHICSWINDOW_H
  14. #define TINYWINGRAPHICSWINDOW_H
  15. #include "pandabase.h"
  16. #ifdef WIN32
  17. #include "winGraphicsWindow.h"
  18. #include "tinyWinGraphicsPipe.h"
  19. /**
  20. * Opens a window on Microsoft Windows to display the TinyPanda software
  21. * rendering.
  22. */
  23. class EXPCL_TINYDISPLAY TinyWinGraphicsWindow : public WinGraphicsWindow {
  24. public:
  25. TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
  26. const std::string &name,
  27. const FrameBufferProperties &fb_prop,
  28. const WindowProperties &win_prop,
  29. int flags,
  30. GraphicsStateGuardian *gsg,
  31. GraphicsOutput *host);
  32. virtual ~TinyWinGraphicsWindow();
  33. virtual bool begin_frame(FrameMode mode, Thread *current_thread);
  34. virtual void end_frame(FrameMode mode, Thread *current_thread);
  35. virtual void end_flip();
  36. virtual bool supports_pixel_zoom() const;
  37. protected:
  38. virtual void close_window();
  39. virtual bool open_window();
  40. virtual void handle_reshape();
  41. virtual bool do_fullscreen_resize(int x_size, int y_size);
  42. private:
  43. void create_frame_buffer();
  44. void setup_bitmap_info();
  45. private:
  46. ZBuffer *_frame_buffer;
  47. HDC _hdc;
  48. BITMAPINFO _bitmap_info;
  49. public:
  50. static TypeHandle get_class_type() {
  51. return _type_handle;
  52. }
  53. static void init_type() {
  54. WinGraphicsWindow::init_type();
  55. register_type(_type_handle, "TinyWinGraphicsWindow",
  56. WinGraphicsWindow::get_class_type());
  57. }
  58. virtual TypeHandle get_type() const {
  59. return get_class_type();
  60. }
  61. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  62. private:
  63. static TypeHandle _type_handle;
  64. };
  65. #include "tinyWinGraphicsWindow.I"
  66. #endif // WIN32
  67. #endif