Browse Source

Add max simultaneous render targets.

aignacio_sf 17 years ago
parent
commit
57ca8e62c0

+ 11 - 0
panda/src/display/graphicsStateGuardian.I

@@ -529,6 +529,17 @@ get_supports_two_sided_stencil() const {
   return _supports_two_sided_stencil;
   return _supports_two_sided_stencil;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: GraphicsStateGuardian::get_maximum_simultaneuous_render_targets
+//       Access: Published
+//  Description: Returns the maximum simultaneuous render targets 
+//               supported.
+////////////////////////////////////////////////////////////////////
+INLINE int GraphicsStateGuardian::
+get_maximum_simultaneuous_render_targets() const {
+  return _maximum_simultaneuous_render_targets;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GraphicsStateGuardian::get_shader_model
 //     Function: GraphicsStateGuardian::get_shader_model
 //       Access: Published
 //       Access: Published

+ 2 - 0
panda/src/display/graphicsStateGuardian.cxx

@@ -190,6 +190,8 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system,
   _supports_stencil_wrap = false;
   _supports_stencil_wrap = false;
   _supports_two_sided_stencil = false;
   _supports_two_sided_stencil = false;
 
 
+  _maximum_simultaneuous_render_targets = 1;
+
   _supported_geom_rendering = 0;
   _supported_geom_rendering = 0;
 
 
   // If this is true, then we can apply a color and/or color scale by
   // If this is true, then we can apply a color and/or color scale by

+ 4 - 0
panda/src/display/graphicsStateGuardian.h

@@ -134,6 +134,8 @@ PUBLISHED:
   INLINE bool get_supports_basic_shaders() const;
   INLINE bool get_supports_basic_shaders() const;
   INLINE bool get_supports_two_sided_stencil() const;
   INLINE bool get_supports_two_sided_stencil() const;
 
 
+  INLINE int get_maximum_simultaneuous_render_targets() const;
+
   INLINE int get_shader_model() const;
   INLINE int get_shader_model() const;
   INLINE void set_shader_model(int shader_model);
   INLINE void set_shader_model(int shader_model);
 
 
@@ -395,6 +397,8 @@ protected:
   bool _supports_stencil_wrap;
   bool _supports_stencil_wrap;
   bool _supports_two_sided_stencil;
   bool _supports_two_sided_stencil;
 
 
+  int _maximum_simultaneuous_render_targets;
+
   int  _supported_geom_rendering;
   int  _supported_geom_rendering;
   bool _color_scale_via_lighting;
   bool _color_scale_via_lighting;
   bool _alpha_scale_via_texture;
   bool _alpha_scale_via_texture;

+ 1 - 0
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -840,6 +840,7 @@ reset() {
     GLint max_draw_buffers = 0;
     GLint max_draw_buffers = 0;
     GLP(GetIntegerv)(GL_MAX_DRAW_BUFFERS, &max_draw_buffers);
     GLP(GetIntegerv)(GL_MAX_DRAW_BUFFERS, &max_draw_buffers);
     _max_draw_buffers = max_draw_buffers;
     _max_draw_buffers = max_draw_buffers;
+    _maximum_simultaneuous_render_targets = max_draw_buffers;
   }
   }
 
 
   _supports_occlusion_query = false;
   _supports_occlusion_query = false;