From 57ca8e62c0b7d303f6f3ff198f81ea65165450f1 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Thu, 8 May 2008 23:38:42 +0000 Subject: [PATCH] Add max simultaneous render targets. --- panda/src/display/graphicsStateGuardian.I | 11 +++++++++++ panda/src/display/graphicsStateGuardian.cxx | 2 ++ panda/src/display/graphicsStateGuardian.h | 4 ++++ panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 1 + 4 files changed, 18 insertions(+) diff --git a/panda/src/display/graphicsStateGuardian.I b/panda/src/display/graphicsStateGuardian.I index 7ae6afdb6f..1df6adbc55 100644 --- a/panda/src/display/graphicsStateGuardian.I +++ b/panda/src/display/graphicsStateGuardian.I @@ -529,6 +529,17 @@ get_supports_two_sided_stencil() const { 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 // Access: Published diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 297d4ebd0d..feaa6d4b9a 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -190,6 +190,8 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, _supports_stencil_wrap = false; _supports_two_sided_stencil = false; + _maximum_simultaneuous_render_targets = 1; + _supported_geom_rendering = 0; // If this is true, then we can apply a color and/or color scale by diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 5c9b2c9c7a..ef29c1c1c6 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -134,6 +134,8 @@ PUBLISHED: INLINE bool get_supports_basic_shaders() const; INLINE bool get_supports_two_sided_stencil() const; + INLINE int get_maximum_simultaneuous_render_targets() const; + INLINE int get_shader_model() const; INLINE void set_shader_model(int shader_model); @@ -395,6 +397,8 @@ protected: bool _supports_stencil_wrap; bool _supports_two_sided_stencil; + int _maximum_simultaneuous_render_targets; + int _supported_geom_rendering; bool _color_scale_via_lighting; bool _alpha_scale_via_texture; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 1d80f94123..ace32c4bbf 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -840,6 +840,7 @@ reset() { GLint max_draw_buffers = 0; GLP(GetIntegerv)(GL_MAX_DRAW_BUFFERS, &max_draw_buffers); _max_draw_buffers = max_draw_buffers; + _maximum_simultaneuous_render_targets = max_draw_buffers; } _supports_occlusion_query = false;