Browse Source

Restore missing function from GLGSG

rdb 10 years ago
parent
commit
07d2b64d74
1 changed files with 32 additions and 0 deletions
  1. 32 0
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx

+ 32 - 0
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