From 07d2b64d748c94900ada25615f379cd8689a507a Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 Dec 2015 23:15:09 +0100 Subject: [PATCH] Restore missing function from GLGSG --- .../glstuff/glGraphicsStateGuardian_src.cxx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index e87029272a..889e2b5e86 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3970,6 +3970,38 @@ unbind_buffers() { #endif } +#ifdef SUPPORT_FIXED_FUNCTION +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::disable_standard_vertex_arrays +// Access: Protected +// Description: Used to disable all the standard vertex arrays that +// are currently enabled. glShaderContexts are +// responsible for setting up their own vertex arrays, +// but before they can do so, the standard vertex +// arrays need to be disabled to get them "out of the +// way." Called only from begin_draw_primitives. +//////////////////////////////////////////////////////////////////// +void CLP(GraphicsStateGuardian):: +disable_standard_vertex_arrays() { +#ifdef SUPPORT_IMMEDIATE_MODE + if (_use_sender) return; +#endif + + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + GLPf(Color4)(1.0f, 1.0f, 1.0f, 1.0f); + + for (int stage_index=0; stage_index < _last_max_stage_index; stage_index++) { + _glClientActiveTexture(GL_TEXTURE0 + stage_index); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + } + _last_max_stage_index = 0; + + glDisableClientState(GL_VERTEX_ARRAY); + report_my_gl_errors(); +} +#endif // SUPPORT_FIXED_FUNCTION + #ifndef OPENGLES //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::update_shader_vertex_format