Browse Source

add get_framebuffer_format

cxgeorge 23 years ago
parent
commit
c7e59814b4
2 changed files with 12 additions and 1 deletions
  1. 8 0
      panda/src/display/graphicsWindow.cxx
  2. 4 1
      panda/src/display/graphicsWindow.h

+ 8 - 0
panda/src/display/graphicsWindow.cxx

@@ -693,3 +693,11 @@ get_depth_bitwidth(void) {
     display_cat.warning() << "get_depth_bitwidth() unimplemented by " << get_type() << endl; 
     display_cat.warning() << "get_depth_bitwidth() unimplemented by " << get_type() << endl; 
     return -1;
     return -1;
 }
 }
+
+void GraphicsWindow::
+get_framebuffer_format(PixelBuffer::Type &fb_type, PixelBuffer::Format &fb_format) {
+    display_cat.warning() << "get_framebuffer_format() unimplemented by " << get_type() << endl; 
+    
+    fb_type = PixelBuffer::T_unsigned_byte;
+    fb_format = PixelBuffer::F_rgb;
+}

+ 4 - 1
panda/src/display/graphicsWindow.h

@@ -113,13 +113,16 @@ public:
 
 
   INLINE const Properties& get_properties() const;
   INLINE const Properties& get_properties() const;
 
 
+  virtual void get_framebuffer_format(PixelBuffer::Type &fb_type, PixelBuffer::Format &fb_format);
+
 PUBLISHED:
 PUBLISHED:
   INLINE int get_width() const;
   INLINE int get_width() const;
   INLINE int get_height() const;
   INLINE int get_height() const;
   INLINE int get_xorg() const;
   INLINE int get_xorg() const;
   INLINE int get_yorg() const;
   INLINE int get_yorg() const;
 
 
-  virtual int get_depth_bitwidth(void);  // # of z bits/pixel
+  // # of z bits/pixel.  purpose is to adjust camera near plane if have fewer z bits
+  virtual int get_depth_bitwidth(void);  
 
 
   INLINE GraphicsStateGuardian *get_gsg() const;
   INLINE GraphicsStateGuardian *get_gsg() const;
   INLINE GraphicsPipe *get_pipe() const;
   INLINE GraphicsPipe *get_pipe() const;