Browse Source

tinydisplay: Implement resizeability of offscreen buffers

Fixes #1322
rdb 3 years ago
parent
commit
3fc579c7d4

+ 9 - 0
panda/src/tinydisplay/tinyGraphicsBuffer.cxx

@@ -89,6 +89,15 @@ end_frame(FrameMode mode, Thread *current_thread) {
   }
 }
 
+/**
+ *
+ */
+void TinyGraphicsBuffer::
+set_size(int x, int y) {
+  GraphicsBuffer::set_size(x, y);
+  create_frame_buffer();
+}
+
 /**
  * Closes the buffer right now.  Called from the buffer thread.
  */

+ 2 - 0
panda/src/tinydisplay/tinyGraphicsBuffer.h

@@ -35,6 +35,8 @@ public:
   virtual bool begin_frame(FrameMode mode, Thread *current_thread);
   virtual void end_frame(FrameMode mode, Thread *current_thread);
 
+  virtual void set_size(int x, int y);
+
   INLINE ZBuffer *get_frame_buffer();
 
 protected: