Browse Source

restore GeomContexts and display lists

David Rose 22 years ago
parent
commit
50f7d0bce7
76 changed files with 672 additions and 12848 deletions
  1. 0 7
      panda/src/crgsg/clean
  2. 0 132
      panda/src/crgsg/config_crgsg.cxx
  3. 0 49
      panda/src/crgsg/config_crgsg.h
  4. 0 21
      panda/src/crgsg/crGeomNodeContext.cxx
  5. 0 88
      panda/src/crgsg/crGeomNodeContext.h
  6. 0 1099
      panda/src/crgsg/crGraphicsStateGuardian.I
  7. 0 4849
      panda/src/crgsg/crGraphicsStateGuardian.cxx
  8. 0 362
      panda/src/crgsg/crGraphicsStateGuardian.h
  9. 0 39
      panda/src/crgsg/crSavedFrameBuffer.I
  10. 0 21
      panda/src/crgsg/crSavedFrameBuffer.cxx
  11. 0 31
      panda/src/crgsg/crTextureContext.I
  12. 0 21
      panda/src/crgsg/crTextureContext.cxx
  13. 0 79
      panda/src/crgsg/crTextureContext.h
  14. 0 946
      panda/src/crgsg/create_crgsg.py
  15. 0 3296
      panda/src/crgsg/crext.h
  16. 0 5
      panda/src/crgsg/crgsg_composite1.cxx
  17. 0 6
      panda/src/crgsg/index.html
  18. 1 3
      panda/src/display/Sources.pp
  19. 0 2
      panda/src/display/config_display.cxx
  20. 0 1
      panda/src/display/display_composite1.cxx
  21. 0 27
      panda/src/display/geomContext.I
  22. 0 29
      panda/src/display/geomNodeContext.I
  23. 0 21
      panda/src/display/geomNodeContext.cxx
  24. 0 75
      panda/src/display/geomNodeContext.h
  25. 0 61
      panda/src/display/graphicsStateGuardian.cxx
  26. 0 8
      panda/src/display/graphicsStateGuardian.h
  27. 1 2
      panda/src/dxgsg7/Sources.pp
  28. 0 1
      panda/src/dxgsg7/config_dxgsg7.cxx
  29. 0 31
      panda/src/dxgsg7/dxGeomNodeContext7.I
  30. 0 33
      panda/src/dxgsg7/dxGeomNodeContext7.cxx
  31. 0 84
      panda/src/dxgsg7/dxGeomNodeContext7.h
  32. 0 591
      panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx
  33. 0 7
      panda/src/dxgsg7/dxGraphicsStateGuardian7.h
  34. 0 1
      panda/src/dxgsg7/dxgsg7_composite1.cxx
  35. 1 2
      panda/src/dxgsg8/Sources.pp
  36. 0 1
      panda/src/dxgsg8/config_dxgsg8.cxx
  37. 0 33
      panda/src/dxgsg8/dxGeomNodeContext8.I
  38. 0 35
      panda/src/dxgsg8/dxGeomNodeContext8.cxx
  39. 0 89
      panda/src/dxgsg8/dxGeomNodeContext8.h
  40. 0 39
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx
  41. 0 7
      panda/src/dxgsg8/dxGraphicsStateGuardian8.h
  42. 0 1
      panda/src/dxgsg8/dxgsg8_composite1.cxx
  43. 1 2
      panda/src/dxgsg9/Sources.pp
  44. 0 1
      panda/src/dxgsg9/config_dxgsg9.cxx
  45. 0 33
      panda/src/dxgsg9/dxGeomNodeContext9.I
  46. 0 35
      panda/src/dxgsg9/dxGeomNodeContext9.cxx
  47. 0 89
      panda/src/dxgsg9/dxGeomNodeContext9.h
  48. 0 38
      panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx
  49. 0 7
      panda/src/dxgsg9/dxGraphicsStateGuardian9.h
  50. 0 1
      panda/src/dxgsg9/dxgsg9_composite1.cxx
  51. 4 4
      panda/src/glstuff/Sources.pp
  52. 9 7
      panda/src/glstuff/glGeomContext_src.I
  53. 4 3
      panda/src/glstuff/glGeomContext_src.cxx
  54. 18 24
      panda/src/glstuff/glGeomContext_src.h
  55. 0 31
      panda/src/glstuff/glGeomNodeContext_src.I
  56. 0 63
      panda/src/glstuff/glGeomNodeContext_src.h
  57. 160 121
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx
  58. 2 4
      panda/src/glstuff/glGraphicsStateGuardian_src.h
  59. 0 1
      panda/src/glstuff/glSavedFrameBuffer_src.h
  60. 1 1
      panda/src/glstuff/glmisc_src.cxx
  61. 1 1
      panda/src/glstuff/glstuff_src.cxx
  62. 1 1
      panda/src/glstuff/glstuff_src.h
  63. 10 5
      panda/src/gobj/Sources.pp
  64. 0 12
      panda/src/gobj/geom.N
  65. 118 71
      panda/src/gobj/geom.cxx
  66. 23 16
      panda/src/gobj/geom.h
  67. 91 0
      panda/src/gobj/geomContext.I
  68. 1 1
      panda/src/gobj/geomContext.cxx
  69. 22 16
      panda/src/gobj/geomContext.h
  70. 2 1
      panda/src/gobj/gobj_composite2.cxx
  71. 0 3
      panda/src/gobj/pixelBuffer.N
  72. 184 9
      panda/src/gobj/preparedGraphicsObjects.cxx
  73. 12 1
      panda/src/gobj/preparedGraphicsObjects.h
  74. 1 1
      panda/src/gobj/texture.cxx
  75. 4 4
      panda/src/gobj/textureContext.h
  76. 0 6
      panda/src/gsgbase/graphicsStateGuardianBase.h

+ 0 - 7
panda/src/crgsg/clean

@@ -1,7 +0,0 @@
-#!bash
-
-rm *.I
-rm *.cxx
-rm *.h
-rm pp.dep
-rm Makefile

+ 0 - 132
panda/src/crgsg/config_crgsg.cxx

@@ -1,132 +0,0 @@
-// Filename: config_crgsg.cxx
-// Created by:  drose (06Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "config_crgsg.h"
-#include "crGraphicsStateGuardian.h"
-#include "crSavedFrameBuffer.h"
-#include "crTextureContext.h"
-#include "crGeomNodeContext.h"
-
-#include "dconfig.h"
-
-Configure(config_crgsg);
-NotifyCategoryDef(crgsg, ":display:gsg");
-
-// Configure this variable true to cause the CRGSG to show each
-// transform space it renders by drawing a little unit axis.  This
-// cannot be enabled when the player is compiled in NDEBUG mode.
-bool cr_show_transforms = config_crgsg.GetBool("cr-show-transforms", false);
-
-// Configure this true to chromium.Hint the textures into the cheapest
-// possible mode.
-bool cr_cheap_textures = config_crgsg.GetBool("cr-cheap-textures", false);
-
-// Configure this true to perform a cull traversal over the geometry
-// by default, false otherwise.  The cull traversal provides support
-// for state-sorting, z-sorting, and binning.
-bool cr_cull_traversal = config_crgsg.GetBool("cr-cull-traversal", true);
-
-// Configure this true to disable the use of mipmapping in the
-// renderer.
-bool cr_ignore_mipmaps = config_crgsg.GetBool("cr-ignore-mipmaps", false);
-
-// Configure this true to enable full trilinear mipmapping on every
-// texture, whether it asks for it or not.
-bool cr_force_mipmaps = config_crgsg.GetBool("cr-force-mipmaps", false);
-
-// Configure this true to cause mipmaps to be rendered with phony
-// colors, using mipmap_level_*.rgb if they are available.
-bool cr_show_mipmaps = config_crgsg.GetBool("cr-show-mipmaps", false);
-
-// Configure this true to cause the generated mipmap images to be
-// written out to image files on the disk as they are generated.
-bool cr_save_mipmaps = config_crgsg.GetBool("cr-save-mipmaps", false);
-
-// Configure this true to cause all lighting normals to automatically
-// be normalized by the graphics hardware before rendering.  This is
-// necessary if you intend to render things under scale transforms and
-// expect lighting to work correctly.  Maybe one day there will be
-// another way to set this at runtime, instead of only as a configure
-// variable.
-bool cr_auto_normalize_lighting = config_crgsg.GetBool("auto-normalize-lighting", false);
-
-// Configure this true to try to implement decals using a
-// DepthOffsetAttrib, false to do them with the more reliable 3-pass
-// rendering method instead.
-bool cr_depth_offset_decals = config_crgsg.GetBool("depth-offset-decals", false);
-
-// Configure this true to indicate the current version of GL fully
-// supports textures with B, G, R ordering; false if it only supports
-// R, G, B.  false will always work, but true might be faster if the
-// implementation supports it.
-#ifdef GL_BGR
-bool cr_supports_bgr = config_crgsg.GetBool("cr-supports-bgr", false);
-#else
-// If it's not even defined, we can't use it.
-bool cr_supports_bgr = false;
-#endif  // GL_BGR
-
-CRDecalType cr_decal_type = GDT_offset;
-
-static CRDecalType
-parse_decal_type(const string &type) {
-  if (type == "mask") {
-    return GDT_mask;
-  } else if (type == "blend") {
-    return GDT_blend;
-  } else if (type == "offset") {
-    return GDT_offset;
-  }
-  crgsg_cat.error() << "Invalid cr-decal-type: " << type << "\n";
-  return GDT_offset;
-}
-
-ConfigureFn(config_crgsg) {
-  init_libcrgsg();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: init_libcrgsg
-//  Description: Initializes the library.  This must be called at
-//               least once before any of the functions or classes in
-//               this library can be used.  Normally it will be
-//               called by the static initializers and need not be
-//               called explicitly, but special cases exist.
-////////////////////////////////////////////////////////////////////
-void
-init_libcrgsg() {
-  static bool initialized = false;
-  if (initialized) {
-    return;
-  }
-  initialized = true;
-
-  string decal_type = config_crgsg.GetString("cr-decal-type", "");
-  if (!decal_type.empty()) {
-    cr_decal_type = parse_decal_type(decal_type);
-  }
-
-  CRGraphicsStateGuardian::init_type();
-  CRSavedFrameBuffer::init_type();
-  CRTextureContext::init_type();
-  CRGeomNodeContext::init_type();
-
-  GraphicsStateGuardian::get_factory().register_factory
-    (CRGraphicsStateGuardian::get_class_type(),
-     CRGraphicsStateGuardian::make_GlGraphicsStateGuardian);
-}

+ 0 - 49
panda/src/crgsg/config_crgsg.h

@@ -1,49 +0,0 @@
-// Filename: config_crgsg.h
-// Created by:  drose (06Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef CONFIG_GLGSG_H
-#define CONFIG_GLGSG_H
-
-#include "pandabase.h"
-#include "notifyCategoryProxy.h"
-
-NotifyCategoryDecl(crgsg, EXPCL_PANDACR, EXPTP_PANDACR);
-
-extern bool cr_show_transforms;
-extern bool cr_cheap_textures;
-extern bool cr_cull_traversal;
-extern bool cr_ignore_mipmaps;
-extern bool cr_force_mipmaps;
-extern bool cr_show_mipmaps;
-extern bool cr_save_mipmaps;
-extern bool cr_auto_normalize_lighting;
-extern bool cr_depth_offset_decals;
-extern bool cr_supports_bgr;
-
-// Ways to implement decals.
-enum CRDecalType {
-  GDT_mask,   // GL 1.0 style, involving three steps
-  GDT_blend,  // As above, but slower; a hack for broken nVidia driver
-  GDT_offset  // The fastest, using GL 1.1 style chromium.PolygonOffset
-};
-extern CRDecalType cr_decal_type;
-
-
-extern EXPCL_PANDACR void init_libcrgsg();
-
-#endif

+ 0 - 21
panda/src/crgsg/crGeomNodeContext.cxx

@@ -1,21 +0,0 @@
-// Filename: chromium.GeomNodeContext.cxx
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "crGeomNodeContext.h"
-
-TypeHandle CRGeomNodeContext::_type_handle;

+ 0 - 88
panda/src/crgsg/crGeomNodeContext.h

@@ -1,88 +0,0 @@
-// Filename: chromium.GeomNodeContext.h
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef CRGEOMNODECONTEXT_H
-#define CRGEOMNODECONTEXT_H
-
-#include "pandabase.h"
-
-#ifdef WIN32_VC
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-
-#include <GL/gl.h>
-// Chromium specific
-#ifdef WIN32_VC // [
-#define WINDOWS 1
-#endif //]
-#include "cr_glwrapper.h"
-#include "cr_applications.h"
-#include "cr_spu.h"
-extern SPUDispatchTable chromium;
-
-#include "geomNodeContext.h"
-#include "geomNode.h"
-#include "pvector.h"
-
-////////////////////////////////////////////////////////////////////
-//       Class : CRGeomNodeContext
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDACR CRGeomNodeContext : public GeomNodeContext {
-public:
-  INLINE CRGeomNodeContext(GeomNode *node);
-
-  // The GL display list index that draws the contents of this
-  // GeomNode.
-  GLuint _index;
-
-  // A list of the dynamic Geoms within the GeomNode; these aren't
-  // part of the above display list.
-  typedef pvector<PT(dDrawable) > Geoms;
-  Geoms _dynamic_geoms;
-
-  // The number of vertices represented by the display list.  This is
-  // strictly for the benefit of PStats reporting.
-  DO_PSTATS_STUFF(int _num_verts;)
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    GeomNodeContext::init_type();
-    register_type(_type_handle, "CRGeomNodeContext",
-                  GeomNodeContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "crGeomNodeContext.I"
-
-#endif
-

+ 0 - 1099
panda/src/crgsg/crGraphicsStateGuardian.I

@@ -1,1099 +0,0 @@
-// Filename: chromium.GraphicsStateGuardian.I
-// Created by:  drose (02Feb99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "config_crgsg.h"
-
-#include "graphicsWindow.h"
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::activate
-//       Access: Public
-//  Description: Sets this context to be the active context for future
-//               GL commands.
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-activate() {
-  // This operation seems to be incredibly expensive on some
-  // platforms--particularly for the NVidia drivers under Linux.  It
-  // doesn't seem to check if we already had the context current
-  // before we switch contexts.  For now, we'll limit our use of this
-  // function.
-
-  _win->make_current();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glClearColor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glClearColor(GLclampf red, GLclampf green, GLclampf blue,
-                  GLclampf alpha) {
-  if (red != _clear_color_red ||
-      green != _clear_color_green ||
-      blue != _clear_color_blue ||
-      alpha != _clear_color_alpha) {
-    chromium.ClearColor(red, green, blue, alpha);
-    _clear_color_red = red;
-    _clear_color_green = green;
-    _clear_color_blue = blue;
-    _clear_color_alpha = alpha;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glClearDepth
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glClearDepth(GLclampd depth) {
-  if (depth != _clear_depth) {
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug()
-      << "crClearDepth(" << (double)depth << ")" << endl;
-#endif
-    chromium.ClearDepth(depth);
-    _clear_depth = depth;
-  }
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glClearStencil
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glClearStencil(GLint s) {
-  if (s != _clear_stencil) {
-    chromium.ClearStencil(s);
-    _clear_stencil = s;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glClearAccum
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glClearAccum(GLclampf red, GLclampf green, GLclampf blue,
-                  GLclampf alpha) {
-  if (red != _clear_accum_red ||
-      green != _clear_accum_green ||
-      blue != _clear_accum_blue ||
-      alpha != _clear_accum_alpha) {
-    chromium.ClearAccum(red, green, blue, alpha);
-    _clear_accum_red = red;
-    _clear_accum_green = green;
-    _clear_accum_blue = blue;
-    _clear_accum_alpha = alpha;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glDrawBuffer
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glDrawBuffer(GLenum mode) {
-  if (mode != _draw_buffer_mode) {
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crDrawBuffer(";
-    switch (mode) {
-    case GL_FRONT:
-      crgsg_cat.debug(false) << "GL_FRONT)";
-      break;
-    case GL_BACK:
-      crgsg_cat.debug(false) << "GL_BACK)";
-      break;
-    case GL_RIGHT:
-      crgsg_cat.debug(false) << "GL_RIGHT)";
-      break;
-    case GL_LEFT:
-      crgsg_cat.debug(false) << "GL_LEFT)";
-      break;
-    case GL_FRONT_RIGHT:
-      crgsg_cat.debug(false) << "GL_FRONT_RIGHT)";
-      break;
-    case GL_FRONT_LEFT:
-      crgsg_cat.debug(false) << "GL_FRONT_LEFT)";
-      break;
-    case GL_BACK_RIGHT:
-      crgsg_cat.debug(false) << "GL_BACK_RIGHT)";
-      break;
-    case GL_BACK_LEFT:
-      crgsg_cat.debug(false) << "GL_BACK_LEFT)";
-      break;
-    case GL_FRONT_AND_BACK:
-      crgsg_cat.debug(false) << "GL_FRONT_AND_BACK)";
-      break;
-    }
-    crgsg_cat.debug(false) << endl;
-#endif
-    chromium.DrawBuffer(mode);
-    _draw_buffer_mode = mode;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glReadBuffer
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glReadBuffer(GLenum mode) {
-  if (mode != _read_buffer_mode) {
-    chromium.ReadBuffer(mode);
-    _read_buffer_mode = mode;
-  }
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glShadeModel
-//       Access:
-//  Description: Set the shading model to be either GL_FLAT or GL_SMOOTH
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glShadeModel(GLenum mode) {
-  if (_shade_model_mode != mode) {
-    chromium.ShadeModel(mode);
-    _shade_model_mode = mode;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glScissor
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    if ( _scissor_x != x || _scissor_y != y ||
-        _scissor_width != width || _scissor_height != height )
-    {
-        _scissor_x = x; _scissor_y = y;
-        _scissor_width = width; _scissor_height = height;
-        chromium.Scissor( x, y, width, height );
-    }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glViewport
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    if ( _viewport_x != x || _viewport_y != y ||
-        _viewport_width != width || _viewport_height != height )
-    {
-        _viewport_x = x; _viewport_y = y;
-        _viewport_width = width; _viewport_height = height;
-        chromium.Viewport( x, y, width, height );
-    }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glLightModelLocal
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glLightModelLocal(GLboolean local)
-{
-    if ( _lmodel_local != local )
-    {
-        _lmodel_local = local;
-        chromium.LightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, local );
-    }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glLightModelLocal
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glLightModelTwoSide(GLboolean twoside)
-{
-  if (_lmodel_twoside != twoside) {
-    _lmodel_twoside = twoside;
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug()
-      << "crLightModel(GL_LIGHT_MODEL_TWO_SIDE, " << (int)twoside << ")" << endl;
-#endif
-    chromium.LightModeli(GL_LIGHT_MODEL_TWO_SIDE, twoside);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glStencilFunc
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glStencilFunc(GLenum func,GLint ref,GLuint mask) {
-
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crStencilFunc(";
-    switch (func) {
-    case GL_NEVER:
-      crgsg_cat.debug(false) << "GL_NEVER, ";
-      break;
-    case GL_LESS:
-      crgsg_cat.debug(false) << "GL_LESS, ";
-      break;
-    case GL_EQUAL:
-      crgsg_cat.debug(false) << "GL_EQUAL, ";
-      break;
-    case GL_LEQUAL:
-      crgsg_cat.debug(false) << "GL_LEQUAL, ";
-      break;
-    case GL_GREATER:
-      crgsg_cat.debug(false) << "GL_GREATER, ";
-      break;
-    case GL_NOTEQUAL:
-      crgsg_cat.debug(false) << "GL_NOTEQUAL, ";
-      break;
-    case GL_GEQUAL:
-      crgsg_cat.debug(false) << "GL_GEQUAL, ";
-      break;
-    case GL_ALWAYS:
-      crgsg_cat.debug(false) << "GL_ALWAYS, ";
-      break;
-    default:
-      crgsg_cat.debug(false) << "unknown, ";
-      break;
-    }
-    crgsg_cat.debug(false) << ref << mask << ")\n";
-#endif
-    chromium.StencilFunc(func, ref, mask);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glStencilOp
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glStencilOp(GLenum fail,GLenum zfail,GLenum zpass) {
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crStencilOp(fail, zfail, ";
-    switch (zpass) {
-    case GL_KEEP:
-      crgsg_cat.debug(false) << "GL_KEEP)";
-      break;
-    case GL_ZERO:
-      crgsg_cat.debug(false) << "GL_ZERO)";
-      break;
-    case GL_REPLACE:
-      crgsg_cat.debug(false) << "GL_REPLACE)";
-      break;
-    case GL_INCR:
-      crgsg_cat.debug(false) << "GL_INCR)";
-      break;
-    case GL_DECR:
-      crgsg_cat.debug(false) << "GL_DECR)";
-      break;
-    case GL_INVERT:
-      crgsg_cat.debug(false) << "GL_INVERT)";
-      break;
-    default:
-      crgsg_cat.debug(false) << "unknown)";
-      break;
-    }
-    crgsg_cat.debug(false) << endl;
-#endif
-    chromium.StencilOp(fail,zfail,zpass);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glLineWidth
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glLineWidth(GLfloat width) {
-  if (_line_width != width) {
-    _line_width = width;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crLineWidth(" << width << ")" << endl;
-#endif
-    chromium.LineWidth(width);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glPointSize
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glPointSize(GLfloat size) {
-  if (_point_size != size) {
-    _point_size = size;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crPointSize(" << size << ")" << endl;
-#endif
-    chromium.PointSize(size);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glBlendFunc
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glBlendFunc(GLenum sfunc, GLenum dfunc) {
-  if (_blend_source_func != sfunc || _blend_dest_func != dfunc) {
-    _blend_source_func = sfunc;
-    _blend_dest_func = dfunc;
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crBlendFunc(";
-    switch (sfunc) {
-    case GL_ZERO:
-      crgsg_cat.debug(false) << "GL_ZERO, ";
-      break;
-    case GL_ONE:
-      crgsg_cat.debug(false) << "GL_ONE, ";
-      break;
-    case GL_DST_COLOR:
-      crgsg_cat.debug(false) << "GL_DST_COLOR, ";
-      break;
-    case GL_ONE_MINUS_DST_COLOR:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_DST_COLOR, ";
-      break;
-    case GL_SRC_ALPHA:
-      crgsg_cat.debug(false) << "GL_SRC_ALPHA, ";
-      break;
-    case GL_ONE_MINUS_SRC_ALPHA:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_SRC_ALPHA, ";
-      break;
-    case GL_DST_ALPHA:
-      crgsg_cat.debug(false) << "GL_DST_ALPHA, ";
-      break;
-    case GL_ONE_MINUS_DST_ALPHA:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_DST_ALPHA, ";
-      break;
-    case GL_SRC_ALPHA_SATURATE:
-
-      crgsg_cat.debug(false) << "GL_SRC_ALPHA_SATURATE, ";
-      break;
-    default:
-      crgsg_cat.debug(false) << "unknown, ";
-      break;
-    }
-    switch (dfunc) {
-    case GL_ZERO:
-      crgsg_cat.debug(false) << "GL_ZERO)";
-      break;
-    case GL_ONE:
-      crgsg_cat.debug(false) << "GL_ONE)";
-      break;
-    case GL_SRC_COLOR:
-      crgsg_cat.debug(false) << "GL_SRC_COLOR)";
-      break;
-    case GL_ONE_MINUS_SRC_COLOR:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_SRC_COLOR)";
-      break;
-    case GL_SRC_ALPHA:
-      crgsg_cat.debug(false) << "GL_SRC_ALPHA)";
-      break;
-    case GL_ONE_MINUS_SRC_ALPHA:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_SRC_ALPHA)";
-      break;
-    case GL_DST_ALPHA:
-      crgsg_cat.debug(false) << "GL_DST_ALPHA)";
-      break;
-    case GL_ONE_MINUS_DST_ALPHA:
-      crgsg_cat.debug(false) << "GL_ONE_MINUS_DST_ALPHA)";
-      break;
-    default:
-      crgsg_cat.debug(false) << "unknown)";
-      break;
-    }
-    crgsg_cat.debug(false) << endl;
-#endif
-    chromium.BlendFunc(sfunc, dfunc);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glFogMode
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glFogMode(GLint mode) {
-  if (_fog_mode != mode) {
-    _fog_mode = mode;
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crFog(GL_FOG_MODE, ";
-    switch(mode) {
-    case GL_LINEAR:
-      crgsg_cat.debug(false) << "GL_LINEAR)" << endl;
-      break;
-    case GL_EXP:
-      crgsg_cat.debug(false) << "GL_EXP)" << endl;
-      break;
-    case GL_EXP2:
-      crgsg_cat.debug(false) << "GL_EXP2)" << endl;
-      break;
-#ifdef GL_FOG_FUNC_SGIS
-    case GL_FOG_FUNC_SGIS:
-      crgsg_cat.debug(false) << "GL_FOG_FUNC_SGIS)" << endl;
-      break;
-#endif
-    default:
-      crgsg_cat.debug(false) << "unknown)" << endl;
-      break;
-    }
-#endif
-    chromium.Fogi(GL_FOG_MODE, mode);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glFogStart
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glFogStart(GLfloat start) {
-  if (_fog_start != start) {
-    _fog_start = start;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crFog(GL_FOG_START, " << start << ")" << endl;
-#endif
-    chromium.Fogf(GL_FOG_START, start);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glFogEnd
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glFogEnd(GLfloat end) {
-  if (_fog_end != end) {
-    _fog_end = end;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crFog(GL_FOG_END, " << end << ")" << endl;
-#endif
-    chromium.Fogf(GL_FOG_END, end);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glFogDensity
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glFogDensity(GLfloat density) {
-  if (_fog_density != density) {
-    _fog_density = density;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crFog(GL_FOG_DENSITY, " << density << ")" << endl;
-#endif
-    chromium.Fogf(GL_FOG_DENSITY, density);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glFogColor
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glFogColor(const Colorf &color) {
-  if (_fog_color != color) {
-    _fog_color = color;
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crFog(GL_FOG_COLOR, " << color << ")" << endl;
-#endif
-    chromium.Fogfv(GL_FOG_COLOR, color.get_data());
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glAlphaFunc
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glAlphaFunc(GLenum func, GLclampf ref) {
-  if (_alpha_func != func || _alpha_func_ref != ref) {
-    _alpha_func = func;
-    _alpha_func_ref = ref;
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crAlphaFunc(";
-    switch (func) {
-    case GL_NEVER:
-      crgsg_cat.debug(false) << "GL_NEVER, ";
-      break;
-    case GL_LESS:
-      crgsg_cat.debug(false) << "GL_LESS, ";
-      break;
-    case GL_EQUAL:
-      crgsg_cat.debug(false) << "GL_EQUAL, ";
-      break;
-    case GL_LEQUAL:
-      crgsg_cat.debug(false) << "GL_LEQUAL, ";
-      break;
-    case GL_GREATER:
-      crgsg_cat.debug(false) << "GL_GREATER, ";
-      break;
-    case GL_NOTEQUAL:
-      crgsg_cat.debug(false) << "GL_NOTEQUAL, ";
-      break;
-    case GL_GEQUAL:
-      crgsg_cat.debug(false) << "GL_GEQUAL, ";
-      break;
-    case GL_ALWAYS:
-      crgsg_cat.debug(false) << "GL_ALWAYS, ";
-      break;
-    }
-    crgsg_cat.debug() << ref << ")" << endl;
-#endif
-    chromium.AlphaFunc(func, ref);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::call_glPolygonMode
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-call_glPolygonMode(GLenum mode) {
-  if (_polygon_mode != mode) {
-    _polygon_mode = mode;
-#ifdef GSG_VERBOSE
-    crgsg_cat.debug() << "crPolygonMode(GL_BACK_AND_FRONT, ";
-    switch (mode) {
-    case GL_POINT:
-      crgsg_cat.debug(false) << "GL_POINT)" << endl;
-      break;
-    case GL_LINE:
-      crgsg_cat.debug(false) << "GL_LINE)" << endl;
-      break;
-    case GL_FILL:
-      crgsg_cat.debug(false) << "GL_FILL)" << endl;
-      break;
-    }
-#endif
-    chromium.PolygonMode(GL_FRONT_AND_BACK, mode);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_pack_alignment
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-set_pack_alignment(GLint alignment) {
-  if (_pack_alignment != alignment) {
-    chromium.PixelStorei(GL_PACK_ALIGNMENT, alignment);
-    _pack_alignment = alignment;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_unpack_alignment
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-set_unpack_alignment(GLint alignment) {
-  if (_unpack_alignment != alignment) {
-    chromium.PixelStorei(GL_UNPACK_ALIGNMENT, alignment);
-    _unpack_alignment = alignment;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_multisample
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_multisample(bool val) {
-  if (_multisample_enabled != val) {
-    _multisample_enabled = val;
-    if (val) {
-#ifdef GL_MULTISAMPLE_SGIS
-      chromium.Enable(GL_MULTISAMPLE_SGIS);
-#endif
-      chromium.Hint(GL_POINT_SMOOTH_HINT, GL_NICEST);
-    } else {
-#ifdef GL_MULTISAMPLE_SGIS
-      chromium.Disable(GL_MULTISAMPLE_SGIS);
-#endif
-      chromium.Hint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_line_smooth
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_line_smooth(bool val) {
-  if (_line_smooth_enabled != val) {
-    _line_smooth_enabled = val;
-    if (val) {
-      chromium.Enable(GL_LINE_SMOOTH);
-      chromium.Hint(GL_LINE_SMOOTH_HINT, GL_FASTEST);
-    } else {
-      chromium.Disable(GL_LINE_SMOOTH);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_point_smooth
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_point_smooth(bool val) {
-  if (_point_smooth_enabled != val) {
-    _point_smooth_enabled = val;
-    if (val) {
-      chromium.Enable(GL_POINT_SMOOTH);
-      chromium.Hint(GL_POINT_SMOOTH_HINT, GL_NICEST);
-    } else {
-      chromium.Disable(GL_POINT_SMOOTH);
-      chromium.Hint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_dither
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_dither(bool val) {
-  if (_dither_enabled != val) {
-    _dither_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_DITHER)" << endl;
-#endif
-      chromium.Enable(GL_DITHER);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_DITHER)" << endl;
-#endif
-      chromium.Disable(GL_DITHER);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_stencil_test
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_stencil_test(bool val) {
-  if (_stencil_test_enabled != val) {
-    _stencil_test_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_STENCIL_TEST)" << endl;
-#endif
-      chromium.Enable(GL_STENCIL_TEST);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_STENCIL_TEST)" << endl;
-#endif
-      chromium.Disable(GL_STENCIL_TEST);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_texturing
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_texturing(bool val) {
-  if (_texturing_enabled != val) {
-    _texturing_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_TEXTURE_2D)" << endl;
-#endif
-      chromium.Enable(GL_TEXTURE_2D);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_TEXTURE_2D)" << endl;
-#endif
-      chromium.Disable(GL_TEXTURE_2D);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_scissor
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_scissor(bool val)
-{
-    if ( _scissor_enabled != val ) {
-        _scissor_enabled = val;
-        if ( val )
-            chromium.Enable( GL_SCISSOR_TEST );
-        else
-            chromium.Disable( GL_SCISSOR_TEST );
-    }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_clip_plane
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_clip_plane(int clip_plane, bool val) {
-  if (_clip_plane_enabled[clip_plane] != val) {
-    _clip_plane_enabled[clip_plane] = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_CLIP_PLANE_" << clip_plane << ")" << endl;
-#endif
-      chromium.Enable(get_clip_plane_id(clip_plane));
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_CLIP_PLANE_" << clip_plane << ")" << endl;
-#endif
-      chromium.Disable(get_clip_plane_id(clip_plane));
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_multisample_alpha_one
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_multisample_alpha_one(bool val) {
-  if (_multisample_alpha_one_enabled != val) {
-    _multisample_alpha_one_enabled = val;
-#ifdef GL_SAMPLE_ALPHA_TO_ONE_SGIS
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_SAMPLE_ALPHA_TO_ONE_SGIS)" << endl;
-#endif
-      chromium.Enable(GL_SAMPLE_ALPHA_TO_ONE_SGIS);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_SAMPLE_ALPHA_TO_ONE_SGIS)" << endl;
-#endif
-      chromium.Disable(GL_SAMPLE_ALPHA_TO_ONE_SGIS);
-    }
-#endif  // GL_SAMPLE_ALPHA_TO_ONE_SGIS
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_multisample_alpha_mask
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_multisample_alpha_mask(bool val) {
-  if (_multisample_alpha_mask_enabled != val) {
-    _multisample_alpha_mask_enabled = val;
-#ifdef GL_SAMPLE_ALPHA_TO_MASK_SGIS
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_SAMPLE_ALPHA_TO_MASK_SGIS)" << endl;
-#endif
-      chromium.Enable(GL_SAMPLE_ALPHA_TO_MASK_SGIS);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_SAMPLE_ALPHA_TO_MASK_SGIS)" << endl;
-#endif
-      chromium.Disable(GL_SAMPLE_ALPHA_TO_MASK_SGIS);
-    }
-#endif  // GL_SAMPLE_ALPHA_TO_MASK_SGIS
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_blend
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_blend(bool val) {
-  if (_blend_enabled != val) {
-    _blend_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_BLEND)" << endl;
-#endif
-      chromium.Enable(GL_BLEND);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_BLEND)" << endl;
-#endif
-      chromium.Disable(GL_BLEND);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_depth_test
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_depth_test(bool val) {
-  if (_depth_test_enabled != val) {
-    _depth_test_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_DEPTH_TEST)" << endl;
-#endif
-      chromium.Enable(GL_DEPTH_TEST);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_DEPTH_TEST)" << endl;
-#endif
-      chromium.Disable(GL_DEPTH_TEST);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_fog
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_fog(bool val) {
-  if (_fog_enabled != val) {
-    _fog_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_FOG)" << endl;
-#endif
-      chromium.Enable(GL_FOG);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_FOG)" << endl;
-#endif
-      chromium.Disable(GL_FOG);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_alpha_test
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_alpha_test(bool val) {
-  if (_alpha_test_enabled != val) {
-    _alpha_test_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_ALPHA_TEST)" << endl;
-#endif
-      chromium.Enable(GL_ALPHA_TEST);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_ALPHA_TEST)" << endl;
-#endif
-      chromium.Disable(GL_ALPHA_TEST);
-    }
-  }
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_polygon_offset
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-enable_polygon_offset(bool val) {
-  if (_polygon_offset_enabled != val) {
-    _polygon_offset_enabled = val;
-    if (val) {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crEnable(GL_POLYGON_OFFSET_*)" << endl;
-#endif
-      chromium.Enable(GL_POLYGON_OFFSET_FILL);
-    } else {
-#ifdef GSG_VERBOSE
-      crgsg_cat.debug()
-        << "crDisable(GL_POLYGON_OFFSET_*)" << endl;
-#endif
-      chromium.Disable(GL_POLYGON_OFFSET_FILL);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_current_color_mat
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE const LMatrix4f &CRGraphicsStateGuardian::
-get_current_color_mat() const {
-  return _current_color_mat;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_current_alpha_offset
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE const float &CRGraphicsStateGuardian::
-get_current_alpha_offset() const {
-  return _current_alpha_offset;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_current_alpha_scale
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE const float &CRGraphicsStateGuardian::
-get_current_alpha_scale() const {
-  return _current_alpha_scale;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_light_id
-//       Access: Public
-//  Description: Convert index to gl light id
-////////////////////////////////////////////////////////////////////
-INLINE GLenum CRGraphicsStateGuardian::get_light_id(int index) const
-{
-  return GL_LIGHT0 + index;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_clip_plane_id
-//       Access: Public
-//  Description: Convert index to gl clip plane id
-////////////////////////////////////////////////////////////////////
-INLINE GLenum CRGraphicsStateGuardian::
-get_clip_plane_id(int index) const {
-  switch(index) {
-    case 0: return GL_CLIP_PLANE0;
-    case 1: return GL_CLIP_PLANE1;
-    case 2: return GL_CLIP_PLANE2;
-    case 3: return GL_CLIP_PLANE3;
-    case 4: return GL_CLIP_PLANE4;
-    case 5: return GL_CLIP_PLANE5;
-    default:
-      crgsg_cat.error()
-        << "get_clip_plane_id() - we don't currently support ids "
-        << "> 5" << endl;
-      break;
-  }
-  return GL_CLIP_PLANE0;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_scene_graph_color
-//       Access: Public
-//  Description: Checks whether the scene graph color needs to be
-//               issued, and sends the appropriate chromium.Color command if
-//               it does.
-////////////////////////////////////////////////////////////////////
-INLINE void CRGraphicsStateGuardian::
-issue_scene_graph_color() {
-  if (_scene_graph_color_stale) {
-    issue_transformed_color(_scene_graph_color);
-    _scene_graph_color_stale = false;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::report_errors
-//       Access: Public
-//  Description: Checks for any outstanding error codes and outputs
-//               them, if found.  If NDEBUG is defined, this function
-//               does nothing.
-////////////////////////////////////////////////////////////////////
-INLINE void 
-report_errors() {
-    // pulling this out of gsg since I'd like to call it when there's no gsg ptr around
-#ifndef NDEBUG
-  extern void report_errors_loop(GLenum error_code);
-
-  GLenum error_code = chromium.GetError();
-  if (error_code != GL_NO_ERROR) {
-    report_errors_loop(error_code);
-  }
-#endif
-}

+ 0 - 4849
panda/src/crgsg/crGraphicsStateGuardian.cxx

@@ -1,4849 +0,0 @@
-// Filename: chromium.GraphicsStateGuardian.cxx
-// Created by:  drose (02Feb99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "crGraphicsStateGuardian.h"
-#include "crSavedFrameBuffer.h"
-#include "crTextureContext.h"
-#include "crGeomNodeContext.h"
-#include "config_crgsg.h"
-
-#include "config_util.h"
-#include "directRenderTraverser.h"
-#include "cullTraverser.h"
-#include "displayRegion.h"
-#include "lensNode.h"
-#include "camera.h"
-#include "renderBuffer.h"
-#include "geom.h"
-#include "geomIssuer.h"
-#include "graphicsWindow.h"
-#include "graphicsChannel.h"
-#include "lens.h"
-#include "get_rel_pos.h"
-#include "perspectiveLens.h"
-#include "directionalLight.h"
-#include "pointLight.h"
-#include "spotlight.h"
-#include <GL/glu.h>
-#include "lensNode.h"
-#include "textureAttrib.h"
-#include "lightAttrib.h"
-#include "cullFaceAttrib.h"
-#include "transparencyAttrib.h"
-#include "depthTestAttrib.h"
-#include "depthWriteAttrib.h"
-#include "colorWriteAttrib.h"
-#include "texMatrixAttrib.h"
-#include "materialAttrib.h"
-#include "renderModeAttrib.h"
-#include "fogAttrib.h"
-#include "depthOffsetAttrib.h"
-#include "fog.h"
-#include "clockObject.h"
-#include "string_utils.h"
-#include "nodePath.h"
-#include "dcast.h"
-#include "pvector.h"
-
-#ifdef DO_PSTATS
-#include "pStatTimer.h"
-#endif
-
-#include <algorithm>
-
-#if 0
-#define chromium.GenTextures chromium.GenTexturesEXT
-#define chromium.PrioritizeTextures chromium.PrioritizeTexturesEXT
-#define chromium.BindTexture chromium.BindTextureEXT
-#define chromium.CopyTexImage2D chromium.CopyTexImage2DEXT
-#define chromium.DeleteTextures chromium.DeleteTexturesEXT
-#endif
-
-#if !defined(GL_BGR) && defined(GL_BGR_EXT)
-// These symbols are sometimes defined as _EXT variants.
-#define GL_BGR GL_BGR_EXT
-#define GL_BGRA GL_BGRA_EXT
-#endif
-
-TypeHandle CRGraphicsStateGuardian::_type_handle;
-SPUDispatchTable chromium;
-
-#if !defined(CPPPARSER) && defined(DO_PSTATS)
-PStatCollector CRGraphicsStateGuardian::_vertices_display_list_pcollector("Vertices:Display lists");
-#endif
-
-static void
-issue_vertex_gl(const Geom *geom, Geom::VertexIterator &viterator, 
-                GraphicsStateGuardianBase *) {
-  const Vertexf &vertex = geom->get_next_vertex(viterator);
-  // crgsg_cat.debug() << "Issuing vertex " << vertex << "\n";
-  chromium.Vertex3fv(vertex.get_data());
-}
-
-static void
-issue_normal_gl(const Geom *geom, Geom::NormalIterator &niterator, 
-                GraphicsStateGuardianBase *) {
-  const Normalf &normal = geom->get_next_normal(niterator);
-  // crgsg_cat.debug() << "Issuing normal " << normal << "\n";
-  chromium.Normal3fv(normal.get_data());
-}
-
-static void
-issue_texcoord_gl(const Geom *geom, Geom::TexCoordIterator &tciterator, 
-                GraphicsStateGuardianBase *) {
-  const TexCoordf &texcoord = geom->get_next_texcoord(tciterator);
-  //  crgsg_cat.debug() << "Issuing texcoord " << texcoord << "\n";
-  chromium.TexCoord2fv(texcoord.get_data());
-}
-
-static void
-issue_color_gl(const Geom *geom, Geom::ColorIterator &citerator,
-               GraphicsStateGuardianBase *) {
-  const Colorf &color = geom->get_next_color(citerator);
-  //  crgsg_cat.debug() << "Issuing color " << color << "\n";
-  chromium.Color4fv(color.get_data());
-}
-
-static void
-issue_transformed_color_gl(const Geom *geom, Geom::ColorIterator &citerator,
-                           GraphicsStateGuardianBase *gsg) {
-  const CRGraphicsStateGuardian *crgsg = DCAST(CRGraphicsStateGuardian, gsg);
-  const Colorf &color = geom->get_next_color(citerator);
-  crgsg->issue_transformed_color(color);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-CRGraphicsStateGuardian::
-CRGraphicsStateGuardian(GraphicsWindow *win) : GraphicsStateGuardian(win) {
-  _clip_plane_enabled = (bool *)NULL;
-  _cur_clip_plane_enabled = (bool *)NULL;
-
-  // Create a default RenderTraverser.
-  if (cr_cull_traversal) {
-    _render_traverser =
-      new CullTraverser(this, RenderRelation::get_class_type());
-  } else {
-    _render_traverser =
-      new DirectRenderTraverser(this, RenderRelation::get_class_type());
-  }
-
-  reset();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::Destructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-CRGraphicsStateGuardian::
-~CRGraphicsStateGuardian() {
-  free_pointers();
-  release_all_textures();
-  release_all_geoms();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::reset
-//       Access: Public, Virtual
-//  Description: Resets all internal state as if the gsg were newly
-//               created.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-reset() {
-  free_pointers();
-  activate();
-  GraphicsStateGuardian::reset();
-
-  _buffer_mask = 0;
-
-  // All GL implementations have the following buffers. (?)
-  _buffer_mask = (RenderBuffer::T_color |
-                  RenderBuffer::T_depth |
-                  RenderBuffer::T_stencil |
-                  RenderBuffer::T_accum);
-
-  // Check to see if we have double-buffering.
-  GLboolean has_back;
-  chromium.GetBooleanv(GL_DOUBLEBUFFER, &has_back);
-  if (!has_back) {
-    _buffer_mask &= ~RenderBuffer::T_back;
-  }
-
-#if 0
-  //Note 8/01: This is incorrect for mono displays, if stereo is not in use, we need
-  //           to use the GL_BACK constants and not the GL_BACK_LEFT ones, which
-  //           under the RenderBuffer flag schemes require both left and right flags set.
-
-  // Check to see if we have stereo (and therefore a right buffer).
-  GLboolean has_stereo;
-  chromium.GetBooleanv(GL_STEREO, &has_stereo);
-  if (!has_stereo) {
-    _buffer_mask &= ~RenderBuffer::T_right;
-  }
-#endif
-
-  // Set up our clear values to invalid values, so the chromium.Clear* calls
-  // will be made initially.
-  _clear_color_red = -1.0f;
-  _clear_color_green = -1.0f;
-  _clear_color_blue = -1.0f;
-  _clear_color_alpha = -1.0f;
-  _clear_depth = -1.0f;
-  _clear_stencil = -1;
-  _clear_accum_red = -1.0f;
-  _clear_accum_green = -1.0f;
-  _clear_accum_blue = -1.0f;
-  _clear_accum_alpha = -1.0f;
-
-  // Set up the specific state values to GL's known initial values.
-  _draw_buffer_mode = (has_back) ? GL_BACK : GL_FRONT;
-  _read_buffer_mode = (has_back) ? GL_BACK : GL_FRONT;
-  _shade_model_mode = GL_SMOOTH;
-  chromium.FrontFace(GL_CCW);
-
-  _line_width = 1.0f;
-  _point_size = 1.0f;
-  _depth_mask = false;
-  _fog_mode = GL_EXP;
-  _alpha_func = GL_ALWAYS;
-  _alpha_func_ref = 0;
-  _polygon_mode = GL_FILL;
-
-  _pack_alignment = 4;
-  _unpack_alignment = 4;
-
-  // Set up all the enabled/disabled flags to GL's known initial
-  // values: everything off.
-  _multisample_enabled = false;
-  _line_smooth_enabled = false;
-  _point_smooth_enabled = false;
-  _scissor_enabled = false;
-  _normals_enabled = false;
-  _texturing_enabled = false;
-  _multisample_alpha_one_enabled = false;
-  _multisample_alpha_mask_enabled = false;
-  _blend_enabled = false;
-  _depth_test_enabled = false;
-  _fog_enabled = false;
-  _alpha_test_enabled = false;
-  _polygon_offset_enabled = false;
-  _decal_level = 0;
-
-  // Dither is on by default in GL, let's turn it off
-  _dither_enabled = true;
-  enable_dither(false);
-
-  // Stencil test is off by default
-  _stencil_test_enabled = false;
-  _stencil_func = GL_NOTEQUAL;
-  _stencil_op = GL_REPLACE;
-
-  // Antialiasing.
-  enable_line_smooth(false);
-  enable_multisample(true);
-
-  // Should we normalize lighting normals?
-  if (cr_auto_normalize_lighting) {
-    chromium.Enable(GL_NORMALIZE);
-  }
-
-  // Set up the light id map
-  GLint max_lights;
-  chromium.GetIntegerv(GL_MAX_LIGHTS, &max_lights);
-  init_lights(max_lights);
-
-  // Set up the clip plane id map
-  GLint max_clip_planes;
-  chromium.GetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
-  _max_clip_planes = max_clip_planes;
-  _available_clip_plane_ids = PTA(PlaneNode*)::empty_array(_max_clip_planes);
-  _clip_plane_enabled = new bool[_max_clip_planes];
-  _cur_clip_plane_enabled = new bool[_max_clip_planes];
-  int i;
-  for (i = 0; i < _max_clip_planes; i++) {
-    _available_clip_plane_ids[i] = NULL;
-    _clip_plane_enabled[i] = false;
-  }
-
-  _current_projection_mat = LMatrix4f::ident_mat();
-  _projection_mat_stack_count = 0;
-
-  // Make sure the GL state matches all of our initial attribute
-  // states.
-  CPT(RenderAttrib) dta = DepthTestAttrib::make();
-  CPT(RenderAttrib) dwa = DepthWriteAttrib::make();
-  CPT(RenderAttrib) cfa = CullFaceAttrib::make();
-  CPT(renderAttrib) ta = TextureAttrib::make_off();
-
-  dta->issue(this);
-  dwa->issue(this);
-  cfa->issue(this);
-  ta->issue(this);
-
-  Material empty;
-  apply_material(&empty);
-
-  if (cr_cheap_textures) {
-    crgsg_cat.info()
-      << "Setting chromium.Hint() for fastest textures.\n";
-    chromium.Hint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
-  }
-
-  // use per-vertex fog if per-pixel fog requires SW renderer
-  chromium.Hint(GL_FOG_HINT,GL_DONT_CARE);
-
-  _dithering_enabled = false;
-
-  GLint iRedBits;
-  chromium.GetIntegerv(GL_RED_BITS,&iRedBits);
-  if(iRedBits<24) {
-    chromium.Enable(GL_DITHER);
-    _dithering_enabled = true;
-    if(crgsg_cat.is_debug())
-        crgsg_cat.debug() << "frame buffer depth < 8bits channel, enabling dithering\n";
-  }
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::clear
-//       Access: Public, Virtual
-//  Description: Clears all of the indicated buffers to their assigned
-//               colors.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-clear(const RenderBuffer &buffer) {
-  DO_PSTATS_STUFF(PStatTimer timer(_win->_clear_pcollector);)
-  //  activate();
-
-  nassertv(buffer._gsg == this);
-  int buffer_type = buffer._buffer_type;
-  GLbitfield mask = 0;
-  CPT(RenderState) state = RenderState::make_identity();
-
-  if (buffer_type & RenderBuffer::T_color) {
-    call_glClearColor(_color_clear_value[0],
-                      _color_clear_value[1],
-                      _color_clear_value[2],
-                      _color_clear_value[3]);
-    state = state->set_attrib(ColorWriteAttrib::make(ColorWriteAttrib::M_on));
-    mask |= GL_COLOR_BUFFER_BIT;
-
-    set_draw_buffer(buffer);
-  }
-
-  if (buffer_type & RenderBuffer::T_depth) {
-    call_glClearDepth(_depth_clear_value);
-    mask |= GL_DEPTH_BUFFER_BIT;
-
-    // In order to clear the depth buffer, the depth mask must enable
-    // writing to the depth buffer.
-    if (!_depth_mask) {
-      state = state->set_attrib(DepthWriteAttrib::make(DepthWriteAttrib::M_on));
-    }
-  }
-
-  if (buffer_type & RenderBuffer::T_stencil) {
-    call_glClearStencil(_stencil_clear_value != false);
-    mask |= GL_STENCIL_BUFFER_BIT;
-  }
-
-  if (buffer_type & RenderBuffer::T_accum) {
-    call_glClearAccum(_accum_clear_value[0],
-                      _accum_clear_value[1],
-                      _accum_clear_value[2],
-                      _accum_clear_value[3]);
-    mask |= GL_ACCUM_BUFFER_BIT;
-  }
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "crClear(";
-  if (mask & GL_COLOR_BUFFER_BIT) {
-    crgsg_cat.debug(false) << "GL_COLOR_BUFFER_BIT|";
-  }
-  if (mask & GL_DEPTH_BUFFER_BIT) {
-    crgsg_cat.debug(false) << "GL_DEPTH_BUFFER_BIT|";
-  }
-  if (mask & GL_STENCIL_BUFFER_BIT) {
-    crgsg_cat.debug(false) << "GL_STENCIL_BUFFER_BIT|";
-  }
-  if (mask & GL_ACCUM_BUFFER_BIT) {
-    crgsg_cat.debug(false) << "GL_ACCUM_BUFFER_BIT|";
-  }
-  crgsg_cat.debug(false) << ")" << endl;
-#endif
-
-  modify_state(state);
-  chromium.Clear(mask);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::clear
-//       Access: Public, Virtual
-//  Description: Clears all of the indicated buffers to their assigned
-//               colors.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-clear(const RenderBuffer &buffer, const DisplayRegion *region) {
-  DisplayRegionStack old_dr = push_display_region(region);
-  prepare_display_region();
-  clear(buffer);
-  pop_display_region(old_dr);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::prepare_display_region
-//       Access: Public, Virtual
-//  Description: Prepare a display region for rendering (set up
-//       scissor region and viewport)
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-prepare_display_region() {
-  if (_current_display_region == (DisplayRegion*)0L) {
-    crgsg_cat.error()
-      << "Invalid NULL display region in prepare_display_region()\n";
-    enable_scissor(false);
-
-  } else if (_current_display_region != _actual_display_region) {
-    _actual_display_region = _current_display_region;
-
-    int l, b, w, h;
-    _actual_display_region->get_region_pixels(l, b, w, h);
-    GLint x = GLint(l);
-    GLint y = GLint(b);
-    GLsizei width = GLsizei(w);
-    GLsizei height = GLsizei(h);
-
-    enable_scissor( true );
-    call_glScissor( x, y, width, height );
-    call_glViewport( x, y, width, height );
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::prepare_lens
-//       Access: Public, Virtual
-//  Description: Makes the current lens (whichever lens was most
-//               recently specified with push_lens()) active, so that
-//               it will transform future rendered geometry.  Normally
-//               this is only called from the draw process, and
-//               usually it is called immediately after a call to
-//               push_lens().
-//
-//               The return value is true if the lens is acceptable,
-//               false if it is not.
-////////////////////////////////////////////////////////////////////
-bool CRGraphicsStateGuardian::
-prepare_lens() {
-  if (_current_lens == (Lens *)NULL) {
-    return false;
-  }
-
-  if (!_current_lens->is_linear()) {
-    return false;
-  }
-
-  const LMatrix4f &projection_mat = _current_lens->get_projection_mat();
-
-  // The projection matrix must always be right-handed Y-up, even if
-  // our coordinate system of choice is otherwise, because certain GL
-  // calls (specifically chromium.TexGen(GL_SPHERE_MAP)) assume this kind of
-  // a coordinate system.  Sigh.  In order to implement a Z-up (or
-  // other arbitrary) coordinate system, we'll use a Y-up projection
-  // matrix, and store the conversion to our coordinate system of
-  // choice in the modelview matrix.
-  LMatrix4f new_projection_mat =
-    LMatrix4f::convert_mat(CS_yup_right, _current_lens->get_coordinate_system()) *
-    projection_mat;
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crMatrixMode(GL_PROJECTION): " << new_projection_mat << endl;
-#endif
-  chromium.MatrixMode(GL_PROJECTION);
-  chromium.LoadMatrixf(new_projection_mat.get_data());
-
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_point
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_point(GeomPoint *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_point()" << endl;
-#endif
-#ifdef DO_PSTATS
-  PStatTimer timer(_draw_primitive_pcollector);
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  call_glPointSize(geom->get_size());
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  chromium.Begin(GL_POINTS);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    // Draw per vertex, same thing.
-    issuer.issue_color(G_PER_VERTEX, ci);
-    issuer.issue_normal(G_PER_VERTEX, ni);
-    issuer.issue_texcoord(G_PER_VERTEX, ti);
-    issuer.issue_vertex(G_PER_VERTEX, vi);
-  }
-
-  chromium.End();
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_line
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_line(GeomLine *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_line()" << endl;
-#endif
-#ifdef DO_PSTATS
-  PStatTimer timer(_draw_primitive_pcollector);
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  call_glLineWidth(geom->get_width());
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  if (geom->get_binding(G_COLOR) == G_PER_VERTEX) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-
-  chromium.Begin(GL_LINES);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-
-    for (int j = 0; j < 2; j++) {
-      // Draw per vertex
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-  }
-
-  chromium.End();
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_linestrip
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_linestrip(GeomLinestrip *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_linestrip()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  call_glLineWidth(geom->get_width());
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  const int *plen = geom->get_lengths();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  if (geom->get_binding(G_COLOR) == G_PER_VERTEX) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-
-    int num_verts = *(plen++);
-    nassertv(num_verts >= 2);
-
-    chromium.Begin(GL_LINE_STRIP);
-
-    // Per-component attributes for the first line segment?
-    issuer.issue_color(G_PER_COMPONENT, ci);
-
-    // Draw the first 2 vertices
-    int v;
-    for (v = 0; v < 2; v++) {
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-
-    // Now draw each of the remaining vertices.  Each vertex from
-    // this point on defines a new line segment.
-    for (v = 2; v < num_verts; v++) {
-      // Per-component attributes?
-      issuer.issue_color(G_PER_COMPONENT, ci);
-
-      // Per-vertex attributes
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-    chromium.End();
-  }
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_sprite
-//       Access: Public, Virtual
-//  Description: CSN, 7/11/00
-////////////////////////////////////////////////////////////////////
-
-// this class exists because an alpha sort is necessary for correct
-// sprite rendering, and we can't simply sort the vertex arrays as
-// each vertex may or may not have corresponding information in the
-// x/y texel-world-ratio and rotation arrays.
-class WrappedSprite {
-public:
-  Vertexf _v;
-  Colorf _c;
-  float _x_ratio;
-  float _y_ratio;
-  float _theta;
-};
-
-// this struct exists because the STL can sort faster than i can.
-struct draw_sprite_vertex_less {
-  INLINE bool operator ()(const WrappedSprite& v0,
-                          const WrappedSprite& v1) const {
-    return v0._v[2] < v1._v[2]; }
-};
-
-void CRGraphicsStateGuardian::
-draw_sprite(GeomSprite *geom, GeomContext *) {
-  // this is a little bit of a mess, but it's ok.  Here's the deal:
-  // we want to draw, and draw quickly, an arbitrarily large number
-  // of sprites all facing the screen.  Performing the billboard math
-  // for ~1000 sprites is way too slow.  Ideally, we want one
-  // matrix transformation that will handle everything, and this is
-  // just about what ends up happening. We're getting the front-facing
-  // effect by setting up a new frustum (of the same z-depth as the
-  // current one) that is very small in x and y.  This way regularly
-  // rendered triangles that might not be EXACTLY facing the camera
-  // will certainly look close enough.  Then, we transform to camera-space
-  // by hand and apply the inverse frustum to the transformed point.
-  // For some cracked out reason, this actually works.
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_sprite()" << endl;
-#endif
-
-  // get the array traversal set up.
-  int nprims = geom->get_num_prims();
-  if (nprims==0) {
-      return;
-  }
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  // need some interface so user can set 2d dimensions if no texture specified
-  float tex_xsize = 1.0f;  
-  float tex_ysize = 1.0f;
-
-  Texture *tex = geom->get_texture();
-  if(tex != NULL) {
-    // set up the texture-rendering state
-    modify_state(RenderState::make
-                 (TextureAttrib::make(tex),
-                  TextureApplyAttrib::make(TextureApplyAttrib::M_modulate)));
-    tex_xsize = tex->_pbuffer->get_xsize();
-    tex_ysize = tex->_pbuffer->get_ysize();
-  }
-
-  // save the modelview matrix
-  const LMatrix4f &modelview_mat = _transform->get_mat();
-
-  // We don't need to mess with the aspect ratio, since we are now
-  // using the default projection matrix, which has the right aspect
-  // ratio built in.
-
-  // load up our own matrices
-  chromium.MatrixMode(GL_MODELVIEW);
-  chromium.LoadIdentity();
-
-  // precomputation stuff
-  float tex_left = geom->get_ll_uv()[0];
-  float tex_right = geom->get_ur_uv()[0];
-  float tex_bottom = geom->get_ll_uv()[1];
-  float tex_top = geom->get_ur_uv()[1];
-
-  float half_width =  0.5f * tex_xsize * fabs(tex_right - tex_left);
-  float half_height = 0.5f * tex_ysize * fabs(tex_top - tex_bottom);
-  float scaled_width = 0.0f;
-  float scaled_height = 0.0f;
-
-  // the user can override alpha sorting if they want
-  bool alpha = false;
-
-  if (!geom->get_alpha_disable()) {
-    // figure out if alpha's enabled (if not, no reason to sort)
-    const TransparencyAttrib *trans = _state->get_transparency();
-    if (trans != (const TransparencyAttrib *)NULL) {
-      alpha = (trans->get_mode() != TransparencyAttrib::M_none);
-    }
-  }
-
-  // sort container and iterator
-  pvector< WrappedSprite > cameraspace_vector;
-  pvector< WrappedSprite >::iterator vec_iter;
-
-  // inner loop vars
-  int i;
-  Vertexf source_vert, cameraspace_vert;
-  float *x_walk = (float *)NULL;
-  float *y_walk = (float *)NULL;
-  float *theta_walk = (float *)NULL;
-  float theta = 0.0f;
-
-  nassertv(geom->get_x_bind_type() != G_PER_VERTEX);
-  nassertv(geom->get_y_bind_type() != G_PER_VERTEX);
-
-  // set up the non-built-in bindings
-  bool x_overall = (geom->get_x_bind_type() == G_OVERALL);
-  bool y_overall = (geom->get_y_bind_type() == G_OVERALL);
-  bool theta_overall = (geom->get_theta_bind_type() == G_OVERALL);
-  bool color_overall = (geom->get_binding(G_COLOR) == G_OVERALL);
-  bool theta_on = !(geom->get_theta_bind_type() == G_OFF);
-
-  // x direction
-  if (x_overall)
-    scaled_width = geom->_x_texel_ratio[0] * half_width;
-  else {
-    nassertv(((int)geom->_x_texel_ratio.size() >= geom->get_num_prims()));
-    x_walk = &geom->_x_texel_ratio[0];
-  }
-
-  // y direction
-  if (y_overall)
-    scaled_height = geom->_y_texel_ratio[0] * half_height;
-  else {
-    nassertv(((int)geom->_y_texel_ratio.size() >= geom->get_num_prims()));
-    y_walk = &geom->_y_texel_ratio[0];
-  }
-
-  // theta
-  if (theta_on) {
-    if (theta_overall)
-      theta = geom->_theta[0];
-    else {
-      nassertv(((int)geom->_theta.size() >= geom->get_num_prims()));
-      theta_walk = &geom->_theta[0];
-    }
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // INNER LOOP PART 1 STARTS HERE
-  // Here we transform each point to cameraspace and fill our sort
-  // vector with the final geometric information.
-  /////////////////////////////////////////////////////////////////////
-
-  cameraspace_vector.reserve(nprims);   //pre-alloc space for nprims
-
-  // the state is set, start running the prims
-  for (i = 0; i < nprims; i++) {
-    WrappedSprite ws;
-
-    source_vert = geom->get_next_vertex(vi);
-
-    // this mult converts to y-up cameraspace.
-    cameraspace_vert = source_vert * modelview_mat;
-    // build the final object that will go into the vector.
-    ws._v.set(cameraspace_vert[0],cameraspace_vert[1],cameraspace_vert[2]);
-
-    if (!color_overall)
-      ws._c = geom->get_next_color(ci);
-    if (!x_overall)
-      ws._x_ratio = *x_walk++;
-    if (!y_overall)
-      ws._y_ratio = *y_walk++;
-    if (theta_on) {
-      if (!theta_overall)
-        ws._theta = *theta_walk++;
-    }
-
-    cameraspace_vector.push_back(ws);
-  }
-
-  // now the verts are properly sorted by alpha (if necessary).  Of course,
-  // the sort is only local, not scene-global, so if you look closely you'll
-  // notice that alphas may be screwy.  It's ok though, because this is fast.
-  // if you want accuracy, use billboards and take the speed hit.
-  if (alpha) {
-    sort(cameraspace_vector.begin(), cameraspace_vector.end(),
-         draw_sprite_vertex_less());
-
-     if (_dithering_enabled)
-         chromium.Disable(GL_DITHER);
-  }
-
-  Vertexf ul, ur, ll, lr;
-
-  if (color_overall)
-    chromium.Color4fv(geom->get_next_color(ci).get_data());
-
-  ////////////////////////////////////////////////////////////////////////////
-  // INNER LOOP PART 2 STARTS HERE
-  // Now we run through the cameraspace vector and compute the geometry for each
-  // tristrip.  This includes scaling as per the ratio arrays, as well as
-  // rotating in the z.
-  ////////////////////////////////////////////////////////////////////////////
-
-  vec_iter = cameraspace_vector.begin();
-  for (; vec_iter != cameraspace_vector.end(); vec_iter++) {
-    WrappedSprite& cur_image = *vec_iter;
-
-    // if not G_OVERALL, calculate the scale factors
-    if (x_overall == false)
-      scaled_width = cur_image._x_ratio * half_width;
-
-    if (y_overall == false)
-      scaled_height = cur_image._y_ratio * half_height;
-
-    // if not G_OVERALL, do some trig for this z rotate
-    if (theta_on) {
-      if (theta_overall == false)
-        theta = cur_image._theta;
-
-      // create the rotated points
-      LMatrix3f xform_mat = LMatrix3f::rotate_mat(theta) * LMatrix3f::scale_mat(scaled_width, scaled_height);
-
-      ur = (LVector3f( 1,  1, 0) * xform_mat) + cur_image._v;
-      ul = (LVector3f(-1,  1, 0) * xform_mat) + cur_image._v;
-      lr = (LVector3f( 1, -1, 0) * xform_mat) + cur_image._v;
-      ll = (LVector3f(-1, -1, 0) * xform_mat) + cur_image._v;
-    }
-    else {
-      // create the normal points
-      ur.set(scaled_width, scaled_height, 0);
-      ul.set(-scaled_width, scaled_height, 0);
-      lr.set(scaled_width, -scaled_height, 0);
-      ll.set(-scaled_width, -scaled_height, 0);
-
-      ur += cur_image._v;
-      ul += cur_image._v;
-      lr += cur_image._v;
-      ll += cur_image._v;
-    }
-
-    // set the color
-    if (color_overall == false)
-      chromium.Color4fv(cur_image._c.get_data());
-
-    // draw each one as a 2-element tri-strip
-    chromium.Begin(GL_TRIANGLE_STRIP);
-    chromium.Normal3f(0.0f, 0.0f, 1.0f);
-    chromium.TexCoord2f(tex_left, tex_bottom);  chromium.Vertex3fv(ll.get_data());
-    chromium.TexCoord2f(tex_right, tex_bottom); chromium.Vertex3fv(lr.get_data());
-    chromium.TexCoord2f(tex_left, tex_top);     chromium.Vertex3fv(ul.get_data());
-    chromium.TexCoord2f(tex_right, tex_top);    chromium.Vertex3fv(ur.get_data());
-    chromium.End();
-  }
-
-  // restore the matrices
-  chromium.LoadMatrixf(modelview_mat.get_data());
-
-  if(alpha && _dithering_enabled)
-     chromium.Enable(GL_DITHER);
-
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_polygon
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_polygon(GeomPolygon *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_polygon()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  const int *plen = geom->get_lengths();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // If we have per-vertex colors or normals, we need smooth shading.
-  // Otherwise we want flat shading for performance reasons.
-  if ((geom->get_binding(G_COLOR) == G_PER_VERTEX && wants_colors()) ||
-      (geom->get_binding(G_NORMAL) == G_PER_VERTEX && wants_normals())) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    int num_verts = *(plen++);
-    nassertv(num_verts >= 3);
-
-    chromium.Begin(GL_POLYGON);
-
-    // Draw the vertices.
-    int v;
-    for (v = 0; v < num_verts; v++) {
-      // Per-vertex attributes.
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-    chromium.End();
-  }
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_tri
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_tri(GeomTri *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_tri()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_tri_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // If we have per-vertex colors or normals, we need smooth shading.
-  // Otherwise we want flat shading for performance reasons.
-  if ((geom->get_binding(G_COLOR) == G_PER_VERTEX && wants_colors()) ||
-      (geom->get_binding(G_NORMAL) == G_PER_VERTEX && wants_normals())) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  chromium.Begin(GL_TRIANGLES);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    for (int j = 0; j < 3; j++) {
-      // Draw per vertex
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-  }
-
-  chromium.End();
-  report_errors();
-#ifdef DO_PSTATS
-  _draw_primitive_pcollector.stop();
-#endif
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_quad
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_quad(GeomQuad *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_quad()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // If we have per-vertex colors or normals, we need smooth shading.
-  // Otherwise we want flat shading for performance reasons.
-  if ((geom->get_binding(G_COLOR) == G_PER_VERTEX && wants_colors()) ||
-      (geom->get_binding(G_NORMAL) == G_PER_VERTEX && wants_normals())) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  chromium.Begin(GL_QUADS);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    for (int j = 0; j < 4; j++) {
-      // Draw per vertex
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-  }
-
-  chromium.End();
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_tristrip
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_tristrip(GeomTristrip *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_tristrip()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_tristrip_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  const int *plen = geom->get_lengths();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // If we have per-vertex colors or normals, we need smooth shading.
-  // Otherwise we want flat shading for performance reasons.
-  if ((geom->get_binding(G_COLOR) == G_PER_VERTEX && wants_colors()) ||
-      (geom->get_binding(G_NORMAL) == G_PER_VERTEX && wants_normals())) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    int num_verts = *(plen++);
-    nassertv(num_verts >= 3);
-
-    chromium.Begin(GL_TRIANGLE_STRIP);
-
-    // Per-component attributes for the first triangle?
-    issuer.issue_color(G_PER_COMPONENT, ci);
-    issuer.issue_normal(G_PER_COMPONENT, ni);
-
-    // Draw the first three vertices.
-    int v;
-    for (v = 0; v < 3; v++) {
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-
-    // Now draw each of the remaining vertices.  Each vertex from
-    // this point on defines a new triangle.
-    for (v = 3; v < num_verts; v++) {
-      // Per-component attributes?
-      issuer.issue_color(G_PER_COMPONENT, ci);
-      issuer.issue_normal(G_PER_COMPONENT, ni);
-
-      // Per-vertex attributes.
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-    chromium.End();
-  }
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_trifan
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_trifan(GeomTrifan *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_trifan()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_trifan_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  const int *plen = geom->get_lengths();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::NormalIterator ni = geom->make_normal_iterator();
-  Geom::TexCoordIterator ti = geom->make_texcoord_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  // If we have per-vertex colors or normals, we need smooth shading.
-  // Otherwise we want flat shading for performance reasons.
-  if ((geom->get_binding(G_COLOR) == G_PER_VERTEX && wants_colors()) ||
-      (geom->get_binding(G_NORMAL) == G_PER_VERTEX && wants_normals())) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-  issuer.issue_normal(G_OVERALL, ni);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-    issuer.issue_normal(G_PER_PRIM, ni);
-
-    int num_verts = *(plen++);
-    nassertv(num_verts >= 3);
-
-    chromium.Begin(GL_TRIANGLE_FAN);
-
-    // Per-component attributes for the first triangle?
-    issuer.issue_color(G_PER_COMPONENT, ci);
-    issuer.issue_normal(G_PER_COMPONENT, ni);
-
-    // Draw the first three vertices.
-    int v;
-    for (v = 0; v < 3; v++) {
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-
-    // Now draw each of the remaining vertices.  Each vertex from
-    // this point on defines a new triangle.
-    for (v = 3; v < num_verts; v++) {
-      // Per-component attributes?
-      issuer.issue_color(G_PER_COMPONENT, ci);
-      issuer.issue_normal(G_PER_COMPONENT, ni);
-
-      // Per-vertex attributes.
-      issuer.issue_color(G_PER_VERTEX, ci);
-      issuer.issue_normal(G_PER_VERTEX, ni);
-      issuer.issue_texcoord(G_PER_VERTEX, ti);
-      issuer.issue_vertex(G_PER_VERTEX, vi);
-    }
-    chromium.End();
-  }
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_sphere
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_sphere(GeomSphere *geom, GeomContext *) {
-  //  activate();
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug() << "draw_sphere()" << endl;
-#endif
-
-#ifdef DO_PSTATS
-  //  PStatTimer timer(_draw_primitive_pcollector);
-  // Using PStatTimer may cause a compiler crash.
-  _draw_primitive_pcollector.start();
-  _vertices_other_pcollector.add_level(geom->get_num_vertices());
-#endif
-
-  issue_scene_graph_color();
-
-  int nprims = geom->get_num_prims();
-  Geom::VertexIterator vi = geom->make_vertex_iterator();
-  Geom::ColorIterator ci = geom->make_color_iterator();
-
-  GeomIssuer::IssueColor *issue_color;
-
-  if (!_color_transform_enabled && !_alpha_transform_enabled) {
-    issue_color = issue_color_gl;
-  }
-  else {
-    issue_color = issue_transformed_color_gl;
-  }
-
-  GeomIssuer issuer(geom, this,
-                    issue_vertex_gl,
-                    issue_normal_gl,
-                    issue_texcoord_gl,
-                    issue_color);
-
-  if (wants_normals()) {
-    call_glShadeModel(GL_SMOOTH);
-  } else {
-    call_glShadeModel(GL_FLAT);
-  }
-
-  // Draw overall
-  issuer.issue_color(G_OVERALL, ci);
-
-  GLUquadricObj *sph = gluNewQuadric();
-  gluQuadricNormals(sph, wants_normals() ? (GLenum)GLU_SMOOTH : (GLenum)GLU_NONE);
-  gluQuadricTexture(sph, wants_texcoords() ? (GLenum)GL_TRUE : (GLenum)GL_FALSE);
-  gluQuadricOrientation(sph, (GLenum)GLU_OUTSIDE);
-  gluQuadricDrawStyle(sph, (GLenum)GLU_FILL);
-  //gluQuadricDrawStyle(sph, (GLenum)GLU_LINE);
-
-  for (int i = 0; i < nprims; i++) {
-    // Draw per primitive
-    issuer.issue_color(G_PER_PRIM, ci);
-
-    for (int j = 0; j < 2; j++) {
-      // Draw per vertex
-      issuer.issue_color(G_PER_VERTEX, ci);
-    }
-    Vertexf center = geom->get_next_vertex(vi);
-    Vertexf edge = geom->get_next_vertex(vi);
-    LVector3f v = edge - center;
-    float r = sqrt(dot(v, v));
-
-    // Since gluSphere doesn't have a center parameter, we have to use
-    // a matrix transform.
-
-    chromium.MatrixMode(GL_MODELVIEW);
-    chromium.PushMatrix();
-    chromium.MultMatrixf(LMatrix4f::translate_mat(center).get_data());
-
-    // Now render the sphere using GLU calls.
-    gluSphere(sph, r, 16, 10);
-
-    chromium.MatrixMode(GL_MODELVIEW);
-    chromium.PopMatrix();
-  }
-
-  gluDeleteQuadric(sph);
-  report_errors();
-  DO_PSTATS_STUFF(_draw_primitive_pcollector.stop());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::prepare_texture
-//       Access: Public, Virtual
-//  Description: Creates a new retained-mode representation of the
-//               given texture, and returns a newly-allocated
-//               TextureContext pointer to reference it.  It is the
-//               responsibility of the calling function to later
-//               call release_texture() with this same pointer (which
-//               will also delete the pointer).
-////////////////////////////////////////////////////////////////////
-TextureContext *CRGraphicsStateGuardian::
-prepare_texture(Texture *tex) {
-  //  activate();
-  CRTextureContext *gtc = new CRTextureContext(tex);
-  chromium.GenTextures(1, &gtc->_index);
-
-  bind_texture(gtc);
-  chromium.PrioritizeTextures(1, &gtc->_index, &gtc->_priority);
-  specify_texture(tex);
-  apply_texture_immediate(tex);
-
-  bool inserted = mark_prepared_texture(gtc);
-
-  // If this assertion fails, the same texture was prepared twice,
-  // which shouldn't be possible, since the texture itself should
-  // detect this.
-  nassertr(inserted, NULL);
-
-  report_errors();
-  return gtc;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::apply_texture
-//       Access: Public, Virtual
-//  Description: Makes the texture the currently available texture for
-//               rendering.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-apply_texture(TextureContext *tc) {
-  //  activate();
-  add_to_texture_record(tc);
-  bind_texture(tc);
-
-  int dirty = tc->get_dirty_flags();
-  if ((dirty & (Texture::DF_wrap | Texture::DF_filter)) != 0) {
-    // We need to re-specify the texture properties.
-    specify_texture(tc->_texture);
-  }
-  if ((dirty & (Texture::DF_image | Texture::DF_mipmap)) != 0) {
-    // We need to re-apply the image.
-    apply_texture_immediate(tc->_texture);
-  }
-
-  tc->clear_dirty_flags();
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::release_texture
-//       Access: Public, Virtual
-//  Description: Frees the GL resources previously allocated for the
-//               texture.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-release_texture(TextureContext *tc) {
-  //  activate();
-  CRTextureContext *gtc = DCAST(CRTextureContext, tc);
-  Texture *tex = tc->_texture;
-
-  if (!is_closed()) {
-    chromium.DeleteTextures(1, &gtc->_index);
-  }
-  gtc->_index = 0;
-
-  bool erased = unmark_prepared_texture(gtc);
-
-  // If this assertion fails, a texture was released that hadn't been
-  // prepared (or a texture was released twice).
-  nassertv(erased);
-
-  tex->clear_gsg(this);
-
-  delete gtc;
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::prepare_geom_node
-//       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *CRGraphicsStateGuardian::
-prepare_geom_node(GeomNode *node) {
-#if 0  // temporarily disabled until we bring to new scene graph
-
-  // Make sure we have at least some static Geoms in the GeomNode;
-  // otherwise there's no point in building a display list.
-  int num_geoms = node->get_num_geoms();
-  bool all_dynamic = true;
-  int i;
-
-  for (i = 0; (i < num_geoms) && all_dynamic; i++) {
-    dDrawable *geom = node->get_geom(i);
-    all_dynamic = geom->is_dynamic();
-  }
-  if (all_dynamic) {
-    // Never mind.
-    return (GeomNodeContext *)NULL;
-  }
-
-  // Ok, we've got something; use it.
-  CRGeomNodeContext *ggnc = new CRGeomNodeContext(node);
-  ggnc->_index = chromium.GenLists(1);
-  if (ggnc->_index == 0) {
-    crgsg_cat.error()
-      << "Ran out of display list indices.\n";
-    delete ggnc;
-    return (GeomNodeContext *)NULL;
-  }
-
-  // We need to temporarily force normals and UV's on, so the display
-  // list will have them built in.
-  bool old_normals_enabled = _normals_enabled;
-  bool old_texturing_enabled = _texturing_enabled;
-  bool old_vertex_colors_enabled = _vertex_colors_enabled;
-  _normals_enabled = true;
-  _texturing_enabled = true;
-  _vertex_colors_enabled = true;
-
-#ifdef DO_PSTATS
-  // Count up the number of vertices we're about to render, by
-  // checking the PStats vertex counters now, and at the end.  This is
-  // kind of hacky, but this is debug code.
-  float num_verts_before = 
-    _vertices_tristrip_pcollector.get_level() +
-    _vertices_trifan_pcollector.get_level() +
-    _vertices_tri_pcollector.get_level() +
-    _vertices_other_pcollector.get_level();
-#endif
-
-  // Now define the display list.
-  chromium.NewList(ggnc->_index, GL_COMPILE);
-  for (i = 0; i < num_geoms; i++) {
-    dDrawable *geom = node->get_geom(i);
-    if (geom->is_dynamic()) {
-      // Wait, this is a dynamic Geom.  We can't safely put it in the
-      // display list, because it may change from one frame to the
-      // next; instead, we'll keep it out.
-      ggnc->_dynamic_geoms.push_back(geom);
-    } else {
-      // A static Geom becomes part of the display list.
-      geom->draw(this);
-    }
-  }
-  chromium.EndList();
-
-#ifdef DO_PSTATS
-  float num_verts_after = 
-    _vertices_tristrip_pcollector.get_level() +
-    _vertices_trifan_pcollector.get_level() +
-    _vertices_tri_pcollector.get_level() +
-    _vertices_other_pcollector.get_level();
-  float num_verts = num_verts_after - num_verts_before;
-  ggnc->_num_verts = (int)(num_verts + 0.5);
-#endif
-
-  _normals_enabled = old_normals_enabled;
-  _texturing_enabled = old_texturing_enabled;
-  _vertex_colors_enabled = old_vertex_colors_enabled;
-
-  bool inserted = mark_prepared_geom_node(ggnc);
-
-  // If this assertion fails, the same GeomNode was prepared twice,
-  // which shouldn't be possible, since the GeomNode itself should
-  // detect this.
-  nassertr(inserted, NULL);
-
-  return ggnc;
-#endif  // temporarily disabled until we bring to new scene graph
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::draw_geom_node
-//       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-draw_geom_node(GeomNode *node, const RenderState *state,
-               GeomNodeContext *gnc) {
-#if 0  // temporarily disabled until we bring to new scene graph
-  if (gnc == (GeomNodeContext *)NULL) {
-    // We don't have a saved context; just draw the GeomNode in
-    // immediate mode.
-    int num_geoms = node->get_num_geoms();
-    for (int i = 0; i < num_geoms; i++) {
-      node->get_geom(i)->draw(this);
-    }
-
-  } else {
-    // We do have a saved context; use it.
-    add_to_geom_node_record(gnc);
-    CRGeomNodeContext *ggnc = DCAST(CRGeomNodeContext, gnc);
-    chromium.CallList(ggnc->_index);
-
-#ifdef DO_PSTATS 
-    PStatTimer timer(_draw_primitive_pcollector);
-    _vertices_display_list_pcollector.add_level(ggnc->_num_verts);
-#endif
-
-    // Also draw all the dynamic Geoms.
-    int num_geoms = ggnc->_dynamic_geoms.size();
-    for (int i = 0; i < num_geoms; i++) {
-      ggnc->_dynamic_geoms[i]->draw(this);
-    }
-  }
-#endif  // temporarily disabled until we bring to new scene graph
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-release_geom_node(GeomNodeContext *gnc) {
-  if (gnc != (GeomNodeContext *)NULL) {
-    CRGeomNodeContext *ggnc = DCAST(CRGeomNodeContext, gnc);
-    chromium.DeleteLists(ggnc->_index, 1);
-
-    bool erased = unmark_prepared_geom_node(ggnc);
-
-    // If this assertion fails, a GeomNode was released that hadn't
-    // been prepared (or a GeomNode was released twice).
-    nassertv(erased);
-    
-    ggnc->_node->clear_gsg(this);
-    delete ggnc;
-  }
-}
-
-static int logs[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
-                      4096, 0 };
-
-// This function returns the smallest power of two greater than or
-// equal to x.
-static int binary_log_cap(const int x) {
-  int i = 0;
-  for (; (x > logs[i]) && (logs[i] != 0); ++i);
-  if (logs[i] == 0)
-    return 4096;
-  return logs[i];
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::copy_texture
-//       Access: Public, Virtual
-//  Description: Copy the pixel region indicated by the display
-//               region from the framebuffer into texture memory
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-copy_texture(TextureContext *tc, const DisplayRegion *dr) {
-  nassertv(tc != NULL && dr != NULL);
-  //  activate();
-
-  Texture *tex = tc->_texture;
-
-  // Determine the size of the grab from the given display region
-  // If the requested region is not a power of two, grab a region that is
-  // a power of two that contains the requested region
-  int xo, yo, req_w, req_h;
-  dr->get_region_pixels(xo, yo, req_w, req_h);
-  int w = binary_log_cap(req_w);
-  int h = binary_log_cap(req_h);
-  if (w != req_w || h != req_h) {
-    tex->_requested_w = req_w;
-    tex->_requested_h = req_h;
-    tex->_has_requested_size = true;
-  }
-
-  PixelBuffer *pb = tex->_pbuffer;
-
-  pb->set_xorg(xo);
-  pb->set_yorg(yo);
-  pb->set_xsize(w);
-  pb->set_ysize(h);
-
-  bind_texture(tc);
-
-  chromium.CopyTexImage2D(GL_TEXTURE_2D, 0,
-                   get_internal_image_format(pb->get_format()),
-                   pb->get_xorg(), pb->get_yorg(),
-                   pb->get_xsize(), pb->get_ysize(), pb->get_border());
-  clear_attribute(TextureTransition::get_class_type());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::copy_texture
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-copy_texture(TextureContext *tc, const DisplayRegion *dr, const RenderBuffer &rb) {
-  //  activate();
-  set_read_buffer(rb);
-  copy_texture(tc, dr);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::texture_to_pixel_buffer
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb) {
-  nassertv(tc != NULL && pb != NULL);
-  //  activate();
-
-  Texture *tex = tc->_texture;
-
-  int w = tex->_pbuffer->get_xsize();
-  int h = tex->_pbuffer->get_ysize();
-
-  PT(DisplayRegion) dr = _win->make_scratch_display_region(w, h);
-
-  FrameBufferStack old_fb = push_frame_buffer
-    (get_render_buffer(RenderBuffer::T_back | RenderBuffer::T_depth),
-     dr);
-
-  texture_to_pixel_buffer(tc, pb, dr);
-
-  pop_frame_buffer(old_fb);
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::texture_to_pixel_buffer
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb,
-                        const DisplayRegion *dr) {
-  nassertv(tc != NULL && pb != NULL && dr != NULL);
-  //  activate();
-
-  Texture *tex = tc->_texture;
-
-  // Do a deep copy to initialize the pixel buffer
-  pb->copy(tex->_pbuffer);
-
-  // If the image was empty, we need to render the texture into the frame
-  // buffer and then copy the results into the pixel buffer's image
-  if (pb->_image.empty()) {
-    int w = pb->get_xsize();
-    int h = pb->get_ysize();
-    draw_texture(tc, dr);
-    pb->_image = PTA_uchar::empty_array(w * h * pb->get_num_components());
-    copy_pixel_buffer(pb, dr);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::copy_pixel_buffer
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr) {
-  nassertv(pb != NULL && dr != NULL);
-  //  activate();
-  set_pack_alignment(1);
-
-  // Bug fix for RE, RE2, and VTX - need to disable texturing in order
-  // for chromium.ReadPixels() to work
-  // NOTE: reading the depth buffer is *much* slower than reading the
-  // color buffer
-  clear_attribute(TextureTransition::get_class_type());
-
-  int xo, yo, w, h;
-  dr->get_region_pixels(xo, yo, w, h);
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crReadPixels(" << pb->get_xorg() << ", " << pb->get_yorg()
-    << ", " << pb->get_xsize() << ", " << pb->get_ysize()
-    << ", ";
-  switch (get_external_image_format(pb->get_format())) {
-  case GL_DEPTH_COMPONENT:
-    crgsg_cat.debug(false) << "GL_DEPTH_COMPONENT, ";
-    break;
-  case GL_RGB:
-    crgsg_cat.debug(false) << "GL_RGB, ";
-    break;
-  case GL_RGBA:
-    crgsg_cat.debug(false) << "GL_RGBA, ";
-    break;
-#ifdef GL_BGR
-  case GL_BGR:
-    crgsg_cat.debug(false) << "GL_BGR, ";
-    break;
-  case GL_BGRA:
-    crgsg_cat.debug(false) << "GL_BGRA, ";
-    break;
-#endif  // GL_BGR
-  default:
-    crgsg_cat.debug(false) << "unknown, ";
-    break;
-  }
-  switch (get_image_type(pb->get_image_type())) {
-  case GL_UNSIGNED_BYTE:
-    crgsg_cat.debug(false) << "GL_UNSIGNED_BYTE, ";
-    break;
-  case GL_FLOAT:
-    crgsg_cat.debug(false) << "GL_FLOAT, ";
-    break;
-  default:
-    crgsg_cat.debug(false) << "unknown, ";
-    break;
-  }
-  crgsg_cat.debug(false)
-    << (void *)pb->_image.p() << ")" << endl;
-#endif
-
-  // pixelbuffer "origin" represents upper left screen point at which
-  // pixelbuffer should be drawn using draw_pixel_buffer
-  nassertv(!pb->_image.empty());
-  chromium.ReadPixels(pb->get_xorg() + xo, pb->get_yorg() + yo,
-               pb->get_xsize(), pb->get_ysize(),
-               get_external_image_format(pb->get_format()),
-               get_image_type(pb->get_image_type()),
-               pb->_image.p());
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::copy_pixel_buffer
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
-                  const RenderBuffer &rb) {
-  //  activate();
-  set_read_buffer(rb);
-  copy_pixel_buffer(pb, dr);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::apply_material
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::apply_material(const Material *material) {
-  GLenum face = material->get_twoside() ? GL_FRONT_AND_BACK : GL_FRONT;
-
-  chromium.Materialfv(face, GL_SPECULAR, material->get_specular().get_data());
-  chromium.Materialfv(face, GL_EMISSION, material->get_emission().get_data());
-  chromium.Materialf(face, GL_SHININESS, material->get_shininess());
-
-  if (material->has_ambient() && material->has_diffuse()) {
-    // The material has both an ambient and diffuse specified.  This
-    // means we do not need chromium.MaterialColor().
-    chromium.Disable(GL_COLOR_MATERIAL);
-    chromium.Materialfv(face, GL_AMBIENT, material->get_ambient().get_data());
-    chromium.Materialfv(face, GL_DIFFUSE, material->get_diffuse().get_data());
-
-  } else if (material->has_ambient()) {
-    // The material specifies an ambient, but not a diffuse component.
-    // The diffuse component comes from the object's color.
-    chromium.Materialfv(face, GL_AMBIENT, material->get_ambient().get_data());
-    chromium.ColorMaterial(face, GL_DIFFUSE);
-    chromium.Enable(GL_COLOR_MATERIAL);
-
-  } else if (material->has_diffuse()) {
-    // The material specifies a diffuse, but not an ambient component.
-    // The ambient component comes from the object's color.
-    chromium.Materialfv(face, GL_DIFFUSE, material->get_diffuse().get_data());
-    chromium.ColorMaterial(face, GL_AMBIENT);
-    chromium.Enable(GL_COLOR_MATERIAL);
-
-  } else {
-    // The material specifies neither a diffuse nor an ambient
-    // component.  Both components come from the object's color.
-    chromium.ColorMaterial(face, GL_AMBIENT_AND_DIFFUSE);
-    chromium.Enable(GL_COLOR_MATERIAL);
-  }
-
-  call_glLightModelLocal(material->get_local());
-  call_glLightModelTwoSide(material->get_twoside());
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::apply_fog
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-apply_fog(Fog *fog) {
-  Fog::Mode fmode = fog->get_mode();
-  call_glFogMode(get_fog_mode_type((Fog::Mode)fmode));
-
-  if (fmode == Fog::M_linear) {
-    float onset, opaque;
-    fog->get_linear_range(onset, opaque);
-    call_glFogStart(onset);
-    call_glFogEnd(opaque);
-
-  } else {
-    // Exponential fog is always camera-relative.
-    call_glFogDensity(fog->get_exp_density());
-  }
-
-  call_glFogColor(fog->get_color());
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_transform
-//       Access: Public, Virtual
-//  Description: Sends the indicated transform matrix to the graphics
-//               API to be applied to future vertices.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_transform(const TransformState *transform) {
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crLoadMatrix(GL_MODELVIEW): " << transform->get_mat() << endl;
-#endif
-  chromium.MatrixMode(GL_MODELVIEW);
-  chromium.LoadMatrixf(transform->get_mat().get_data());
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_tex_matrix
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_tex_matrix(const TexMatrixAttrib *attrib) {
-  chromium.MatrixMode(GL_TEXTURE);
-  chromium.LoadMatrixf(attrib->get_mat().get_data());
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_texture
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_texture(const TextureAttrib *attrib) {
-  if (attrib->is_off()) {
-    enable_texturing(false);
-  } else {
-    enable_texturing(true);
-    Texture *tex = attrib->get_texture();
-    nassertv(tex != (Texture *)NULL);
-    tex->apply(this);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_material
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_material(const MaterialAttrib *attrib) {
-  const Material *material = attrib->get_material();
-  if (material != (const Material *)NULL) {
-    apply_material(material);
-  } else {
-    // Apply a default material when materials are turned off.
-    Material empty;
-    apply_material(&empty);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_render_mode
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_render_mode(const RenderModeAttrib *attrib) {
-  RenderModeAttrib::Mode mode = attrib->get_mode();
-
-  switch (mode) {
-  case RenderModeAttrib::M_filled:
-    call_glPolygonMode(GL_FILL);
-    break;
-
-  case RenderModeAttrib::M_wireframe:
-    call_glLineWidth(attrib->get_line_width());
-    call_glPolygonMode(GL_LINE);
-    break;
-
-  default:
-    crgsg_cat.error()
-      << "Unknown render mode " << (int)mode << endl;
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_texture_apply
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_texture_apply(const TextureApplyAttrib *attrib) {
-  GLint glmode = get_texture_apply_mode_type(attrib->get_mode());
-  chromium.TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, glmode);
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_color_write
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_color_write(const ColorWriteAttrib *attrib) {
-  // If we did not override this function, the default implementation
-  // would achieve turning off color writes by changing the blend mode
-  // in set_blend_mode().  However, since GL does support an easy way
-  // to disable writes to the color buffer, we can take advantage of
-  // it here.
-  ColorWriteAttrib::Mode mode = attrib->get_mode();
-  if (mode == ColorWriteAttrib::M_off) {
-    chromium.ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-  } else {
-    chromium.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_depth_test
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_depth_test(const DepthTestAttrib *attrib) {
-  DepthTestAttrib::Mode mode = attrib->get_mode();
-  if (mode == DepthTestAttrib::M_none) {
-    enable_depth_test(false);
-  } else {
-    enable_depth_test(true);
-    chromium.DepthFunc(get_depth_func_type(mode));
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_depth_write
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_depth_write(const DepthWriteAttrib *attrib) {
-  DepthWriteAttrib::Mode mode = attrib->get_mode();
-  if (mode == DepthWriteAttrib::M_off) {
-    chromium.DepthMask(GL_FALSE);
-  } else {
-    chromium.DepthMask(GL_TRUE);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_cull_face
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_cull_face(const CullFaceAttrib *attrib) {
-  CullFaceAttrib::Mode mode = attrib->get_mode();
-
-  switch (mode) {
-  case CullFaceAttrib::M_cull_none:
-    chromium.Disable(GL_CULL_FACE);
-    break;
-  case CullFaceAttrib::M_cull_clockwise:
-    chromium.Enable(GL_CULL_FACE);
-    chromium.CullFace(GL_BACK);
-    break;
-  case CullFaceAttrib::M_cull_counter_clockwise:
-    chromium.Enable(GL_CULL_FACE);
-    chromium.CullFace(GL_FRONT);
-    break;
-  default:
-    crgsg_cat.error()
-      << "invalid cull face mode " << (int)mode << endl;
-    break;
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_fog
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_fog(const FogAttrib *attrib) {
-  if (!attrib->is_off()) {
-    enable_fog(true);
-    Fog *fog = attrib->get_fog();
-    nassertv(fog != (Fog *)NULL);
-    apply_fog(fog);
-  } else {
-    enable_fog(false);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_depth_offset
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_depth_offset(const DepthOffsetAttrib *attrib) {
-  int offset = attrib->get_offset();
-
-  if (offset != 0) {
-    // The relationship between these two parameters is a little
-    // unclear and poorly explained in the GL man pages.
-    chromium.PolygonOffset((GLfloat) -offset, (GLfloat) -offset);
-    enable_polygon_offset(true);
-
-  } else {
-    enable_polygon_offset(false);
-  }
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::bind_light
-//       Access: Public, Virtual
-//  Description: Called the first time a particular light has been
-//               bound to a given id within a frame, this should set
-//               up the associated hardware light with the light's
-//               properties.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-bind_light(PointLight *light, int light_id) {
-  GLenum id = get_light_id(light_id);
-  static const Colorf black(0.0f, 0.0f, 0.0f, 1.0f);
-  chromium.Lightfv(id, GL_AMBIENT, black.get_data());
-  chromium.Lightfv(id, GL_DIFFUSE, light->get_color().get_data());
-  chromium.Lightfv(id, GL_SPECULAR, light->get_specular_color().get_data());
-
-  // Position needs to specify x, y, z, and w
-  // w == 1 implies non-infinite position
-  NodePath light_np(light);
-  const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root());
-  LPoint3f pos = light->get_point() * light_mat;
-
-  LPoint4f fpos(pos[0], pos[1], pos[2], 1.0f);
-  chromium.Lightfv(id, GL_POSITION, fpos.get_data());
-
-  // GL_SPOT_DIRECTION is not significant when cutoff == 180
-
-  // Exponent == 0 implies uniform light distribution
-  chromium.Lightf(id, GL_SPOT_EXPONENT, 0.0f);
-
-  // Cutoff == 180 means uniform point light source
-  chromium.Lightf(id, GL_SPOT_CUTOFF, 180.0f);
-
-  const LVecBase3f &att = light->get_attenuation();
-  chromium.Lightf(id, GL_CONSTANT_ATTENUATION, att[0]);
-  chromium.Lightf(id, GL_LINEAR_ATTENUATION, att[1]);
-  chromium.Lightf(id, GL_QUADRATIC_ATTENUATION, att[2]);
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::bind_light
-//       Access: Public, Virtual
-//  Description: Called the first time a particular light has been
-//               bound to a given id within a frame, this should set
-//               up the associated hardware light with the light's
-//               properties.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-bind_light(DirectionalLight *light, int light_id) {
-  GLenum id = get_light_id( light_id );
-  static const Colorf black(0.0f, 0.0f, 0.0f, 1.0f);
-  chromium.Lightfv(id, GL_AMBIENT, black.get_data());
-  chromium.Lightfv(id, GL_DIFFUSE, light->get_color().get_data());
-  chromium.Lightfv(id, GL_SPECULAR, light->get_specular_color().get_data());
-
-  // Position needs to specify x, y, z, and w.
-  // w == 0 implies light is at infinity
-  NodePath light_np(light);
-  const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root());
-  LVector3f dir = light->get_direction() * light_mat;
-  LPoint4f fdir(-dir[0], -dir[1], -dir[2], 0);
-  chromium.Lightfv(id, GL_POSITION, fdir.get_data());
-
-  // GL_SPOT_DIRECTION is not significant when cutoff == 180
-  // In this case, position x, y, z specifies direction
-
-  // Exponent == 0 implies uniform light distribution
-  chromium.Lightf(id, GL_SPOT_EXPONENT, 0.0f);
-
-  // Cutoff == 180 means uniform point light source
-  chromium.Lightf(id, GL_SPOT_CUTOFF, 180.0f);
-
-  // Default attenuation values (only spotlight and point light can
-  // modify these)
-  chromium.Lightf(id, GL_CONSTANT_ATTENUATION, 1.0f);
-  chromium.Lightf(id, GL_LINEAR_ATTENUATION, 0.0f);
-  chromium.Lightf(id, GL_QUADRATIC_ATTENUATION, 0.0f);
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::bind_light
-//       Access: Public, Virtual
-//  Description: Called the first time a particular light has been
-//               bound to a given id within a frame, this should set
-//               up the associated hardware light with the light's
-//               properties.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-bind_light(Spotlight *light, int light_id) {
-  Lens *lens = light->get_lens();
-  nassertv(lens != (Lens *)NULL);
-
-  GLenum id = get_light_id(light_id);
-  static const Colorf black(0.0f, 0.0f, 0.0f, 1.0f);
-  chromium.Lightfv(id, GL_AMBIENT, black.get_data());
-  chromium.Lightfv(id, GL_DIFFUSE, light->get_color().get_data());
-  chromium.Lightfv(id, GL_SPECULAR, light->get_specular_color().get_data());
-
-  // Position needs to specify x, y, z, and w
-  // w == 1 implies non-infinite position
-  NodePath light_np(light);
-  const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root());
-  LPoint3f pos = lens->get_nodal_point() * light_mat;
-  LVector3f dir = lens->get_view_vector() * light_mat;
-
-  LPoint4f fpos(pos[0], pos[1], pos[2], 1.0f);
-  chromium.Lightfv(id, GL_POSITION, fpos.get_data());
-  chromium.Lightfv(id, GL_SPOT_DIRECTION, dir.get_data());
-
-  chromium.Lightf(id, GL_SPOT_EXPONENT, light->get_exponent());
-  chromium.Lightf(id, GL_SPOT_CUTOFF, lens->get_hfov());
-
-  const LVecBase3f &att = light->get_attenuation();
-  chromium.Lightf(id, GL_CONSTANT_ATTENUATION, att[0]);
-  chromium.Lightf(id, GL_LINEAR_ATTENUATION, att[1]);
-  chromium.Lightf(id, GL_QUADRATIC_ATTENUATION, att[2]);
-
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::wants_normals
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-bool CRGraphicsStateGuardian::
-wants_normals() const {
-  return (_lighting_enabled || _normals_enabled);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::wants_texcoords
-//       Access: Public, Virtual
-//  Description:
-////////////////////////////////////////////////////////////////////
-bool CRGraphicsStateGuardian::
-wants_texcoords() const {
-  return _texturing_enabled;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::depth_offset_decals
-//       Access: Public, Virtual
-//  Description: Returns true if this GSG can implement decals using a
-//               DepthOffsetAttrib, or false if that is unreliable
-//               and the three-step rendering process should be used
-//               instead.
-////////////////////////////////////////////////////////////////////
-bool CRGraphicsStateGuardian::
-depth_offset_decals() {
-  return cr_depth_offset_decals;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_internal_coordinate_system
-//       Access: Public, Virtual
-//  Description: Should be overridden by derived classes to return the
-//               coordinate system used internally by the GSG, if any
-//               one particular coordinate system is used.  The
-//               default, CS_default, indicates that the GSG can use
-//               any coordinate system.
-//
-//               If this returns other than CS_default, the
-//               GraphicsEngine will automatically convert all
-//               transforms into the indicated coordinate system.
-////////////////////////////////////////////////////////////////////
-CoordinateSystem CRGraphicsStateGuardian::
-get_internal_coordinate_system() const {
-  return CS_yup_right;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::compute_distance_to
-//       Access: Public, Virtual
-//  Description: This function may only be called during a render
-//               traversal; it will compute the distance to the
-//               indicated point, assumed to be in modelview
-//               coordinates, from the camera plane.
-////////////////////////////////////////////////////////////////////
-float CRGraphicsStateGuardian::
-compute_distance_to(const LPoint3f &point) const {
-  // In the case of a CRGraphicsStateGuardian, we know that the
-  // modelview matrix already includes the relative transform from the
-  // camera, as well as a to-y-up conversion.  Thus, the distance to
-  // the camera plane is simply the -z distance.
-
-  return -point[2];
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: report_errors_loop
-//       Access: Protected
-//  Description: The internal implementation of report_errors().
-//               Don't call this function; use report_errors()
-//               instead.
-////////////////////////////////////////////////////////////////////
-
-void report_errors_loop(GLenum error_code) {
-#ifndef NDEBUG
-#define MAXGLERRORSREPORTED 20
-  int cnt=0;
-  while ((cnt<MAXGLERRORSREPORTED) && (error_code != GL_NO_ERROR)) {
-    const GLubyte *error_string = gluErrorString(error_code);
-    if (error_string != (const GLubyte *)NULL) {
-      crgsg_cat.error() << error_string << "\n";
-    } else {
-      crgsg_cat.error()
-        << "Error number " << (int)error_code << "; no string available.\n";
-    }
-    error_code = chromium.GetError();
-    cnt++;
-  }
-#endif
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_draw_buffer
-//       Access: Protected
-//  Description: Sets up the chromium.DrawBuffer to render into the buffer
-//               indicated by the RenderBuffer object.  This only sets
-//               up the color bits; it does not affect the depth,
-//               stencil, accum layers.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-set_draw_buffer(const RenderBuffer &rb) {
-  switch (rb._buffer_type & RenderBuffer::T_color) {
-  case RenderBuffer::T_front:
-    call_glDrawBuffer(GL_FRONT);
-    break;
-
-  case RenderBuffer::T_back:
-    call_glDrawBuffer(GL_BACK);
-    break;
-
-  case RenderBuffer::T_right:
-    call_glDrawBuffer(GL_RIGHT);
-    break;
-
-  case RenderBuffer::T_left:
-    call_glDrawBuffer(GL_LEFT);
-    break;
-
-  case RenderBuffer::T_front_right:
-    call_glDrawBuffer(GL_FRONT_RIGHT);
-    break;
-
-  case RenderBuffer::T_front_left:
-    call_glDrawBuffer(GL_FRONT_LEFT);
-    break;
-
-  case RenderBuffer::T_back_right:
-    call_glDrawBuffer(GL_BACK_RIGHT);
-    break;
-
-  case RenderBuffer::T_back_left:
-    call_glDrawBuffer(GL_BACK_LEFT);
-    break;
-
-  default:
-    call_glDrawBuffer(GL_FRONT_AND_BACK);
-  }
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_read_buffer
-//       Access: Protected
-//  Description: Sets up the chromium.ReadBuffer to render into the buffer
-//               indicated by the RenderBuffer object.  This only sets
-//               up the color bits; it does not affect the depth,
-//               stencil, accum layers.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-set_read_buffer(const RenderBuffer &rb) {
-  switch (rb._buffer_type & RenderBuffer::T_color) {
-  case RenderBuffer::T_front:
-    call_glReadBuffer(GL_FRONT);
-    break;
-
-  case RenderBuffer::T_back:
-    call_glReadBuffer(GL_BACK);
-    break;
-
-  case RenderBuffer::T_right:
-    call_glReadBuffer(GL_RIGHT);
-    break;
-
-  case RenderBuffer::T_left:
-    call_glReadBuffer(GL_LEFT);
-    break;
-
-  case RenderBuffer::T_front_right:
-    call_glReadBuffer(GL_FRONT_RIGHT);
-    break;
-
-  case RenderBuffer::T_front_left:
-    call_glReadBuffer(GL_FRONT_LEFT);
-    break;
-
-  case RenderBuffer::T_back_right:
-    call_glReadBuffer(GL_BACK_RIGHT);
-    break;
-
-  case RenderBuffer::T_back_left:
-    call_glReadBuffer(GL_BACK_LEFT);
-    break;
-
-  default:
-    call_glReadBuffer(GL_FRONT_AND_BACK);
-  }
-  report_errors();
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::bind_texture
-//       Access: Protected
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-bind_texture(TextureContext *tc) {
-  //  activate();
-  CRTextureContext *gtc = DCAST(CRTextureContext, tc);
-
-#ifdef GSG_VERBOSE
-  Texture *tex = tc->_texture;
-  crgsg_cat.debug()
-    << "crBindTexture(): " << tex->get_name() << "(" << (int)gtc->_index
-    << ")" << endl;
-#endif
-  chromium.BindTexture(GL_TEXTURE_2D, gtc->_index);
-  report_errors();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::specify_texture
-//       Access: Protected
-//  Description:
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-specify_texture(Texture *tex) {
-  chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
-                  get_texture_wrap_mode(tex->get_wrapu()));
-  chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
-                  get_texture_wrap_mode(tex->get_wrapv()));
-
-  if (cr_force_mipmaps) {
-    chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
-                    GL_LINEAR_MIPMAP_LINEAR);
-    chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
-  } else {
-    chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
-                    get_texture_filter_type(tex->get_minfilter()));
-    chromium.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
-                    get_texture_filter_type(tex->get_magfilter()));
-  }
-  report_errors();
-}
-
-#ifndef NDEBUG
-////////////////////////////////////////////////////////////////////
-//     Function: compute_cr_image_size
-//  Description: Calculates how many bytes GL will expect to read for
-//               a texture image, based on the number of pixels and
-//               the GL format and type.  This is only used for
-//               debugging.
-////////////////////////////////////////////////////////////////////
-static int
-compute_cr_image_size(int xsize, int ysize, int external_format, int type) {
-  int num_components = 0;
-  switch (external_format) {
-  case GL_COLOR_INDEX:
-  case GL_STENCIL_INDEX:
-  case GL_DEPTH_COMPONENT:
-  case GL_RED:
-  case GL_GREEN:
-  case GL_BLUE:
-  case GL_ALPHA:
-  case GL_LUMINANCE:
-    num_components = 1;
-    break;
-
-  case GL_LUMINANCE_ALPHA:
-    num_components = 2;
-    break;
-
-#ifdef GL_BGR
-  case GL_BGR:
-#endif
-  case GL_RGB:
-    num_components = 3;
-    break;
-
-#ifdef GL_BGR
-  case GL_BGRA:
-#endif
-  case GL_RGBA:
-    num_components = 4;
-    break;
-  }
-
-  int pixel_width = 0;
-  switch (type) {
-  case GL_UNSIGNED_BYTE:
-    pixel_width = 1 * num_components;
-    break;
-
-  case GL_UNSIGNED_SHORT:
-    pixel_width = 2 * num_components;
-    break;
-
-#ifdef GL_UNSIGNED_BYTE_3_3_2_EXT
-  case GL_UNSIGNED_BYTE_3_3_2_EXT:
-    nassertr(num_components == 3, 0);
-    pixel_width = 1;
-    break;
-#endif
-
-  case GL_FLOAT:
-    pixel_width = 4 * num_components;
-    break;
-  }
-
-  return xsize * ysize * pixel_width;
-}
-#endif  // NDEBUG
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::uchar_bgr_to_rgb
-//  Description: Recopies the given array of pixels, converting from
-//               BGR to RGB arrangement.
-////////////////////////////////////////////////////////////////////
-static void
-uchar_bgr_to_rgb(unsigned char *dest, const unsigned char *source, 
-                 int num_pixels) {
-  for (int i = 0; i < num_pixels; i++) {
-    dest[0] = source[2];
-    dest[1] = source[1];
-    dest[2] = source[0];
-    dest += 3;
-    source += 3;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::uchar_bgra_to_rgba
-//  Description: Recopies the given array of pixels, converting from
-//               BGRA to RGBA arrangement.
-////////////////////////////////////////////////////////////////////
-static void
-uchar_bgra_to_rgba(unsigned char *dest, const unsigned char *source, 
-                   int num_pixels) {
-  for (int i = 0; i < num_pixels; i++) {
-    dest[0] = source[2];
-    dest[1] = source[1];
-    dest[2] = source[0];
-    dest[3] = source[3];
-    dest += 4;
-    source += 4;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::apply_texture_immediate
-//       Access: Protected
-//  Description: Sends the texture image to GL.  This can be used to
-//               render a texture in immediate mode, or as part of the
-//               process of creating a GL texture object.
-//
-//               The return value is true if successful, or false if
-//               the texture has no image.
-////////////////////////////////////////////////////////////////////
-bool CRGraphicsStateGuardian::
-apply_texture_immediate(Texture *tex) {
-  PixelBuffer *pb = tex->get_ram_image();
-  if (pb == (PixelBuffer *)NULL) {
-    return false;
-  }
-
-  int xsize = pb->get_xsize();
-  int ysize = pb->get_ysize();
-  int num_pixels = xsize * ysize;
-
-  GLenum internal_format = get_internal_image_format(pb->get_format());
-  GLenum external_format = get_external_image_format(pb->get_format());
-  GLenum type = get_image_type(pb->get_image_type());
-
-  uchar *image = pb->_image;
-  uchar *locally_allocated_image = (uchar *)NULL;
-  if (!cr_supports_bgr) {
-    // If the GL doesn't claim to support BGR, we may have to reverse
-    // the byte ordering of the image.
-    if (external_format == GL_RGB && pb->get_image_type() == PixelBuffer::T_unsigned_byte) {
-      locally_allocated_image = new uchar[num_pixels * 3];
-      image = locally_allocated_image;
-      uchar_bgr_to_rgb(image, pb->_image, num_pixels);
-    } else if (external_format == GL_RGBA && pb->get_image_type() == PixelBuffer::T_unsigned_byte) {
-      locally_allocated_image = new uchar[num_pixels * 4];
-      image = locally_allocated_image;
-      uchar_bgra_to_rgba(image, pb->_image, num_pixels);
-    }
-  }
-
-#ifndef NDEBUG
-  int wanted_size = 
-    compute_cr_image_size(xsize, ysize,
-                          external_format, type);
-  nassertr(wanted_size == (int)pb->_image.size(), false);
-#endif  // NDEBUG
-
-  set_unpack_alignment(1);
-
-#ifdef GSG_VERBOSE
-  crgsg_cat.debug()
-    << "crTexImage2D(GL_TEXTURE_2D, "
-    << (int)internal_format << ", "
-    << xsize << ", " << ysize << ", "
-    << pb->get_border() << ", " << (int)external_format << ", "
-    << (int)type << ", " << tex->get_name() << ")\n";
-#endif
-
-  if (!cr_ignore_mipmaps || cr_force_mipmaps) {
-    if (tex->uses_mipmaps() || cr_force_mipmaps) {
-#ifndef NDEBUG
-      if (cr_show_mipmaps) {
-        build_phony_mipmaps(tex);
-      } else 
-#endif
-        {
-          gluBuild2DMipmaps(GL_TEXTURE_2D, internal_format,
-                            xsize, ysize,
-                            external_format, type, image);
-#ifndef NDEBUG
-          if (cr_save_mipmaps) {
-            save_mipmap_images(tex);
-          }
-#endif
-        }
-      report_errors();
-
-      if (locally_allocated_image != (uchar *)NULL) {
-        delete[] locally_allocated_image;
-      }
-      return true;
-    }
-  }
-
-  nassertr(!pb->_image.empty(), false);
-  chromium.TexImage2D(GL_TEXTURE_2D, 0, internal_format,
-               xsize, ysize, pb->get_border(),
-               external_format, type, image);
-  report_errors();
-
-  if (locally_allocated_image != (uchar *)NULL) {
-    delete[] locally_allocated_image;
-  }
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_texture_wrap_mode
-//       Access: Protected
-//  Description: Maps from the Texture's internal wrap mode symbols to
-//               GL's.
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_texture_wrap_mode(Texture::WrapMode wm) {
-  switch (wm) {
-  case Texture::WM_clamp:
-    return GL_CLAMP;
-  case Texture::WM_repeat:
-    return GL_REPEAT;
-
-  case Texture::WM_mirror:
-  case Texture::WM_mirror_once:
-  case Texture::WM_border_color:
-    // These are unsupported for now.
-    return GL_REPEAT;
-
-  case Texture::WM_invalid:
-    break;
-  }
-  crgsg_cat.error() << "Invalid Texture::WrapMode value!\n";
-  return GL_CLAMP;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_texture_filter_type
-//       Access: Protected
-//  Description: Maps from the Texture's internal filter type symbols
-//               to GL's.
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_texture_filter_type(Texture::FilterType ft) {
-  if (cr_ignore_mipmaps) {
-    switch (ft) {
-    case Texture::FT_nearest_mipmap_nearest:
-    case Texture::FT_nearest:
-      return GL_NEAREST;
-    case Texture::FT_linear:
-    case Texture::FT_linear_mipmap_nearest:
-    case Texture::FT_nearest_mipmap_linear:
-    case Texture::FT_linear_mipmap_linear:
-      return GL_LINEAR;
-    case Texture::FT_invalid:
-      break;
-    }
-  } else {
-    switch (ft) {
-    case Texture::FT_nearest:
-      return GL_NEAREST;
-    case Texture::FT_linear:
-      return GL_LINEAR;
-    case Texture::FT_nearest_mipmap_nearest:
-      return GL_NEAREST_MIPMAP_NEAREST;
-    case Texture::FT_linear_mipmap_nearest:
-      return GL_LINEAR_MIPMAP_NEAREST;
-    case Texture::FT_nearest_mipmap_linear:
-      return GL_NEAREST_MIPMAP_LINEAR;
-    case Texture::FT_linear_mipmap_linear:
-      return GL_LINEAR_MIPMAP_LINEAR;
-    case Texture::FT_invalid:
-      break;
-    }
-  }
-  crgsg_cat.error() << "Invalid Texture::FilterType value!\n";
-  return GL_NEAREST;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_image_type
-//       Access: Protected
-//  Description: Maps from the PixelBuffer's internal Type symbols
-//               to GL's.
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_image_type(PixelBuffer::Type type) {
-  switch (type) {
-  case PixelBuffer::T_unsigned_byte:
-    return GL_UNSIGNED_BYTE;
-  case PixelBuffer::T_unsigned_short:
-    return GL_UNSIGNED_SHORT;
-#ifdef GL_UNSIGNED_BYTE_3_3_2_EXT
-  case PixelBuffer::T_unsigned_byte_332:
-    return GL_UNSIGNED_BYTE_3_3_2_EXT;
-#endif
-  case PixelBuffer::T_float:
-    return GL_FLOAT;
-
-  default:
-    crgsg_cat.error() << "Invalid PixelBuffer::Type value!\n";
-    return GL_UNSIGNED_BYTE;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_external_image_format
-//       Access: Protected
-//  Description: Maps from the PixelBuffer's Format symbols
-//               to GL's.
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_external_image_format(PixelBuffer::Format format) {
-  switch (format) {
-  case PixelBuffer::F_color_index:
-    return GL_COLOR_INDEX;
-  case PixelBuffer::F_stencil_index:
-    return GL_STENCIL_INDEX;
-  case PixelBuffer::F_depth_component:
-    return GL_DEPTH_COMPONENT;
-  case PixelBuffer::F_red:
-    return GL_RED;
-  case PixelBuffer::F_green:
-    return GL_GREEN;
-  case PixelBuffer::F_blue:
-    return GL_BLUE;
-  case PixelBuffer::F_alpha:
-    return GL_ALPHA;
-  case PixelBuffer::F_rgb:
-  case PixelBuffer::F_rgb5:
-  case PixelBuffer::F_rgb8:
-  case PixelBuffer::F_rgb12:
-  case PixelBuffer::F_rgb332:
-#ifdef GL_BGR
-    return cr_supports_bgr ? GL_BGR : GL_RGB;
-#else
-    return GL_RGB;
-#endif  // GL_BGR
-  case PixelBuffer::F_rgba:
-  case PixelBuffer::F_rgbm:
-  case PixelBuffer::F_rgba4:
-  case PixelBuffer::F_rgba5:
-  case PixelBuffer::F_rgba8:
-  case PixelBuffer::F_rgba12:
-#ifdef GL_BGR
-    return cr_supports_bgr ? GL_BGRA : GL_RGBA;
-#else
-    return GL_RGBA;
-#endif  // GL_BGR
-  case PixelBuffer::F_luminance:
-    return GL_LUMINANCE;
-  case PixelBuffer::F_luminance_alphamask:
-  case PixelBuffer::F_luminance_alpha:
-    return GL_LUMINANCE_ALPHA;
-  }
-  crgsg_cat.error()
-    << "Invalid PixelBuffer::Format value in get_external_image_format(): "
-    << (int)format << "\n";
-  return GL_RGB;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_internal_image_format
-//       Access: Protected
-//  Description: Maps from the PixelBuffer's Format symbols to a
-//               suitable internal format for GL textures.
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_internal_image_format(PixelBuffer::Format format) {
-  switch (format) {
-  case PixelBuffer::F_rgba:
-  case PixelBuffer::F_rgbm:
-    return GL_RGBA;
-  case PixelBuffer::F_rgba4:
-    return GL_RGBA4;
-  case PixelBuffer::F_rgba8:
-    return GL_RGBA8;
-  case PixelBuffer::F_rgba12:
-    return GL_RGBA12;
-
-  case PixelBuffer::F_rgb:
-    return GL_RGB;
-  case PixelBuffer::F_rgb5:
-    return GL_RGB5;
-  case PixelBuffer::F_rgba5:
-    return GL_RGB5_A1;
-  case PixelBuffer::F_rgb8:
-    return GL_RGB8;
-  case PixelBuffer::F_rgb12:
-    return GL_RGB12;
-  case PixelBuffer::F_rgb332:
-    return GL_R3_G3_B2;
-
-  case PixelBuffer::F_alpha:
-    return GL_ALPHA;
-
-  case PixelBuffer::F_red:
-  case PixelBuffer::F_green:
-  case PixelBuffer::F_blue:
-  case PixelBuffer::F_luminance:
-    return GL_LUMINANCE;
-  case PixelBuffer::F_luminance_alpha:
-  case PixelBuffer::F_luminance_alphamask:
-    return GL_LUMINANCE_ALPHA;
-
-  default:
-    crgsg_cat.error()
-      << "Invalid image format in get_internal_image_format(): "
-      << (int)format << "\n";
-    return GL_RGB;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_texture_apply_mode_type
-//       Access: Protected
-//  Description: Maps from the texture environment's mode types
-//       to the corresponding OpenGL ids
-////////////////////////////////////////////////////////////////////
-GLint CRGraphicsStateGuardian::
-get_texture_apply_mode_type(TextureApplyAttrib::Mode am) const {
-  switch (am) {
-  case TextureApplyAttrib::M_modulate: return GL_MODULATE;
-  case TextureApplyAttrib::M_decal: return GL_DECAL;
-  case TextureApplyAttrib::M_blend: return GL_BLEND;
-  case TextureApplyAttrib::M_replace: return GL_REPLACE;
-  case TextureApplyAttrib::M_add: return GL_ADD;
-  }
-  crgsg_cat.error()
-    << "Invalid TextureApplyAttrib::Mode value" << endl;
-  return GL_MODULATE;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::get_depth_func_type
-//       Access: Protected
-//  Description: Maps from the depth func modes to gl version
-////////////////////////////////////////////////////////////////////
-GLenum CRGraphicsStateGuardian::
-get_depth_func_type(DepthTestAttrib::Mode m) const
-{
-  switch(m) {
-  case DepthTestAttrib::M_never: return GL_NEVER;
-  case DepthTestAttrib::M_less: return GL_LESS;
-  case DepthTestAttrib::M_equal: return GL_EQUAL;
-  case DepthTestAttrib::M_less_equal: return GL_LEQUAL;
-  case DepthTestAttrib::M_greater: return GL_GREATER;
-  case DepthTestAttrib::M_not_equal: return GL_NOTEQUAL;
-  case DepthTestAttrib::M_greater_equal: return GL_GEQUAL;
-  case DepthTestAttrib::M_always: return GL_ALWAYS;
-
-  default:
-    crgsg_cat.error()
-      << "Invalid DepthTestAttrib::Mode value" << endl;
-    return GL_LESS;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::print_gfx_visual
-//       Access: Public
-//  Description: Prints a description of the current visual selected.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-print_gfx_visual() {
-  GLint i;
-  GLboolean j;
-  //  activate();
-
-  cout << "Graphics Visual Info (# bits of each):" << endl;
-
-  cout << "RGBA: ";
-  chromium.GetIntegerv( GL_RED_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_GREEN_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_BLUE_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_ALPHA_BITS, &i ); cout << i << endl;
-
-  cout << "Accum RGBA: ";
-  chromium.GetIntegerv( GL_ACCUM_RED_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_ACCUM_GREEN_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_ACCUM_BLUE_BITS, &i ); cout << i << " ";
-  chromium.GetIntegerv( GL_ACCUM_ALPHA_BITS, &i ); cout << i << endl;
-
-  chromium.GetIntegerv( GL_INDEX_BITS, &i ); cout << "Color Index: " << i << endl;
-
-  chromium.GetIntegerv( GL_DEPTH_BITS, &i ); cout << "Depth: " << i << endl;
-  chromium.GetIntegerv( GL_ALPHA_BITS, &i ); cout << "Alpha: " << i << endl;
-  chromium.GetIntegerv( GL_STENCIL_BITS, &i ); cout << "Stencil: " << i << endl;
-
-  chromium.GetBooleanv( GL_DOUBLEBUFFER, &j ); cout << "DoubleBuffer? "
-                                             << (int)j << endl;
-
-  chromium.GetBooleanv( GL_STEREO, &j ); cout << "Stereo? " << (int)j << endl;
-
-#ifdef GL_MULTISAMPLE_SGIS
-  chromium.GetBooleanv( GL_MULTISAMPLE_SGIS, &j ); cout << "Multisample? "
-                                                 << (int)j << endl;
-#endif
-#ifdef GL_SAMPLES_SGIS
-  chromium.GetIntegerv( GL_SAMPLES_SGIS, &i ); cout << "Samples: " << i << endl;
-#endif
-
-  chromium.GetBooleanv( GL_BLEND, &j ); cout << "Blend? " << (int)j << endl;
-  chromium.GetBooleanv( GL_POINT_SMOOTH, &j ); cout << "Point Smooth? "
-                                             << (int)j << endl;
-  chromium.GetBooleanv( GL_LINE_SMOOTH, &j ); cout << "Line Smooth? "
-                                            << (int)j << endl;
-
-  chromium.GetIntegerv( GL_AUX_BUFFERS, &i ); cout << "Aux Buffers: " << i << endl;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::issue_transformed_color
-//       Access: Public
-//  Description: Transform the color by the current color matrix, and
-//               calls the appropriate chromium.Color function.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-issue_transformed_color(const Colorf &color) const {
-  // To be truly general, we really need a 5x5 matrix to transform a
-  // 4-component color.  Rather than messing with that, we instead
-  // treat the color as a 3-component RGB, which can be transformed by
-  // the ordinary 4x4 matrix, and a separate alpha value, which can be
-  // scaled and offsetted.
-  LPoint3f temp(color[0], color[1], color[2]);
-  temp = temp * get_current_color_mat();
-  float alpha = (color[3] * get_current_alpha_scale()) +
-    get_current_alpha_offset();
-
-  Colorf transformed(temp[0], temp[1], temp[2], alpha);
-
-  //   crgsg_cat.debug() << "Issuing color " << transformed << "\n";
-  //   crgsg_cat.debug() << "\tTransformed by " << get_current_color_mat() << "\n";
-  //   crgsg_cat.debug() << "\tAlpha Transformed by " << get_current_alpha_offset() << " "
-  //                     << get_current_alpha_scale() << "\n";
-  chromium.Color4fv(transformed.get_data());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_lighting
-//       Access: Protected, Virtual
-//  Description: Intended to be overridden by a derived class to
-//               enable or disable the use of lighting overall.  This
-//               is called by issue_light() according to whether any
-//               lights are in use or not.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-enable_lighting(bool enable) {
-  if (enable) {
-    chromium.Enable(GL_LIGHTING);
-  } else {
-    chromium.Disable(GL_LIGHTING);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_ambient_light
-//       Access: Protected, Virtual
-//  Description: Intended to be overridden by a derived class to
-//               indicate the color of the ambient light that should
-//               be in effect.  This is called by issue_light() after
-//               all other lights have been enabled or disabled.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-set_ambient_light(const Colorf &color) {
-  chromium.LightModelfv(GL_LIGHT_MODEL_AMBIENT, color.get_data());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::enable_light
-//       Access: Protected, Virtual
-//  Description: Intended to be overridden by a derived class to
-//               enable the indicated light id.  A specific Light will
-//               already have been bound to this id via bind_light().
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-enable_light(int light_id, bool enable) {
-  if (enable) {
-    chromium.Enable(get_light_id(light_id));
-  } else {
-    chromium.Disable(get_light_id(light_id));
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::begin_bind_lights
-//       Access: Protected, Virtual
-//  Description: Called immediately before bind_light() is called,
-//               this is intended to provide the derived class a hook
-//               in which to set up some state (like transform) that
-//               might apply to several lights.
-//
-//               The sequence is: begin_bind_lights() will be called,
-//               then one or more bind_light() calls, then
-//               end_bind_lights().
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-begin_bind_lights() {
-  // We need to temporarily load a new matrix so we can define the
-  // light in a known coordinate system.  We pick the transform of the
-  // root.  (Alternatively, we could leave the current transform where
-  // it is and compute the light position relative to that transform
-  // instead of relative to the root, by composing with the matrix
-  // computed by _transform->invert_compose(render_transform).  But I
-  // think loading a completely new matrix is simpler.)
-  chromium.MatrixMode(GL_MODELVIEW);
-  chromium.PushMatrix();
-  chromium.LoadMatrixf(_scene_setup->get_render_transform()->get_mat().get_data());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::end_bind_lights
-//       Access: Protected, Virtual
-//  Description: Called after before bind_light() has been called one
-//               or more times (but before any geometry is issued or
-//               additional state is changed), this is intended to
-//               clean up any temporary changes to the state that may
-//               have been made by begin_bind_lights().
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-end_bind_lights() {
-  chromium.MatrixMode(GL_MODELVIEW);
-  chromium.PopMatrix();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::set_blend_mode
-//       Access: Protected, Virtual
-//  Description: Called after any of these three blending states have
-//               changed; this function is responsible for setting the
-//               appropriate color blending mode based on the given
-//               properties.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-set_blend_mode(ColorWriteAttrib::Mode color_write_mode,
-               ColorBlendAttrib::Mode color_blend_mode,
-               TransparencyAttrib::Mode transparency_mode) {
-  // If color_write_mode is off, we disable writing to the color using
-  // blending.  This case is only used if we can't use chromium.ColorMask to
-  // disable the color writing for some reason (usually a driver
-  // problem).
-  if (color_write_mode == ColorWriteAttrib::M_off) {
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(true);
-    enable_alpha_test(false);
-    call_glBlendFunc(GL_ZERO, GL_ONE);
-    return;
-  }
-
-  // Is there a color blend set?
-  switch (color_blend_mode) {
-  case ColorBlendAttrib::M_none:
-    break;
-
-  case ColorBlendAttrib::M_multiply:
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(true);
-    enable_alpha_test(false);
-    call_glBlendFunc(GL_DST_COLOR, GL_ZERO);
-    return;
-
-  case ColorBlendAttrib::M_add:
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(true);
-    enable_alpha_test(false);
-    call_glBlendFunc(GL_ONE, GL_ONE);
-    return;
-
-  case ColorBlendAttrib::M_multiply_add:
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(true);
-    enable_alpha_test(false);
-    call_glBlendFunc(GL_DST_COLOR, GL_ONE);
-    return;
-
-  default:
-    crgsg_cat.error()
-      << "Unknown color blend mode " << (int)color_blend_mode << endl;
-    break;
-  }
-
-  // No color blend; is there a transparency set?
-  switch (transparency_mode) {
-  case TransparencyAttrib::M_none:
-    break;
-
-  case TransparencyAttrib::M_alpha:
-  case TransparencyAttrib::M_alpha_sorted:
-    // Should we really have an "alpha" and an "alpha_sorted" mode,
-    // like Performer does?  (The difference is that "alpha" is with
-    // the write to the depth buffer disabled.)  Or should we just use
-    // the separate depth write transition to control this?  Doing it
-    // implicitly requires a bit more logic here and in the state
-    // management; for now we require the user to explicitly turn off
-    // the depth write.
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(true);
-    enable_alpha_test(false);
-    call_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    return;
-
-  case TransparencyAttrib::M_multisample:
-    enable_multisample_alpha_one(true);
-    enable_multisample_alpha_mask(true);
-    enable_blend(false);
-    enable_alpha_test(false);
-    return;
-
-  case TransparencyAttrib::M_multisample_mask:
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(true);
-    enable_blend(false);
-    enable_alpha_test(false);
-    return;
-
-  case TransparencyAttrib::M_binary:
-    enable_multisample_alpha_one(false);
-    enable_multisample_alpha_mask(false);
-    enable_blend(false);
-    enable_alpha_test(true);
-    call_glAlphaFunc(GL_EQUAL, 1);
-    return;
-
-  default:
-    crgsg_cat.error()
-      << "invalid transparency mode " << (int)transparency_mode << endl;
-    break;
-  }
-
-  // Nothing's set, so disable blending.
-  enable_multisample_alpha_one(false);
-  enable_multisample_alpha_mask(false);
-  enable_blend(false);
-  enable_alpha_test(false);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::free_pointers
-//       Access: Protected
-//  Description: Frees some memory that was explicitly allocated
-//               within the crgsg.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-free_pointers() {
-  if (_clip_plane_enabled != (bool *)NULL) {
-    delete[] _clip_plane_enabled;
-    _clip_plane_enabled = (bool *)NULL;
-  }
-  if (_cur_clip_plane_enabled != (bool *)NULL) {
-    delete[] _cur_clip_plane_enabled;
-    _cur_clip_plane_enabled = (bool *)NULL;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::save_frame_buffer
-//       Access: Public
-//  Description: Saves the indicated planes of the frame buffer
-//               (within the indicated display region) and returns it
-//               in some meaningful form that can be restored later
-//               via restore_frame_buffer().  This is a helper
-//               function for push_frame_buffer() and
-//               pop_frame_buffer().
-////////////////////////////////////////////////////////////////////
-PT(SavedFrameBuffer) CRGraphicsStateGuardian::
-save_frame_buffer(const RenderBuffer &buffer,
-                  CPT(DisplayRegion) dr) {
-  CRSavedFrameBuffer *sfb = new CRSavedFrameBuffer(buffer, dr);
-
-  if (buffer._buffer_type & RenderBuffer::T_depth) {
-    // Save the depth buffer.
-    sfb->_depth =
-      new PixelBuffer(PixelBuffer::depth_buffer(dr->get_pixel_width(),
-                                                dr->get_pixel_height()));
-    copy_pixel_buffer(sfb->_depth, dr, buffer);
-  }
-
-  if (buffer._buffer_type & RenderBuffer::T_back) {
-    // Save the color buffer.
-    sfb->_back_rgba = new Texture;
-    copy_texture(sfb->_back_rgba->prepare(this), dr, buffer);
-  }
-
-  return sfb;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::restore_frame_buffer
-//       Access: Public
-//  Description: Restores the frame buffer that was previously saved.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-restore_frame_buffer(SavedFrameBuffer *frame_buffer) {
-  CRSavedFrameBuffer *sfb = DCAST(CRSavedFrameBuffer, frame_buffer);
-
-  if (sfb->_back_rgba != (Texture *)NULL &&
-      (sfb->_buffer._buffer_type & RenderBuffer::T_back) != 0) {
-    // Restore the color buffer.
-    draw_texture(sfb->_back_rgba->prepare(this),
-                 sfb->_display_region, sfb->_buffer);
-  }
-
-  if (sfb->_depth != (PixelBuffer *)NULL &&
-      (sfb->_buffer._buffer_type & RenderBuffer::T_depth) != 0) {
-    // Restore the depth buffer.
-    draw_pixel_buffer(sfb->_depth, sfb->_display_region, sfb->_buffer);
-  }
-}
-
-#ifndef NDEBUG
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::build_phony_mipmaps
-//       Access: Protected
-//  Description: Generates a series of colored mipmap levels to aid in
-//               visualizing the mipmap levels as the hardware applies
-//               them.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-build_phony_mipmaps(Texture *tex) {
-  PixelBuffer *pb = tex->_pbuffer;
-  int xsize = pb->get_xsize();
-  int ysize = pb->get_ysize();
-
-  crgsg_cat.info()
-    << "Building phony mipmap levels for " << tex->get_name() << "\n";
-  int level = 0;
-  while (xsize > 0 && ysize > 0) {
-    crgsg_cat.info(false)
-      << "  level " << level << " is " << xsize << " by " << ysize << "\n";
-    build_phony_mipmap_level(level, xsize, ysize);
-
-    xsize >>= 1;
-    ysize >>= 1;
-    level++;
-  }
-
-  while (xsize > 0) {
-    crgsg_cat.info(false)
-      << "  level " << level << " is " << xsize << " by 1\n";
-    build_phony_mipmap_level(level, xsize, 1);
-
-    xsize >>= 1;
-    level++;
-  }
-
-  while (ysize > 0) {
-    crgsg_cat.info(false)
-      << "  level " << level << " is 1 by " << ysize << "\n";
-    build_phony_mipmap_level(level, 1, ysize);
-
-    ysize >>= 1;
-    level++;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::build_phony_mipmap_level
-//       Access: Protected
-//  Description: Generates a single colored mipmap level.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-build_phony_mipmap_level(int level, int xsize, int ysize) {
-  static const int num_levels = 10;
-  static const char *level_filenames[num_levels] = {
-    "mipmap_level_0.rgb",
-    "mipmap_level_1.rgb",
-    "mipmap_level_2.rgb",
-    "mipmap_level_3.rgb",
-    "mipmap_level_4.rgb",
-    "mipmap_level_5.rgb",
-    "mipmap_level_6.rgb",
-    "mipmap_level_7.rgb",
-    "mipmap_level_8.rgb",
-    "mipmap_level_9.rgb"
-  };
-  static const RGBColorf level_colors[num_levels] = {
-    RGBColorf(1.0f, 1.0f, 1.0f),
-    RGBColorf(1.0f, 0.0f, 0.0f),
-    RGBColorf(0.0f, 1.0f, 0.0f),
-    RGBColorf(0.0f, 0.0f, 1.0f),
-    RGBColorf(1.0f, 1.0f, 0.0f),
-    RGBColorf(0.0f, 1.0f, 1.0f),
-    RGBColorf(1.0f, 0.0f, 1.0f),
-    RGBColorf(1.0f, 0.5, 0.0f),
-    RGBColorf(0.0f, 1.0f, 0.5),
-    RGBColorf(0.83, 0.71, 1.0f)
-  };
-
-  level = level % num_levels;
-  Filename filename(level_filenames[level]);
-
-  PNMImage image_sized(xsize, ysize);
-  PNMImage image_source;
-  if (filename.resolve_filename(get_texture_path()) ||
-      filename.resolve_filename(get_model_path())) {
-    image_source.read(filename);
-  }
-
-  if (image_source.is_valid()) {
-    image_sized.quick_filter_from(image_source);
-
-  } else {
-    crgsg_cat.info(false)
-      << "    " << filename << " cannot be read, making solid color mipmap.\n";
-    image_sized.fill(level_colors[level][0],
-                     level_colors[level][1],
-                     level_colors[level][2]);
-  }
-
-  PixelBuffer *pb = new PixelBuffer;
-  pb->load(image_sized);
-
-  GLenum internal_format = get_internal_image_format(pb->get_format());
-  GLenum external_format = get_external_image_format(pb->get_format());
-  GLenum type = get_image_type(pb->get_image_type());
-
-  chromium.TexImage2D(GL_TEXTURE_2D, level, internal_format,
-               pb->get_xsize(), pb->get_ysize(), pb->get_border(),
-               external_format, type, pb->_image );
-
-  delete pb;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRGraphicsStateGuardian::save_mipmap_images
-//       Access: Protected
-//  Description: Saves out each mipmap level of the indicated texture
-//               (which must also be the currently active texture in
-//               the GL state) as a separate image file to disk.
-////////////////////////////////////////////////////////////////////
-void CRGraphicsStateGuardian::
-save_mipmap_images(Texture *tex) {
-  Filename filename = tex->get_name();
-  string name;
-  if (filename.empty()) {
-    static int index = 0;
-    name = "texture" + format_string(index);
-    index++;
-  } else {
-    name = filename.get_basename_wo_extension();
-  }
-
-  PixelBuffer *pb = tex->get_ram_image();
-  nassertv(pb != (PixelBuffer *)NULL);
-
-  GLenum external_format = get_external_image_format(pb->get_format());
-  GLenum type = get_image_type(pb->get_image_type());
-
-  int xsize = pb->get_xsize();
-  int ysize = pb->get_ysize();
-
-  // Specify byte-alignment for the pixels on output.
-  set_pack_alignment(1);
-
-  int mipmap_level = 0;
-  do {
-    xsize = max(xsize, 1);
-    ysize = max(ysize, 1);
-
-    PT(PixelBuffer) mpb = 
-      new PixelBuffer(xsize, ysize, pb->get_num_components(),
-                      pb->get_component_width(), pb->get_image_type(),
-                      pb->get_format());
-    chromium.GetTexImage(GL_TEXTURE_2D, mipmap_level, external_format, 
-                  type, mpb->_image);
-    Filename mipmap_filename = name + "_" + format_string(mipmap_level) + ".rgb";
-    nout << "Writing mipmap level " << mipmap_level
-         << " (" << xsize << " by " << ysize << ") " 
-         << mipmap_filename << "\n";
-    mpb->write(mipmap_filename);
-
-    xsize >>= 1;
-    ysize >>= 1;
-    mipmap_level++;
-  } while (xsize > 0 && ysize > 0);
-}
-#endif  // NDEBUG
-
-// factory and type stuff
-
-GraphicsStateGuardian *CRGraphicsStateGuardian::
-make_GlGraphicsStateGuardian(const FactoryParams &params) {
-  GraphicsStateGuardian::GsgWindow *win_param;
-  if (!get_param_into(win_param, params)) {
-    crgsg_cat.error()
-      << "No window specified for gsg creation!" << endl;
-    return NULL;
-  }
-
-  GraphicsWindow *win = win_param->get_window();
-  return new CRGraphicsStateGuardian(win);
-}
-
-TypeHandle CRGraphicsStateGuardian::get_type(void) const {
-  return get_class_type();
-}
-
-TypeHandle CRGraphicsStateGuardian::get_class_type(void) {
-  return _type_handle;
-}
-
-void CRGraphicsStateGuardian::init_type(void) {
-  GraphicsStateGuardian::init_type();
-  register_type(_type_handle, "CRGraphicsStateGuardian",
-                GraphicsStateGuardian::get_class_type());
-}
-
-
-#ifdef GSG_VERBOSE
-
-void CRGraphicsStateGuardian::
-dump_state(void)
-{
-  if (crgsg_cat.is_debug())
-    {
-      int i;
-      ostream &dump = crgsg_cat.debug(false);
-      crgsg_cat.debug() << "Dumping GL State" << endl;
-
-      dump << "\t\t" << "GL_LINE_SMOOTH " << _line_smooth_enabled << " " << (bool)chromium.IsEnabled(GL_LINE_SMOOTH) << "\n";
-      dump << "\t\t" << "GL_POINT_SMOOTH " << _point_smooth_enabled << " " << (bool)chromium.IsEnabled(GL_POINT_SMOOTH) << "\n";
-      dump << "\t\t" << "GL_LIGHTING " << _lighting_enabled << " " << (bool)chromium.IsEnabled(GL_LIGHTING) << "\n";
-      dump << "\t\t" << "GL_SCISSOR_TEST " << _scissor_enabled << " " << (bool)chromium.IsEnabled(GL_SCISSOR_TEST) << "\n";
-      dump << "\t\t" << "GL_TEXTURE_2D " << _texturing_enabled << " " << (bool)chromium.IsEnabled(GL_TEXTURE_2D) << "\n";
-      dump << "\t\t" << "GL_DITHER " << _dither_enabled << " " << (bool)chromium.IsEnabled(GL_DITHER) << "\n";
-      dump << "\t\t" << "GL_STENCIL_TEST " << " " << (bool)chromium.IsEnabled(GL_STENCIL_TEST) << "\n";
-      for(i = 0; i < _max_clip_planes; i++)
-        {
-          dump << "\t\t\t\t" << "GL_CLIP_PLANE" << i << " " << _clip_plane_enabled[i] << " " << (bool)chromium.IsEnabled(GL_CLIP_PLANE0+i) << "\n";
-        }
-      dump << "\t\t" << "GL_BLEND " << _blend_enabled << " " << (bool)chromium.IsEnabled(GL_BLEND) << "\n";
-      dump << "\t\t" << "GL_DEPTH_TEST " << _depth_test_enabled << " " << (bool)chromium.IsEnabled(GL_DEPTH_TEST) << "\n";
-      dump << "\t\t" << "GL_FOG " << _fog_enabled << " " << (bool)chromium.IsEnabled(GL_FOG) << "\n";
-      dump << "\t\t" << "GL_ALPHA_TEST " << _alpha_test_enabled << " " << (bool)chromium.IsEnabled(GL_ALPHA_TEST) << "\n";
-      dump << "\t\t" << "GL_POLYGON_OFFSET_FILL " << _polygon_offset_enabled << " " << (bool)chromium.IsEnabled(GL_POLYGON_OFFSET_FILL) << "\n";
-
-      dump << endl;
-    }
-}
-
-#else  // GSG_VERBOSE
-
-// This function does nothing unless GSG_VERBOSE is compiled in.
-void CRGraphicsStateGuardian::
-dump_state(void)
-{
-}
-
-#endif  // GSG_VERBOSE
-
-
-#ifdef GSG_VERBOSE
-
-// This is a handy function to output a GLenum value as a string, for
-// debugging.
-ostream &output_cr_enum(ostream &out, GLenum v) {
-  switch (v) {
-  case GL_FALSE:
-    return out << "GL_FALSE";
-  case GL_TRUE:
-    return out << "GL_TRUE";
-
-    /* Data types */
-  case GL_BYTE:
-    return out << "GL_BYTE";
-  case GL_UNSIGNED_BYTE:
-    return out << "GL_UNSIGNED_BYTE";
-  case GL_SHORT:
-    return out << "GL_SHORT";
-  case GL_UNSIGNED_SHORT:
-    return out << "GL_UNSIGNED_SHORT";
-  case GL_INT:
-    return out << "GL_INT";
-  case GL_UNSIGNED_INT:
-    return out << "GL_UNSIGNED_INT";
-  case GL_FLOAT:
-    return out << "GL_FLOAT";
-  case GL_DOUBLE:
-    return out << "GL_DOUBLE";
-  case GL_2_BYTES:
-    return out << "GL_2_BYTES";
-  case GL_3_BYTES:
-    return out << "GL_3_BYTES";
-  case GL_4_BYTES:
-    return out << "GL_4_BYTES";
-
-    /* Primitives */
-    /*
-      case GL_LINES:
-      return out << "GL_LINES";
-      case GL_POINTS:
-      return out << "GL_POINTS";
-    */
-  case GL_LINE_STRIP:
-    return out << "GL_LINE_STRIP";
-  case GL_LINE_LOOP:
-    return out << "GL_LINE_LOOP";
-  case GL_TRIANGLES:
-    return out << "GL_TRIANGLES";
-  case GL_TRIANGLE_STRIP:
-    return out << "GL_TRIANGLE_STRIP";
-  case GL_TRIANGLE_FAN:
-    return out << "GL_TRIANGLE_FAN";
-  case GL_QUADS:
-    return out << "GL_QUADS";
-  case GL_QUAD_STRIP:
-    return out << "GL_QUAD_STRIP";
-  case GL_POLYGON:
-    return out << "GL_POLYGON";
-  case GL_EDGE_FLAG:
-    return out << "GL_EDGE_FLAG";
-
-    /* Vertex Arrays */
-  case GL_VERTEX_ARRAY:
-    return out << "GL_VERTEX_ARRAY";
-  case GL_NORMAL_ARRAY:
-    return out << "GL_NORMAL_ARRAY";
-  case GL_COLOR_ARRAY:
-    return out << "GL_COLOR_ARRAY";
-  case GL_INDEX_ARRAY:
-    return out << "GL_INDEX_ARRAY";
-  case GL_TEXTURE_COORD_ARRAY:
-    return out << "GL_TEXTURE_COORD_ARRAY";
-  case GL_EDGE_FLAG_ARRAY:
-    return out << "GL_EDGE_FLAG_ARRAY";
-  case GL_VERTEX_ARRAY_SIZE:
-    return out << "GL_VERTEX_ARRAY_SIZE";
-  case GL_VERTEX_ARRAY_TYPE:
-    return out << "GL_VERTEX_ARRAY_TYPE";
-  case GL_VERTEX_ARRAY_STRIDE:
-    return out << "GL_VERTEX_ARRAY_STRIDE";
-  case GL_NORMAL_ARRAY_TYPE:
-    return out << "GL_NORMAL_ARRAY_TYPE";
-  case GL_NORMAL_ARRAY_STRIDE:
-    return out << "GL_NORMAL_ARRAY_STRIDE";
-  case GL_COLOR_ARRAY_SIZE:
-    return out << "GL_COLOR_ARRAY_SIZE";
-  case GL_COLOR_ARRAY_TYPE:
-    return out << "GL_COLOR_ARRAY_TYPE";
-  case GL_COLOR_ARRAY_STRIDE:
-    return out << "GL_COLOR_ARRAY_STRIDE";
-  case GL_INDEX_ARRAY_TYPE:
-    return out << "GL_INDEX_ARRAY_TYPE";
-  case GL_INDEX_ARRAY_STRIDE:
-    return out << "GL_INDEX_ARRAY_STRIDE";
-  case GL_TEXTURE_COORD_ARRAY_SIZE:
-    return out << "GL_TEXTURE_COORD_ARRAY_SIZE";
-  case GL_TEXTURE_COORD_ARRAY_TYPE:
-    return out << "GL_TEXTURE_COORD_ARRAY_TYPE";
-  case GL_TEXTURE_COORD_ARRAY_STRIDE:
-    return out << "GL_TEXTURE_COORD_ARRAY_STRIDE";
-  case GL_EDGE_FLAG_ARRAY_STRIDE:
-    return out << "GL_EDGE_FLAG_ARRAY_STRIDE";
-  case GL_VERTEX_ARRAY_POINTER:
-    return out << "GL_VERTEX_ARRAY_POINTER";
-  case GL_NORMAL_ARRAY_POINTER:
-    return out << "GL_NORMAL_ARRAY_POINTER";
-  case GL_COLOR_ARRAY_POINTER:
-    return out << "GL_COLOR_ARRAY_POINTER";
-  case GL_INDEX_ARRAY_POINTER:
-    return out << "GL_INDEX_ARRAY_POINTER";
-  case GL_TEXTURE_COORD_ARRAY_POINTER:
-    return out << "GL_TEXTURE_COORD_ARRAY_POINTER";
-  case GL_EDGE_FLAG_ARRAY_POINTER:
-    return out << "GL_EDGE_FLAG_ARRAY_POINTER";
-  case GL_V2F:
-    return out << "GL_V2F";
-  case GL_V3F:
-    return out << "GL_V3F";
-  case GL_C4UB_V2F:
-    return out << "GL_C4UB_V2F";
-  case GL_C4UB_V3F:
-    return out << "GL_C4UB_V3F";
-  case GL_C3F_V3F:
-    return out << "GL_C3F_V3F";
-  case GL_N3F_V3F:
-    return out << "GL_N3F_V3F";
-  case GL_C4F_N3F_V3F:
-    return out << "GL_C4F_N3F_V3F";
-  case GL_T2F_V3F:
-    return out << "GL_T2F_V3F";
-  case GL_T4F_V4F:
-    return out << "GL_T4F_V4F";
-  case GL_T2F_C4UB_V3F:
-    return out << "GL_T2F_C4UB_V3F";
-  case GL_T2F_C3F_V3F:
-    return out << "GL_T2F_C3F_V3F";
-  case GL_T2F_N3F_V3F:
-    return out << "GL_T2F_N3F_V3F";
-  case GL_T2F_C4F_N3F_V3F:
-    return out << "GL_T2F_C4F_N3F_V3F";
-  case GL_T4F_C4F_N3F_V4F:
-    return out << "GL_T4F_C4F_N3F_V4F";
-
-    /* Matrix Mode */
-  case GL_MATRIX_MODE:
-    return out << "GL_MATRIX_MODE";
-  case GL_MODELVIEW:
-    return out << "GL_MODELVIEW";
-  case GL_PROJECTION:
-    return out << "GL_PROJECTION";
-  case GL_TEXTURE:
-    return out << "GL_TEXTURE";
-
-    /* Points */
-  case GL_POINT_SMOOTH:
-    return out << "GL_POINT_SMOOTH";
-  case GL_POINT_SIZE:
-    return out << "GL_POINT_SIZE";
-  case GL_POINT_SIZE_GRANULARITY:
-    return out << "GL_POINT_SIZE_GRANULARITY";
-  case GL_POINT_SIZE_RANGE:
-    return out << "GL_POINT_SIZE_RANGE";
-
-    /* Lines */
-  case GL_LINE_SMOOTH:
-    return out << "GL_LINE_SMOOTH";
-  case GL_LINE_STIPPLE:
-    return out << "GL_LINE_STIPPLE";
-  case GL_LINE_STIPPLE_PATTERN:
-    return out << "GL_LINE_STIPPLE_PATTERN";
-  case GL_LINE_STIPPLE_REPEAT:
-    return out << "GL_LINE_STIPPLE_REPEAT";
-  case GL_LINE_WIDTH:
-    return out << "GL_LINE_WIDTH";
-  case GL_LINE_WIDTH_GRANULARITY:
-    return out << "GL_LINE_WIDTH_GRANULARITY";
-  case GL_LINE_WIDTH_RANGE:
-    return out << "GL_LINE_WIDTH_RANGE";
-
-    /* Polygons */
-  case GL_POINT:
-    return out << "GL_POINT";
-  case GL_LINE:
-    return out << "GL_LINE";
-  case GL_FILL:
-    return out << "GL_FILL";
-  case GL_CCW:
-    return out << "GL_CCW";
-  case GL_CW:
-    return out << "GL_CW";
-  case GL_FRONT:
-    return out << "GL_FRONT";
-  case GL_BACK:
-    return out << "GL_BACK";
-  case GL_CULL_FACE:
-    return out << "GL_CULL_FACE";
-  case GL_CULL_FACE_MODE:
-    return out << "GL_CULL_FACE_MODE";
-  case GL_POLYGON_SMOOTH:
-    return out << "GL_POLYGON_SMOOTH";
-  case GL_POLYGON_STIPPLE:
-    return out << "GL_POLYGON_STIPPLE";
-  case GL_FRONT_FACE:
-    return out << "GL_FRONT_FACE";
-  case GL_POLYGON_MODE:
-    return out << "GL_POLYGON_MODE";
-  case GL_POLYGON_OFFSET_FACTOR:
-    return out << "GL_POLYGON_OFFSET_FACTOR";
-  case GL_POLYGON_OFFSET_UNITS:
-    return out << "GL_POLYGON_OFFSET_UNITS";
-  case GL_POLYGON_OFFSET_POINT:
-    return out << "GL_POLYGON_OFFSET_POINT";
-  case GL_POLYGON_OFFSET_LINE:
-    return out << "GL_POLYGON_OFFSET_LINE";
-  case GL_POLYGON_OFFSET_FILL:
-    return out << "GL_POLYGON_OFFSET_FILL";
-
-    /* Display Lists */
-  case GL_COMPILE:
-    return out << "GL_COMPILE";
-  case GL_COMPILE_AND_EXECUTE:
-    return out << "GL_COMPILE_AND_EXECUTE";
-  case GL_LIST_BASE:
-    return out << "GL_LIST_BASE";
-  case GL_LIST_INDEX:
-    return out << "GL_LIST_INDEX";
-  case GL_LIST_MODE:
-    return out << "GL_LIST_MODE";
-
-    /* Depth buffer */
-  case GL_NEVER:
-    return out << "GL_NEVER";
-  case GL_LESS:
-    return out << "GL_LESS";
-  case GL_GEQUAL:
-    return out << "GL_GEQUAL";
-  case GL_LEQUAL:
-    return out << "GL_LEQUAL";
-  case GL_GREATER:
-    return out << "GL_GREATER";
-  case GL_NOTEQUAL:
-    return out << "GL_NOTEQUAL";
-  case GL_EQUAL:
-    return out << "GL_EQUAL";
-  case GL_ALWAYS:
-    return out << "GL_ALWAYS";
-  case GL_DEPTH_TEST:
-    return out << "GL_DEPTH_TEST";
-  case GL_DEPTH_BITS:
-    return out << "GL_DEPTH_BITS";
-  case GL_DEPTH_CLEAR_VALUE:
-    return out << "GL_DEPTH_CLEAR_VALUE";
-  case GL_DEPTH_FUNC:
-    return out << "GL_DEPTH_FUNC";
-  case GL_DEPTH_RANGE:
-    return out << "GL_DEPTH_RANGE";
-  case GL_DEPTH_WRITEMASK:
-    return out << "GL_DEPTH_WRITEMASK";
-  case GL_DEPTH_COMPONENT:
-    return out << "GL_DEPTH_COMPONENT";
-
-    /* Lighting */
-  case GL_LIGHTING:
-    return out << "GL_LIGHTING";
-  case GL_LIGHT0:
-    return out << "GL_LIGHT0";
-  case GL_LIGHT1:
-    return out << "GL_LIGHT1";
-  case GL_LIGHT2:
-    return out << "GL_LIGHT2";
-  case GL_LIGHT3:
-    return out << "GL_LIGHT3";
-  case GL_LIGHT4:
-    return out << "GL_LIGHT4";
-  case GL_LIGHT5:
-    return out << "GL_LIGHT5";
-  case GL_LIGHT6:
-    return out << "GL_LIGHT6";
-  case GL_LIGHT7:
-    return out << "GL_LIGHT7";
-  case GL_SPOT_EXPONENT:
-    return out << "GL_SPOT_EXPONENT";
-  case GL_SPOT_CUTOFF:
-    return out << "GL_SPOT_CUTOFF";
-  case GL_CONSTANT_ATTENUATION:
-    return out << "GL_CONSTANT_ATTENUATION";
-  case GL_LINEAR_ATTENUATION:
-    return out << "GL_LINEAR_ATTENUATION";
-  case GL_QUADRATIC_ATTENUATION:
-    return out << "GL_QUADRATIC_ATTENUATION";
-  case GL_AMBIENT:
-    return out << "GL_AMBIENT";
-  case GL_DIFFUSE:
-    return out << "GL_DIFFUSE";
-  case GL_SPECULAR:
-    return out << "GL_SPECULAR";
-  case GL_SHININESS:
-    return out << "GL_SHININESS";
-  case GL_EMISSION:
-    return out << "GL_EMISSION";
-  case GL_POSITION:
-    return out << "GL_POSITION";
-  case GL_SPOT_DIRECTION:
-    return out << "GL_SPOT_DIRECTION";
-  case GL_AMBIENT_AND_DIFFUSE:
-    return out << "GL_AMBIENT_AND_DIFFUSE";
-  case GL_COLOR_INDEXES:
-    return out << "GL_COLOR_INDEXES";
-  case GL_LIGHT_MODEL_TWO_SIDE:
-    return out << "GL_LIGHT_MODEL_TWO_SIDE";
-  case GL_LIGHT_MODEL_LOCAL_VIEWER:
-    return out << "GL_LIGHT_MODEL_LOCAL_VIEWER";
-  case GL_LIGHT_MODEL_AMBIENT:
-    return out << "GL_LIGHT_MODEL_AMBIENT";
-  case GL_FRONT_AND_BACK:
-    return out << "GL_FRONT_AND_BACK";
-  case GL_SHADE_MODEL:
-    return out << "GL_SHADE_MODEL";
-  case GL_FLAT:
-    return out << "GL_FLAT";
-  case GL_SMOOTH:
-    return out << "GL_SMOOTH";
-  case GL_COLOR_MATERIAL:
-    return out << "GL_COLOR_MATERIAL";
-  case GL_COLOR_MATERIAL_FACE:
-    return out << "GL_COLOR_MATERIAL_FACE";
-  case GL_COLOR_MATERIAL_PARAMETER:
-    return out << "GL_COLOR_MATERIAL_PARAMETER";
-  case GL_NORMALIZE:
-    return out << "GL_NORMALIZE";
-
-    /* User clipping planes */
-  case GL_CLIP_PLANE0:
-    return out << "GL_CLIP_PLANE0";
-  case GL_CLIP_PLANE1:
-    return out << "GL_CLIP_PLANE1";
-  case GL_CLIP_PLANE2:
-    return out << "GL_CLIP_PLANE2";
-  case GL_CLIP_PLANE3:
-    return out << "GL_CLIP_PLANE3";
-  case GL_CLIP_PLANE4:
-    return out << "GL_CLIP_PLANE4";
-  case GL_CLIP_PLANE5:
-    return out << "GL_CLIP_PLANE5";
-
-    /* Accumulation buffer */
-  case GL_ACCUM_RED_BITS:
-    return out << "GL_ACCUM_RED_BITS";
-  case GL_ACCUM_GREEN_BITS:
-    return out << "GL_ACCUM_GREEN_BITS";
-  case GL_ACCUM_BLUE_BITS:
-    return out << "GL_ACCUM_BLUE_BITS";
-  case GL_ACCUM_ALPHA_BITS:
-    return out << "GL_ACCUM_ALPHA_BITS";
-  case GL_ACCUM_CLEAR_VALUE:
-    return out << "GL_ACCUM_CLEAR_VALUE";
-  case GL_ACCUM:
-    return out << "GL_ACCUM";
-  case GL_ADD:
-    return out << "GL_ADD";
-  case GL_LOAD:
-    return out << "GL_LOAD";
-  case GL_MULT:
-    return out << "GL_MULT";
-
-    /* Alpha testing */
-  case GL_ALPHA_TEST:
-    return out << "GL_ALPHA_TEST";
-  case GL_ALPHA_TEST_REF:
-    return out << "GL_ALPHA_TEST_REF";
-  case GL_ALPHA_TEST_FUNC:
-    return out << "GL_ALPHA_TEST_FUNC";
-
-    /* Blending */
-  case GL_BLEND:
-    return out << "GL_BLEND";
-  case GL_BLEND_SRC:
-    return out << "GL_BLEND_SRC";
-  case GL_BLEND_DST:
-    return out << "GL_BLEND_DST";
-    /*
-      case GL_ZERO:
-      return out << "GL_ZERO";
-      case GL_ONE:
-      return out << "GL_ONE";
-    */
-  case GL_SRC_COLOR:
-    return out << "GL_SRC_COLOR";
-  case GL_ONE_MINUS_SRC_COLOR:
-    return out << "GL_ONE_MINUS_SRC_COLOR";
-  case GL_DST_COLOR:
-    return out << "GL_DST_COLOR";
-  case GL_ONE_MINUS_DST_COLOR:
-    return out << "GL_ONE_MINUS_DST_COLOR";
-  case GL_SRC_ALPHA:
-    return out << "GL_SRC_ALPHA";
-  case GL_ONE_MINUS_SRC_ALPHA:
-    return out << "GL_ONE_MINUS_SRC_ALPHA";
-  case GL_DST_ALPHA:
-    return out << "GL_DST_ALPHA";
-  case GL_ONE_MINUS_DST_ALPHA:
-    return out << "GL_ONE_MINUS_DST_ALPHA";
-  case GL_SRC_ALPHA_SATURATE:
-    return out << "GL_SRC_ALPHA_SATURATE";
-  #ifdef USING_OPENGL_1_2 //[
-  case GL_CONSTANT_COLOR:
-    return out << "GL_CONSTANT_COLOR";
-  case GL_ONE_MINUS_CONSTANT_COLOR:
-    return out << "GL_ONE_MINUS_CONSTANT_COLOR";
-  case GL_CONSTANT_ALPHA:
-    return out << "GL_CONSTANT_ALPHA";
-  case GL_ONE_MINUS_CONSTANT_ALPHA:
-    return out << "GL_ONE_MINUS_CONSTANT_ALPHA";
-  #endif //]
-
-    /* Render Mode */
-  case GL_FEEDBACK:
-    return out << "GL_FEEDBACK";
-  case GL_RENDER:
-    return out << "GL_RENDER";
-  case GL_SELECT:
-    return out << "GL_SELECT";
-
-    /* Feedback */
-  case GL_2D:
-    return out << "GL_2D";
-  case GL_3D:
-    return out << "GL_3D";
-  case GL_3D_COLOR:
-    return out << "GL_3D_COLOR";
-  case GL_3D_COLOR_TEXTURE:
-    return out << "GL_3D_COLOR_TEXTURE";
-  case GL_4D_COLOR_TEXTURE:
-    return out << "GL_4D_COLOR_TEXTURE";
-  case GL_POINT_TOKEN:
-    return out << "GL_POINT_TOKEN";
-  case GL_LINE_TOKEN:
-    return out << "GL_LINE_TOKEN";
-  case GL_LINE_RESET_TOKEN:
-    return out << "GL_LINE_RESET_TOKEN";
-  case GL_POLYGON_TOKEN:
-    return out << "GL_POLYGON_TOKEN";
-  case GL_BITMAP_TOKEN:
-    return out << "GL_BITMAP_TOKEN";
-  case GL_DRAW_PIXEL_TOKEN:
-    return out << "GL_DRAW_PIXEL_TOKEN";
-  case GL_COPY_PIXEL_TOKEN:
-    return out << "GL_COPY_PIXEL_TOKEN";
-  case GL_PASS_THROUGH_TOKEN:
-    return out << "GL_PASS_THROUGH_TOKEN";
-  case GL_FEEDBACK_BUFFER_POINTER:
-    return out << "GL_FEEDBACK_BUFFER_POINTER";
-  case GL_FEEDBACK_BUFFER_SIZE:
-    return out << "GL_FEEDBACK_BUFFER_SIZE";
-  case GL_FEEDBACK_BUFFER_TYPE:
-    return out << "GL_FEEDBACK_BUFFER_TYPE";
-
-    /* Selection */
-  case GL_SELECTION_BUFFER_POINTER:
-    return out << "GL_SELECTION_BUFFER_POINTER";
-  case GL_SELECTION_BUFFER_SIZE:
-    return out << "GL_SELECTION_BUFFER_SIZE";
-
-    /* Fog */
-  case GL_FOG:
-    return out << "GL_FOG";
-  case GL_FOG_MODE:
-    return out << "GL_FOG_MODE";
-  case GL_FOG_DENSITY:
-    return out << "GL_FOG_DENSITY";
-  case GL_FOG_COLOR:
-    return out << "GL_FOG_COLOR";
-  case GL_FOG_INDEX:
-    return out << "GL_FOG_INDEX";
-  case GL_FOG_START:
-    return out << "GL_FOG_START";
-  case GL_FOG_END:
-    return out << "GL_FOG_END";
-  case GL_LINEAR:
-    return out << "GL_LINEAR";
-  case GL_EXP:
-    return out << "GL_EXP";
-  case GL_EXP2:
-    return out << "GL_EXP2";
-
-    /* Logic Ops */
-  case GL_LOGIC_OP:
-    return out << "GL_LOGIC_OP";
-    /*
-      case GL_INDEX_LOGIC_OP:
-      return out << "GL_INDEX_LOGIC_OP";
-    */
-  case GL_COLOR_LOGIC_OP:
-    return out << "GL_COLOR_LOGIC_OP";
-  case GL_LOGIC_OP_MODE:
-    return out << "GL_LOGIC_OP_MODE";
-  case GL_CLEAR:
-    return out << "GL_CLEAR";
-  case GL_SET:
-    return out << "GL_SET";
-  case GL_COPY:
-    return out << "GL_COPY";
-  case GL_COPY_INVERTED:
-    return out << "GL_COPY_INVERTED";
-  case GL_NOOP:
-    return out << "GL_NOOP";
-  case GL_INVERT:
-    return out << "GL_INVERT";
-  case GL_AND:
-    return out << "GL_AND";
-  case GL_NAND:
-    return out << "GL_NAND";
-  case GL_OR:
-    return out << "GL_OR";
-  case GL_NOR:
-    return out << "GL_NOR";
-  case GL_XOR:
-    return out << "GL_XOR";
-  case GL_EQUIV:
-    return out << "GL_EQUIV";
-  case GL_AND_REVERSE:
-    return out << "GL_AND_REVERSE";
-  case GL_AND_INVERTED:
-    return out << "GL_AND_INVERTED";
-  case GL_OR_REVERSE:
-    return out << "GL_OR_REVERSE";
-  case GL_OR_INVERTED:
-    return out << "GL_OR_INVERTED";
-
-    /* Stencil */
-  case GL_STENCIL_TEST:
-    return out << "GL_STENCIL_TEST";
-  case GL_STENCIL_WRITEMASK:
-    return out << "GL_STENCIL_WRITEMASK";
-  case GL_STENCIL_BITS:
-    return out << "GL_STENCIL_BITS";
-  case GL_STENCIL_FUNC:
-    return out << "GL_STENCIL_FUNC";
-  case GL_STENCIL_VALUE_MASK:
-    return out << "GL_STENCIL_VALUE_MASK";
-  case GL_STENCIL_REF:
-    return out << "GL_STENCIL_REF";
-  case GL_STENCIL_FAIL:
-    return out << "GL_STENCIL_FAIL";
-  case GL_STENCIL_PASS_DEPTH_PASS:
-    return out << "GL_STENCIL_PASS_DEPTH_PASS";
-  case GL_STENCIL_PASS_DEPTH_FAIL:
-    return out << "GL_STENCIL_PASS_DEPTH_FAIL";
-  case GL_STENCIL_CLEAR_VALUE:
-    return out << "GL_STENCIL_CLEAR_VALUE";
-  case GL_STENCIL_INDEX:
-    return out << "GL_STENCIL_INDEX";
-  case GL_KEEP:
-    return out << "GL_KEEP";
-  case GL_REPLACE:
-    return out << "GL_REPLACE";
-  case GL_INCR:
-    return out << "GL_INCR";
-  case GL_DECR:
-    return out << "GL_DECR";
-
-    /* Buffers, Pixel Drawing/Reading */
-    /*
-      case GL_NONE:
-      return out << "GL_NONE";
-    */
-  case GL_LEFT:
-    return out << "GL_LEFT";
-  case GL_RIGHT:
-    return out << "GL_RIGHT";
-  case GL_FRONT_LEFT:
-    return out << "GL_FRONT_LEFT";
-  case GL_FRONT_RIGHT:
-    return out << "GL_FRONT_RIGHT";
-  case GL_BACK_LEFT:
-    return out << "GL_BACK_LEFT";
-  case GL_BACK_RIGHT:
-    return out << "GL_BACK_RIGHT";
-  case GL_AUX0:
-    return out << "GL_AUX0";
-  case GL_AUX1:
-    return out << "GL_AUX1";
-  case GL_AUX2:
-    return out << "GL_AUX2";
-  case GL_AUX3:
-    return out << "GL_AUX3";
-  case GL_COLOR_INDEX:
-    return out << "GL_COLOR_INDEX";
-  case GL_RED:
-    return out << "GL_RED";
-  case GL_GREEN:
-    return out << "GL_GREEN";
-  case GL_BLUE:
-    return out << "GL_BLUE";
-  case GL_ALPHA:
-    return out << "GL_ALPHA";
-  case GL_LUMINANCE:
-    return out << "GL_LUMINANCE";
-  case GL_LUMINANCE_ALPHA:
-    return out << "GL_LUMINANCE_ALPHA";
-  case GL_ALPHA_BITS:
-    return out << "GL_ALPHA_BITS";
-  case GL_RED_BITS:
-    return out << "GL_RED_BITS";
-  case GL_GREEN_BITS:
-    return out << "GL_GREEN_BITS";
-  case GL_BLUE_BITS:
-    return out << "GL_BLUE_BITS";
-  case GL_INDEX_BITS:
-    return out << "GL_INDEX_BITS";
-  case GL_SUBPIXEL_BITS:
-    return out << "GL_SUBPIXEL_BITS";
-  case GL_AUX_BUFFERS:
-    return out << "GL_AUX_BUFFERS";
-  case GL_READ_BUFFER:
-    return out << "GL_READ_BUFFER";
-  case GL_DRAW_BUFFER:
-    return out << "GL_DRAW_BUFFER";
-  case GL_DOUBLEBUFFER:
-    return out << "GL_DOUBLEBUFFER";
-  case GL_STEREO:
-    return out << "GL_STEREO";
-  case GL_BITMAP:
-    return out << "GL_BITMAP";
-  case GL_COLOR:
-    return out << "GL_COLOR";
-  case GL_DEPTH:
-    return out << "GL_DEPTH";
-  case GL_STENCIL:
-    return out << "GL_STENCIL";
-  case GL_DITHER:
-    return out << "GL_DITHER";
-  case GL_RGB:
-    return out << "GL_RGB";
-  case GL_RGBA:
-    return out << "GL_RGBA";
-
-    /* Implementation limits */
-  case GL_MAX_LIST_NESTING:
-    return out << "GL_MAX_LIST_NESTING";
-  case GL_MAX_ATTRIB_STACK_DEPTH:
-    return out << "GL_MAX_ATTRIB_STACK_DEPTH";
-  case GL_MAX_MODELVIEW_STACK_DEPTH:
-    return out << "GL_MAX_MODELVIEW_STACK_DEPTH";
-  case GL_MAX_NAME_STACK_DEPTH:
-    return out << "GL_MAX_NAME_STACK_DEPTH";
-  case GL_MAX_PROJECTION_STACK_DEPTH:
-    return out << "GL_MAX_PROJECTION_STACK_DEPTH";
-  case GL_MAX_TEXTURE_STACK_DEPTH:
-    return out << "GL_MAX_TEXTURE_STACK_DEPTH";
-  case GL_MAX_EVAL_ORDER:
-    return out << "GL_MAX_EVAL_ORDER";
-  case GL_MAX_LIGHTS:
-    return out << "GL_MAX_LIGHTS";
-  case GL_MAX_CLIP_PLANES:
-    return out << "GL_MAX_CLIP_PLANES";
-  case GL_MAX_TEXTURE_SIZE:
-    return out << "GL_MAX_TEXTURE_SIZE";
-  case GL_MAX_PIXEL_MAP_TABLE:
-    return out << "GL_MAX_PIXEL_MAP_TABLE";
-  case GL_MAX_VIEWPORT_DIMS:
-    return out << "GL_MAX_VIEWPORT_DIMS";
-  case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
-    return out << "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH";
-
-    /* Gets */
-  case GL_ATTRIB_STACK_DEPTH:
-    return out << "GL_ATTRIB_STACK_DEPTH";
-  case GL_CLIENT_ATTRIB_STACK_DEPTH:
-    return out << "GL_CLIENT_ATTRIB_STACK_DEPTH";
-  case GL_COLOR_CLEAR_VALUE:
-    return out << "GL_COLOR_CLEAR_VALUE";
-  case GL_COLOR_WRITEMASK:
-    return out << "GL_COLOR_WRITEMASK";
-  case GL_CURRENT_INDEX:
-    return out << "GL_CURRENT_INDEX";
-  case GL_CURRENT_COLOR:
-    return out << "GL_CURRENT_COLOR";
-  case GL_CURRENT_NORMAL:
-    return out << "GL_CURRENT_NORMAL";
-  case GL_CURRENT_RASTER_COLOR:
-    return out << "GL_CURRENT_RASTER_COLOR";
-  case GL_CURRENT_RASTER_DISTANCE:
-    return out << "GL_CURRENT_RASTER_DISTANCE";
-  case GL_CURRENT_RASTER_INDEX:
-    return out << "GL_CURRENT_RASTER_INDEX";
-  case GL_CURRENT_RASTER_POSITION:
-    return out << "GL_CURRENT_RASTER_POSITION";
-  case GL_CURRENT_RASTER_TEXTURE_COORDS:
-    return out << "GL_CURRENT_RASTER_TEXTURE_COORDS";
-  case GL_CURRENT_RASTER_POSITION_VALID:
-    return out << "GL_CURRENT_RASTER_POSITION_VALID";
-  case GL_CURRENT_TEXTURE_COORDS:
-    return out << "GL_CURRENT_TEXTURE_COORDS";
-  case GL_INDEX_CLEAR_VALUE:
-    return out << "GL_INDEX_CLEAR_VALUE";
-  case GL_INDEX_MODE:
-    return out << "GL_INDEX_MODE";
-  case GL_INDEX_WRITEMASK:
-    return out << "GL_INDEX_WRITEMASK";
-  case GL_MODELVIEW_MATRIX:
-    return out << "GL_MODELVIEW_MATRIX";
-  case GL_MODELVIEW_STACK_DEPTH:
-    return out << "GL_MODELVIEW_STACK_DEPTH";
-  case GL_NAME_STACK_DEPTH:
-    return out << "GL_NAME_STACK_DEPTH";
-  case GL_PROJECTION_MATRIX:
-    return out << "GL_PROJECTION_MATRIX";
-  case GL_PROJECTION_STACK_DEPTH:
-    return out << "GL_PROJECTION_STACK_DEPTH";
-  case GL_RENDER_MODE:
-    return out << "GL_RENDER_MODE";
-  case GL_RGBA_MODE:
-    return out << "GL_RGBA_MODE";
-  case GL_TEXTURE_MATRIX:
-    return out << "GL_TEXTURE_MATRIX";
-  case GL_TEXTURE_STACK_DEPTH:
-    return out << "GL_TEXTURE_STACK_DEPTH";
-  case GL_VIEWPORT:
-    return out << "GL_VIEWPORT";
-
-
-    /* Evaluators */
-  case GL_AUTO_NORMAL:
-    return out << "GL_AUTO_NORMAL";
-  case GL_MAP1_COLOR_4:
-    return out << "GL_MAP1_COLOR_4";
-  case GL_MAP1_GRID_DOMAIN:
-    return out << "GL_MAP1_GRID_DOMAIN";
-  case GL_MAP1_GRID_SEGMENTS:
-    return out << "GL_MAP1_GRID_SEGMENTS";
-  case GL_MAP1_INDEX:
-    return out << "GL_MAP1_INDEX";
-  case GL_MAP1_NORMAL:
-    return out << "GL_MAP1_NORMAL";
-  case GL_MAP1_TEXTURE_COORD_1:
-    return out << "GL_MAP1_TEXTURE_COORD_1";
-  case GL_MAP1_TEXTURE_COORD_2:
-    return out << "GL_MAP1_TEXTURE_COORD_2";
-  case GL_MAP1_TEXTURE_COORD_3:
-    return out << "GL_MAP1_TEXTURE_COORD_3";
-  case GL_MAP1_TEXTURE_COORD_4:
-    return out << "GL_MAP1_TEXTURE_COORD_4";
-  case GL_MAP1_VERTEX_3:
-    return out << "GL_MAP1_VERTEX_3";
-  case GL_MAP1_VERTEX_4:
-    return out << "GL_MAP1_VERTEX_4";
-  case GL_MAP2_COLOR_4:
-    return out << "GL_MAP2_COLOR_4";
-  case GL_MAP2_GRID_DOMAIN:
-    return out << "GL_MAP2_GRID_DOMAIN";
-  case GL_MAP2_GRID_SEGMENTS:
-    return out << "GL_MAP2_GRID_SEGMENTS";
-  case GL_MAP2_INDEX:
-    return out << "GL_MAP2_INDEX";
-  case GL_MAP2_NORMAL:
-    return out << "GL_MAP2_NORMAL";
-  case GL_MAP2_TEXTURE_COORD_1:
-    return out << "GL_MAP2_TEXTURE_COORD_1";
-  case GL_MAP2_TEXTURE_COORD_2:
-    return out << "GL_MAP2_TEXTURE_COORD_2";
-  case GL_MAP2_TEXTURE_COORD_3:
-    return out << "GL_MAP2_TEXTURE_COORD_3";
-  case GL_MAP2_TEXTURE_COORD_4:
-    return out << "GL_MAP2_TEXTURE_COORD_4";
-  case GL_MAP2_VERTEX_3:
-    return out << "GL_MAP2_VERTEX_3";
-  case GL_MAP2_VERTEX_4:
-    return out << "GL_MAP2_VERTEX_4";
-  case GL_COEFF:
-    return out << "GL_COEFF";
-  case GL_DOMAIN:
-    return out << "GL_DOMAIN";
-  case GL_ORDER:
-    return out << "GL_ORDER";
-
-    /* Hints */
-  case GL_FOG_HINT:
-    return out << "GL_FOG_HINT";
-  case GL_LINE_SMOOTH_HINT:
-    return out << "GL_LINE_SMOOTH_HINT";
-  case GL_PERSPECTIVE_CORRECTION_HINT:
-    return out << "GL_PERSPECTIVE_CORRECTION_HINT";
-  case GL_POINT_SMOOTH_HINT:
-    return out << "GL_POINT_SMOOTH_HINT";
-  case GL_POLYGON_SMOOTH_HINT:
-    return out << "GL_POLYGON_SMOOTH_HINT";
-  case GL_DONT_CARE:
-    return out << "GL_DONT_CARE";
-  case GL_FASTEST:
-    return out << "GL_FASTEST";
-  case GL_NICEST:
-    return out << "GL_NICEST";
-
-    /* Scissor box */
-  case GL_SCISSOR_TEST:
-    return out << "GL_SCISSOR_TEST";
-  case GL_SCISSOR_BOX:
-    return out << "GL_SCISSOR_BOX";
-
-    /* Pixel Mode / Transfer */
-  case GL_MAP_COLOR:
-    return out << "GL_MAP_COLOR";
-  case GL_MAP_STENCIL:
-    return out << "GL_MAP_STENCIL";
-  case GL_INDEX_SHIFT:
-    return out << "GL_INDEX_SHIFT";
-  case GL_INDEX_OFFSET:
-    return out << "GL_INDEX_OFFSET";
-  case GL_RED_SCALE:
-    return out << "GL_RED_SCALE";
-  case GL_RED_BIAS:
-    return out << "GL_RED_BIAS";
-  case GL_GREEN_SCALE:
-    return out << "GL_GREEN_SCALE";
-  case GL_GREEN_BIAS:
-    return out << "GL_GREEN_BIAS";
-  case GL_BLUE_SCALE:
-    return out << "GL_BLUE_SCALE";
-  case GL_BLUE_BIAS:
-    return out << "GL_BLUE_BIAS";
-  case GL_ALPHA_SCALE:
-    return out << "GL_ALPHA_SCALE";
-  case GL_ALPHA_BIAS:
-    return out << "GL_ALPHA_BIAS";
-  case GL_DEPTH_SCALE:
-    return out << "GL_DEPTH_SCALE";
-  case GL_DEPTH_BIAS:
-    return out << "GL_DEPTH_BIAS";
-  case GL_PIXEL_MAP_S_TO_S_SIZE:
-    return out << "GL_PIXEL_MAP_S_TO_S_SIZE";
-  case GL_PIXEL_MAP_I_TO_I_SIZE:
-    return out << "GL_PIXEL_MAP_I_TO_I_SIZE";
-  case GL_PIXEL_MAP_I_TO_R_SIZE:
-    return out << "GL_PIXEL_MAP_I_TO_R_SIZE";
-  case GL_PIXEL_MAP_I_TO_G_SIZE:
-    return out << "GL_PIXEL_MAP_I_TO_G_SIZE";
-  case GL_PIXEL_MAP_I_TO_B_SIZE:
-    return out << "GL_PIXEL_MAP_I_TO_B_SIZE";
-  case GL_PIXEL_MAP_I_TO_A_SIZE:
-    return out << "GL_PIXEL_MAP_I_TO_A_SIZE";
-  case GL_PIXEL_MAP_R_TO_R_SIZE:
-    return out << "GL_PIXEL_MAP_R_TO_R_SIZE";
-  case GL_PIXEL_MAP_G_TO_G_SIZE:
-    return out << "GL_PIXEL_MAP_G_TO_G_SIZE";
-  case GL_PIXEL_MAP_B_TO_B_SIZE:
-    return out << "GL_PIXEL_MAP_B_TO_B_SIZE";
-  case GL_PIXEL_MAP_A_TO_A_SIZE:
-    return out << "GL_PIXEL_MAP_A_TO_A_SIZE";
-  case GL_PIXEL_MAP_S_TO_S:
-    return out << "GL_PIXEL_MAP_S_TO_S";
-  case GL_PIXEL_MAP_I_TO_I:
-    return out << "GL_PIXEL_MAP_I_TO_I";
-  case GL_PIXEL_MAP_I_TO_R:
-    return out << "GL_PIXEL_MAP_I_TO_R";
-  case GL_PIXEL_MAP_I_TO_G:
-    return out << "GL_PIXEL_MAP_I_TO_G";
-  case GL_PIXEL_MAP_I_TO_B:
-    return out << "GL_PIXEL_MAP_I_TO_B";
-  case GL_PIXEL_MAP_I_TO_A:
-    return out << "GL_PIXEL_MAP_I_TO_A";
-  case GL_PIXEL_MAP_R_TO_R:
-    return out << "GL_PIXEL_MAP_R_TO_R";
-  case GL_PIXEL_MAP_G_TO_G:
-    return out << "GL_PIXEL_MAP_G_TO_G";
-  case GL_PIXEL_MAP_B_TO_B:
-    return out << "GL_PIXEL_MAP_B_TO_B";
-  case GL_PIXEL_MAP_A_TO_A:
-    return out << "GL_PIXEL_MAP_A_TO_A";
-  case GL_PACK_ALIGNMENT:
-    return out << "GL_PACK_ALIGNMENT";
-  case GL_PACK_LSB_FIRST:
-    return out << "GL_PACK_LSB_FIRST";
-  case GL_PACK_ROW_LENGTH:
-    return out << "GL_PACK_ROW_LENGTH";
-  case GL_PACK_SKIP_PIXELS:
-    return out << "GL_PACK_SKIP_PIXELS";
-  case GL_PACK_SKIP_ROWS:
-    return out << "GL_PACK_SKIP_ROWS";
-  case GL_PACK_SWAP_BYTES:
-    return out << "GL_PACK_SWAP_BYTES";
-  case GL_UNPACK_ALIGNMENT:
-    return out << "GL_UNPACK_ALIGNMENT";
-  case GL_UNPACK_LSB_FIRST:
-    return out << "GL_UNPACK_LSB_FIRST";
-  case GL_UNPACK_ROW_LENGTH:
-    return out << "GL_UNPACK_ROW_LENGTH";
-  case GL_UNPACK_SKIP_PIXELS:
-    return out << "GL_UNPACK_SKIP_PIXELS";
-  case GL_UNPACK_SKIP_ROWS:
-    return out << "GL_UNPACK_SKIP_ROWS";
-  case GL_UNPACK_SWAP_BYTES:
-    return out << "GL_UNPACK_SWAP_BYTES";
-  case GL_ZOOM_X:
-    return out << "GL_ZOOM_X";
-  case GL_ZOOM_Y:
-    return out << "GL_ZOOM_Y";
-
-    /* Texture mapping */
-  case GL_TEXTURE_ENV:
-    return out << "GL_TEXTURE_ENV";
-  case GL_TEXTURE_ENV_MODE:
-    return out << "GL_TEXTURE_ENV_MODE";
-  case GL_TEXTURE_1D:
-    return out << "GL_TEXTURE_1D";
-  case GL_TEXTURE_2D:
-    return out << "GL_TEXTURE_2D";
-  case GL_TEXTURE_WRAP_S:
-    return out << "GL_TEXTURE_WRAP_S";
-  case GL_TEXTURE_WRAP_T:
-    return out << "GL_TEXTURE_WRAP_T";
-  case GL_TEXTURE_MAG_FILTER:
-    return out << "GL_TEXTURE_MAG_FILTER";
-  case GL_TEXTURE_MIN_FILTER:
-    return out << "GL_TEXTURE_MIN_FILTER";
-  case GL_TEXTURE_ENV_COLOR:
-    return out << "GL_TEXTURE_ENV_COLOR";
-  case GL_TEXTURE_GEN_S:
-    return out << "GL_TEXTURE_GEN_S";
-  case GL_TEXTURE_GEN_T:
-    return out << "GL_TEXTURE_GEN_T";
-  case GL_TEXTURE_GEN_MODE:
-    return out << "GL_TEXTURE_GEN_MODE";
-  case GL_TEXTURE_BORDER_COLOR:
-    return out << "GL_TEXTURE_BORDER_COLOR";
-  case GL_TEXTURE_WIDTH:
-    return out << "GL_TEXTURE_WIDTH";
-  case GL_TEXTURE_HEIGHT:
-    return out << "GL_TEXTURE_HEIGHT";
-  case GL_TEXTURE_BORDER:
-    return out << "GL_TEXTURE_BORDER";
-  case GL_TEXTURE_COMPONENTS:
-    return out << "GL_TEXTURE_COMPONENTS";
-  case GL_TEXTURE_RED_SIZE:
-    return out << "GL_TEXTURE_RED_SIZE";
-  case GL_TEXTURE_GREEN_SIZE:
-    return out << "GL_TEXTURE_GREEN_SIZE";
-  case GL_TEXTURE_BLUE_SIZE:
-    return out << "GL_TEXTURE_BLUE_SIZE";
-  case GL_TEXTURE_ALPHA_SIZE:
-    return out << "GL_TEXTURE_ALPHA_SIZE";
-  case GL_TEXTURE_LUMINANCE_SIZE:
-    return out << "GL_TEXTURE_LUMINANCE_SIZE";
-  case GL_TEXTURE_INTENSITY_SIZE:
-    return out << "GL_TEXTURE_INTENSITY_SIZE";
-  case GL_NEAREST_MIPMAP_NEAREST:
-    return out << "GL_NEAREST_MIPMAP_NEAREST";
-  case GL_NEAREST_MIPMAP_LINEAR:
-    return out << "GL_NEAREST_MIPMAP_LINEAR";
-  case GL_LINEAR_MIPMAP_NEAREST:
-    return out << "GL_LINEAR_MIPMAP_NEAREST";
-  case GL_LINEAR_MIPMAP_LINEAR:
-    return out << "GL_LINEAR_MIPMAP_LINEAR";
-  case GL_OBJECT_LINEAR:
-    return out << "GL_OBJECT_LINEAR";
-  case GL_OBJECT_PLANE:
-    return out << "GL_OBJECT_PLANE";
-  case GL_EYE_LINEAR:
-    return out << "GL_EYE_LINEAR";
-  case GL_EYE_PLANE:
-    return out << "GL_EYE_PLANE";
-  case GL_SPHERE_MAP:
-    return out << "GL_SPHERE_MAP";
-  case GL_DECAL:
-    return out << "GL_DECAL";
-  case GL_MODULATE:
-    return out << "GL_MODULATE";
-  case GL_NEAREST:
-    return out << "GL_NEAREST";
-  case GL_REPEAT:
-    return out << "GL_REPEAT";
-  case GL_CLAMP:
-    return out << "GL_CLAMP";
-  case GL_S:
-    return out << "GL_S";
-  case GL_T:
-    return out << "GL_T";
-  case GL_R:
-    return out << "GL_R";
-  case GL_Q:
-    return out << "GL_Q";
-  case GL_TEXTURE_GEN_R:
-    return out << "GL_TEXTURE_GEN_R";
-  case GL_TEXTURE_GEN_Q:
-    return out << "GL_TEXTURE_GEN_Q";
-
-    /* GL 1.1 texturing */
-  case GL_PROXY_TEXTURE_1D:
-    return out << "GL_PROXY_TEXTURE_1D";
-  case GL_PROXY_TEXTURE_2D:
-    return out << "GL_PROXY_TEXTURE_2D";
-  case GL_TEXTURE_PRIORITY:
-    return out << "GL_TEXTURE_PRIORITY";
-  case GL_TEXTURE_RESIDENT:
-    return out << "GL_TEXTURE_RESIDENT";
-  case GL_TEXTURE_BINDING_1D:
-    return out << "GL_TEXTURE_BINDING_1D";
-  case GL_TEXTURE_BINDING_2D:
-    return out << "GL_TEXTURE_BINDING_2D";
-    /*
-      case GL_TEXTURE_INTERNAL_FORMAT:
-      return out << "GL_TEXTURE_INTERNAL_FORMAT";
-    */
-
-    /* GL 1.2 texturing */
-  #ifdef USING_OPENGL_1_2 //[
-  case GL_PACK_SKIP_IMAGES:
-    return out << "GL_PACK_SKIP_IMAGES";
-  case GL_PACK_IMAGE_HEIGHT:
-    return out << "GL_PACK_IMAGE_HEIGHT";
-  case GL_UNPACK_SKIP_IMAGES:
-    return out << "GL_UNPACK_SKIP_IMAGES";
-  case GL_UNPACK_IMAGE_HEIGHT:
-    return out << "GL_UNPACK_IMAGE_HEIGHT";
-  case GL_TEXTURE_3D:
-    return out << "GL_TEXTURE_3D";
-  case GL_PROXY_TEXTURE_3D:
-    return out << "GL_PROXY_TEXTURE_3D";
-  case GL_TEXTURE_DEPTH:
-    return out << "GL_TEXTURE_DEPTH";
-  case GL_TEXTURE_WRAP_R:
-    return out << "GL_TEXTURE_WRAP_R";
-  case GL_MAX_3D_TEXTURE_SIZE:
-    return out << "GL_MAX_3D_TEXTURE_SIZE";
-#ifdef GL_TEXTURE_BINDING_3D
-  case GL_TEXTURE_BINDING_3D:
-    return out << "GL_TEXTURE_BINDING_3D";
-#endif
-  #endif //]
-
-    /* Internal texture formats (GL 1.1) */
-  case GL_ALPHA4:
-    return out << "GL_ALPHA4";
-  case GL_ALPHA8:
-    return out << "GL_ALPHA8";
-  case GL_ALPHA12:
-    return out << "GL_ALPHA12";
-  case GL_ALPHA16:
-    return out << "GL_ALPHA16";
-  case GL_LUMINANCE4:
-    return out << "GL_LUMINANCE4";
-  case GL_LUMINANCE8:
-    return out << "GL_LUMINANCE8";
-  case GL_LUMINANCE12:
-    return out << "GL_LUMINANCE12";
-  case GL_LUMINANCE16:
-    return out << "GL_LUMINANCE16";
-  case GL_LUMINANCE4_ALPHA4:
-    return out << "GL_LUMINANCE4_ALPHA4";
-  case GL_LUMINANCE6_ALPHA2:
-    return out << "GL_LUMINANCE6_ALPHA2";
-  case GL_LUMINANCE8_ALPHA8:
-    return out << "GL_LUMINANCE8_ALPHA8";
-  case GL_LUMINANCE12_ALPHA4:
-    return out << "GL_LUMINANCE12_ALPHA4";
-  case GL_LUMINANCE12_ALPHA12:
-    return out << "GL_LUMINANCE12_ALPHA12";
-  case GL_LUMINANCE16_ALPHA16:
-    return out << "GL_LUMINANCE16_ALPHA16";
-  case GL_INTENSITY:
-    return out << "GL_INTENSITY";
-  case GL_INTENSITY4:
-    return out << "GL_INTENSITY4";
-  case GL_INTENSITY8:
-    return out << "GL_INTENSITY8";
-  case GL_INTENSITY12:
-    return out << "GL_INTENSITY12";
-  case GL_INTENSITY16:
-    return out << "GL_INTENSITY16";
-  case GL_R3_G3_B2:
-    return out << "GL_R3_G3_B2";
-  case GL_RGB4:
-    return out << "GL_RGB4";
-  case GL_RGB5:
-    return out << "GL_RGB5";
-  case GL_RGB8:
-    return out << "GL_RGB8";
-  case GL_RGB10:
-    return out << "GL_RGB10";
-  case GL_RGB12:
-    return out << "GL_RGB12";
-  case GL_RGB16:
-    return out << "GL_RGB16";
-  case GL_RGBA2:
-    return out << "GL_RGBA2";
-  case GL_RGBA4:
-    return out << "GL_RGBA4";
-  case GL_RGB5_A1:
-    return out << "GL_RGB5_A1";
-  case GL_RGBA8:
-    return out << "GL_RGBA8";
-  case GL_RGB10_A2:
-    return out << "GL_RGB10_A2";
-  case GL_RGBA12:
-    return out << "GL_RGBA12";
-  case GL_RGBA16:
-    return out << "GL_RGBA16";
-
-    /* Utility */
-  case GL_VENDOR:
-    return out << "GL_VENDOR";
-  case GL_RENDERER:
-    return out << "GL_RENDERER";
-  case GL_VERSION:
-    return out << "GL_VERSION";
-  case GL_EXTENSIONS:
-    return out << "GL_EXTENSIONS";
-
-    /* Errors */
-  case GL_INVALID_VALUE:
-    return out << "GL_INVALID_VALUE";
-  case GL_INVALID_ENUM:
-    return out << "GL_INVALID_ENUM";
-  case GL_INVALID_OPERATION:
-    return out << "GL_INVALID_OPERATION";
-  case GL_STACK_OVERFLOW:
-    return out << "GL_STACK_OVERFLOW";
-  case GL_STACK_UNDERFLOW:
-    return out << "GL_STACK_UNDERFLOW";
-  case GL_OUT_OF_MEMORY:
-    return out << "GL_OUT_OF_MEMORY";
-
-    /* OpenGL 1.2 */
-  #ifdef USING_OPENGL_1_2 //[
-  case GL_RESCALE_NORMAL:
-    return out << "GL_RESCALE_NORMAL";
-  case GL_CLAMP_TO_EDGE:
-    return out << "GL_CLAMP_TO_EDGE";
-  case GL_MAX_ELEMENTS_VERTICES:
-    return out << "GL_MAX_ELEMENTS_VERTICES";
-  case GL_MAX_ELEMENTS_INDICES:
-    return out << "GL_MAX_ELEMENTS_INDICES";
-  case GL_BGR:
-    return out << "GL_BGR";
-  case GL_BGRA:
-    return out << "GL_BGRA";
-  case GL_UNSIGNED_BYTE_3_3_2:
-    return out << "GL_UNSIGNED_BYTE_3_3_2";
-  case GL_UNSIGNED_BYTE_2_3_3_REV:
-    return out << "GL_UNSIGNED_BYTE_2_3_3_REV";
-  case GL_UNSIGNED_SHORT_5_6_5:
-    return out << "GL_UNSIGNED_SHORT_5_6_5";
-  case GL_UNSIGNED_SHORT_5_6_5_REV:
-    return out << "GL_UNSIGNED_SHORT_5_6_5_REV";
-  case GL_UNSIGNED_SHORT_4_4_4_4:
-    return out << "GL_UNSIGNED_SHORT_4_4_4_4";
-  case GL_UNSIGNED_SHORT_4_4_4_4_REV:
-    return out << "GL_UNSIGNED_SHORT_4_4_4_4_REV";
-  case GL_UNSIGNED_SHORT_5_5_5_1:
-    return out << "GL_UNSIGNED_SHORT_5_5_5_1";
-  case GL_UNSIGNED_SHORT_1_5_5_5_REV:
-    return out << "GL_UNSIGNED_SHORT_1_5_5_5_REV";
-  case GL_UNSIGNED_INT_8_8_8_8:
-    return out << "GL_UNSIGNED_INT_8_8_8_8";
-  case GL_UNSIGNED_INT_8_8_8_8_REV:
-    return out << "GL_UNSIGNED_INT_8_8_8_8_REV";
-  case GL_UNSIGNED_INT_10_10_10_2:
-    return out << "GL_UNSIGNED_INT_10_10_10_2";
-  case GL_UNSIGNED_INT_2_10_10_10_REV:
-    return out << "GL_UNSIGNED_INT_2_10_10_10_REV";
-  case GL_LIGHT_MODEL_COLOR_CONTROL:
-    return out << "GL_LIGHT_MODEL_COLOR_CONTROL";
-  case GL_SINGLE_COLOR:
-    return out << "GL_SINGLE_COLOR";
-  case GL_SEPARATE_SPECULAR_COLOR:
-    return out << "GL_SEPARATE_SPECULAR_COLOR";
-  case GL_TEXTURE_MIN_LOD:
-    return out << "GL_TEXTURE_MIN_LOD";
-  case GL_TEXTURE_MAX_LOD:
-    return out << "GL_TEXTURE_MAX_LOD";
-  case GL_TEXTURE_BASE_LEVEL:
-    return out << "GL_TEXTURE_BASE_LEVEL";
-  case GL_TEXTURE_MAX_LEVEL:
-    return out << "GL_TEXTURE_MAX_LEVEL";
-  #endif //]
-  }
-
-  return out << (int)v;
-}
-#endif

+ 0 - 362
panda/src/crgsg/crGraphicsStateGuardian.h

@@ -1,362 +0,0 @@
-// Filename: chromium.GraphicsStateGuardian.h
-// Created by:  drose (02Feb99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef CRGRAPHICSSTATEGUARDIAN_H
-#define CRGRAPHICSSTATEGUARDIAN_H
-
-//#define GSG_VERBOSE
-
-#include "pandabase.h"
-
-#include "graphicsStateGuardian.h"
-#include "geomprimitives.h"
-#include "texture.h"
-#include "pixelBuffer.h"
-#include "displayRegion.h"
-#include "material.h"
-#include "depthTestAttrib.h"
-#include "textureApplyAttrib.h"
-#include "pointerToArray.h"
-
-#ifdef WIN32_VC
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-
-#include <GL/gl.h>
-// Chromium specific
-#ifdef WIN32_VC // [
-#define WINDOWS 1
-#endif //]
-#include "cr_glwrapper.h"
-#include "cr_applications.h"
-#include "cr_spu.h"
-extern SPUDispatchTable chromium;
-
-
-
-class PlaneNode;
-class Light;
-
-#if !defined(WIN32) && defined(GSG_VERBOSE)
-ostream &output_cr_enum(ostream &out, GLenum v);
-INLINE ostream &operator << (ostream &out, GLenum v) {
-  return output_cr_enum(out, v);
-}
-#endif
-
-
-////////////////////////////////////////////////////////////////////
-//       Class : CRGraphicsStateGuardian
-// Description : A GraphicsStateGuardian specialized for rendering
-//               into OpenGL contexts.  There should be no GL calls
-//               outside of this object.
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDACR CRGraphicsStateGuardian : public GraphicsStateGuardian {
-public:
-  CRGraphicsStateGuardian(GraphicsWindow *win);
-  ~CRGraphicsStateGuardian();
-
-  virtual void reset();
-
-  virtual void clear(const RenderBuffer &buffer);
-  virtual void clear(const RenderBuffer &buffer, const DisplayRegion* region);
-
-  virtual void prepare_display_region();
-  virtual bool prepare_lens();
-
-  virtual void draw_point(GeomPoint *geom, GeomContext *gc);
-  virtual void draw_line(GeomLine *geom, GeomContext *gc);
-  virtual void draw_linestrip(GeomLinestrip *geom, GeomContext *gc);
-  virtual void draw_sprite(GeomSprite *geom, GeomContext *gc);
-  virtual void draw_polygon(GeomPolygon *geom, GeomContext *gc);
-  virtual void draw_quad(GeomQuad *geom, GeomContext *gc);
-  virtual void draw_tri(GeomTri *geom, GeomContext *gc);
-  virtual void draw_tristrip(GeomTristrip *geom, GeomContext *gc);
-  virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
-  virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
-
-  virtual TextureContext *prepare_texture(Texture *tex);
-  virtual void apply_texture(TextureContext *tc);
-  virtual void release_texture(TextureContext *tc);
-
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
-
-  virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr);
-  virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr,
-                            const RenderBuffer &rb);
-
-  virtual void texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb);
-  virtual void texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb,
-                                       const DisplayRegion *dr);
-
-  virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr);
-  virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
-                                 const RenderBuffer &rb);
-  virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
-                                 const NodeTransitions& na=NodeTransitions());
-  virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
-                                 const RenderBuffer &rb,
-                                 const NodeTransitions& na=NodeTransitions());
-
-  virtual void apply_material(const Material *material);
-  void apply_fog(Fog *fog);
-
-  virtual void issue_transform(const TransformState *transform);
-  virtual void issue_tex_matrix(const TexMatrixAttrib *attrib);
-  virtual void issue_texture(const TextureAttrib *attrib);
-  virtual void issue_material(const MaterialAttrib *attrib);
-  virtual void issue_render_mode(const RenderModeAttrib *attrib);
-  virtual void issue_texture_apply(const TextureApplyAttrib *attrib);
-  virtual void issue_color_write(const ColorWriteAttrib *attrib);
-  virtual void issue_depth_test(const DepthTestAttrib *attrib);
-  virtual void issue_depth_write(const DepthWriteAttrib *attrib);
-  virtual void issue_cull_face(const CullFaceAttrib *attrib);
-  virtual void issue_fog(const FogAttrib *attrib);
-  virtual void issue_depth_offset(const DepthOffsetAttrib *attrib);
-  //  virtual void issue_tex_gen(const TexGenAttrib *attrib);
-  //  virtual void issue_stencil(const StencilAttrib *attrib);
-  //  virtual void issue_clip_plane(const ClipPlaneAttrib *attrib);
-
-  virtual void bind_light(PointLight *light, int light_id);
-  virtual void bind_light(DirectionalLight *light, int light_id);
-  virtual void bind_light(Spotlight *light, int light_id);
-
-  virtual bool wants_normals(void) const;
-  virtual bool wants_texcoords(void) const;
-
-  virtual bool depth_offset_decals();
-
-  virtual CoordinateSystem get_internal_coordinate_system() const;
-  virtual float compute_distance_to(const LPoint3f &point) const;
-
-  void print_gfx_visual();
-
-  //For those interested in what the guardian thinks is the current
-  //enabled/disable GL State compared to what GL says it is
-  void dump_state(void);
-
-  //Methods for extracting the current color and alpha transformations
-  INLINE const LMatrix4f &get_current_color_mat() const;
-  INLINE const float &get_current_alpha_offset() const;
-  INLINE const float &get_current_alpha_scale() const;
-
-  void issue_transformed_color(const Colorf &color) const;
-
-protected:
-  virtual void enable_lighting(bool enable);
-  virtual void set_ambient_light(const Colorf &color);
-  virtual void enable_light(int light_id, bool enable);
-  virtual void begin_bind_lights();
-  virtual void end_bind_lights();
-
-  virtual void set_blend_mode(ColorWriteAttrib::Mode color_write_mode,
-                              ColorBlendAttrib::Mode color_blend_mode,
-                              TransparencyAttrib::Mode transparency_mode);
-
-  void free_pointers();
-  virtual PT(SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer,
-                                                 CPT(DisplayRegion) dr);
-  virtual void restore_frame_buffer(SavedFrameBuffer *frame_buffer);
-
-  INLINE void activate();
-
-  INLINE void call_glClearColor(GLclampf red, GLclampf green, GLclampf blue,
-                                GLclampf alpha);
-  INLINE void call_glClearDepth(GLclampd depth);
-  INLINE void call_glClearStencil(GLint s);
-  INLINE void call_glClearAccum(GLclampf red, GLclampf green, GLclampf blue,
-                                GLclampf alpha);
-  INLINE void call_glDrawBuffer(GLenum mode);
-  INLINE void call_glReadBuffer(GLenum mode);
-  INLINE void call_glShadeModel(GLenum mode);
-  INLINE void call_glBlendFunc(GLenum sfunc, GLenum dfunc);
-  INLINE void call_glCullFace(GLenum mode);
-  INLINE void call_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
-  INLINE void call_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
-  INLINE void call_glLightModelLocal(GLboolean local);
-  INLINE void call_glLightModelTwoSide(GLboolean twoside);
-  INLINE void call_glStencilFunc(GLenum func,GLint refval,GLuint mask);
-  INLINE void call_glStencilOp(GLenum fail,GLenum zfail,GLenum pass);
-  INLINE void call_glClipPlane(GLenum plane, const double equation[4]);
-  INLINE void call_glLineWidth(GLfloat width);
-  INLINE void call_glPointSize(GLfloat size);
-  INLINE void call_glFogMode(GLint mode);
-  INLINE void call_glFogStart(GLfloat start);
-  INLINE void call_glFogEnd(GLfloat end);
-  INLINE void call_glFogDensity(GLfloat density);
-  INLINE void call_glFogColor(const Colorf &color);
-  INLINE void call_glAlphaFunc(GLenum func, GLclampf ref);
-  INLINE void call_glPolygonMode(GLenum mode);
-
-  INLINE void set_pack_alignment(GLint alignment);
-  INLINE void set_unpack_alignment(GLint alignment);
-
-  INLINE void enable_multisample(bool val);
-  INLINE void enable_line_smooth(bool val);
-  INLINE void enable_point_smooth(bool val);
-  INLINE void enable_texturing(bool val);
-  INLINE void enable_scissor(bool val);
-  INLINE void enable_dither(bool val);
-  INLINE void enable_stencil_test(bool val);
-  INLINE void enable_clip_plane(int clip_plane, bool val);
-  INLINE void enable_multisample_alpha_one(bool val);
-  INLINE void enable_multisample_alpha_mask(bool val);
-  INLINE void enable_blend(bool val);
-  INLINE void enable_depth_test(bool val);
-  INLINE void enable_fog(bool val);
-  INLINE void enable_alpha_test(bool val);
-  INLINE void enable_polygon_offset(bool val);
-
-  INLINE GLenum get_light_id(int index) const;
-  INLINE GLenum get_clip_plane_id(int index) const;
-
-  INLINE void issue_scene_graph_color();
-
-  void set_draw_buffer(const RenderBuffer &rb);
-  void set_read_buffer(const RenderBuffer &rb);
-
-  void bind_texture(TextureContext *tc);
-  void specify_texture(Texture *tex);
-  bool apply_texture_immediate(Texture *tex);
-
-  GLenum get_texture_wrap_mode(Texture::WrapMode wm);
-  GLenum get_texture_filter_type(Texture::FilterType ft);
-  GLenum get_image_type(PixelBuffer::Type type);
-  GLenum get_external_image_format(PixelBuffer::Format format);
-  GLenum get_internal_image_format(PixelBuffer::Format format);
-  GLint get_texture_apply_mode_type( TextureApplyProperty::Mode am ) const;
-  GLint get_texture_apply_mode_type(TextureApplyAttrib::Mode am) const;
-  GLenum get_depth_func_type(DepthTestProperty::Mode m) const;
-  GLenum get_depth_func_type(DepthTestAttrib::Mode m) const;
-  GLenum get_stencil_func_type(StencilProperty::Mode m) const;
-  GLenum get_stencil_action_type(StencilProperty::Action a) const;
-  GLenum get_fog_mode_type(Fog::Mode m) const;
-
-#ifndef NDEBUG
-  void build_phony_mipmaps(Texture *tex);
-  void build_phony_mipmap_level(int level, int xsize, int ysize);
-  void save_mipmap_images(Texture *tex);
-#endif
-
-  GLclampf _clear_color_red, _clear_color_green, _clear_color_blue,
-    _clear_color_alpha;
-  GLclampd _clear_depth;
-  GLint _clear_stencil;
-  GLclampf _clear_accum_red, _clear_accum_green, _clear_accum_blue,
-    _clear_accum_alpha;
-  GLenum _draw_buffer_mode;
-  GLenum _read_buffer_mode;
-  GLenum _shade_model_mode;
-  GLint _scissor_x;
-  GLint _scissor_y;
-  GLsizei _scissor_width;
-  GLsizei _scissor_height;
-  GLint _viewport_x;
-  GLint _viewport_y;
-  GLsizei _viewport_width;
-  GLsizei _viewport_height;
-  GLboolean _lmodel_local;
-  GLboolean _lmodel_twoside;
-  Colorf _material_ambient;
-  Colorf _material_diffuse;
-  Colorf _material_specular;
-  float _material_shininess;
-  Colorf _material_emission;
-  GLenum _stencil_func;
-  GLenum _stencil_op;
-  GLfloat _line_width;
-  GLfloat _point_size;
-  GLenum _blend_source_func;
-  GLenum _blend_dest_func;
-  GLboolean _depth_mask;
-  GLint _fog_mode;
-  GLfloat _fog_start;
-  GLfloat _fog_end;
-  GLfloat _fog_density;
-  Colorf _fog_color;
-  GLenum _alpha_func;
-  GLclampf _alpha_func_ref;
-  GLenum _polygon_mode;
-
-  GLint _pack_alignment;
-  GLint _unpack_alignment;
-
-  bool _multisample_enabled;
-  bool _line_smooth_enabled;
-  bool _point_smooth_enabled;
-  bool _scissor_enabled;
-  bool _texturing_enabled;
-  bool _dither_enabled;
-  bool _stencil_test_enabled;
-  bool _multisample_alpha_one_enabled;
-  bool _multisample_alpha_mask_enabled;
-  bool _blend_enabled;
-  bool _depth_test_enabled;
-  bool _fog_enabled;
-  bool _dithering_enabled;
-  bool _alpha_test_enabled;
-  bool _polygon_offset_enabled;
-  int _decal_level;
-
-  int _cur_light_id;
-
-  LMatrix4f _current_projection_mat;
-  int _projection_mat_stack_count;
-
-  int _max_clip_planes;
-  PTA(PlaneNode *)_available_clip_plane_ids;  // pPlaneNode[_max_clip_planes]
-  bool *_clip_plane_enabled;              // bool[_max_clip_planes]
-  bool *_cur_clip_plane_enabled;          // bool[_max_clip_planes]
-  int _cur_clip_plane_id;
-
-  CPT(DisplayRegion) _actual_display_region;
-
-  int _pass_number;
-
-public:
-  static GraphicsStateGuardian *
-  make_GlGraphicsStateGuardian(const FactoryParams &params);
-
-  static TypeHandle get_class_type(void);
-  static void init_type(void);
-  virtual TypeHandle get_type(void) const;
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-  static PStatCollector _vertices_display_list_pcollector;
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#ifdef DO_PSTATS
-#define DO_PSTATS_STUFF(XX) XX;
-#else
-#define DO_PSTATS_STUFF(XX)
-#endif
-
-#include "crGraphicsStateGuardian.I"
-
-#endif
-

+ 0 - 39
panda/src/crgsg/crSavedFrameBuffer.I

@@ -1,39 +0,0 @@
-// Filename: chromium.SavedFrameBuffer.I
-// Created by:  drose (06Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRSavedFrameBuffer::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE CRSavedFrameBuffer::
-CRSavedFrameBuffer(const RenderBuffer &buffer, CPT(DisplayRegion) dr) :
-  SavedFrameBuffer(buffer, dr)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRSavedFrameBuffer::Destructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE CRSavedFrameBuffer::
-~CRSavedFrameBuffer() {
-}
-

+ 0 - 21
panda/src/crgsg/crSavedFrameBuffer.cxx

@@ -1,21 +0,0 @@
-// Filename: chromium.SavedFrameBuffer.cxx
-// Created by:  drose (06Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "crSavedFrameBuffer.h"
-
-TypeHandle CRSavedFrameBuffer::_type_handle;

+ 0 - 31
panda/src/crgsg/crTextureContext.I

@@ -1,31 +0,0 @@
-// Filename: chromium.TextureContext.I
-// Created by:  drose (07Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CRTextureContext::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE CRTextureContext::
-CRTextureContext(Texture *tex) :
-  TextureContext(tex)
-{
-  _index = 0;
-  _priority = 0.5; // For keeping resident in texture memory
-}

+ 0 - 21
panda/src/crgsg/crTextureContext.cxx

@@ -1,21 +0,0 @@
-// Filename: chromium.TextureContext.cxx
-// Created by:  drose (07Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "crTextureContext.h"
-
-TypeHandle CRTextureContext::_type_handle;

+ 0 - 79
panda/src/crgsg/crTextureContext.h

@@ -1,79 +0,0 @@
-// Filename: chromium.TextureContext.h
-// Created by:  drose (07Oct99)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef CRTEXTURECONTEXT_H
-#define CRTEXTURECONTEXT_H
-
-#include "pandabase.h"
-
-#ifdef WIN32_VC
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-
-#include <GL/gl.h>
-// Chromium specific
-#ifdef WIN32_VC // [
-#define WINDOWS 1
-#endif //]
-#include "cr_glwrapper.h"
-#include "cr_applications.h"
-#include "cr_spu.h"
-extern SPUDispatchTable chromium;
-
-#include "textureContext.h"
-
-////////////////////////////////////////////////////////////////////
-//       Class : CRTextureContext
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDACR CRTextureContext : public TextureContext {
-public:
-  INLINE CRTextureContext(Texture *tex);
-
-  // This is the GL "name" of the texture object.
-  GLuint _index;
-
-  // This is a GL texture priority.
-  GLfloat _priority;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    TextureContext::init_type();
-    register_type(_type_handle, "CRTextureContext",
-                  TextureContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "crTextureContext.I"
-
-#endif
-

+ 0 - 946
panda/src/crgsg/create_crgsg.py

@@ -1,946 +0,0 @@
-#!python
-
-import re
-
-files=(
-    "config_%(n)sgsg.cxx",
-    "config_%(n)sgsg.h",
-    "%(n)sGeomNodeContext.I",
-    "%(n)sGeomNodeContext.cxx",
-    "%(n)sGeomNodeContext.h",
-    "%(n)sGraphicsStateGuardian.I",
-    "%(n)sGraphicsStateGuardian.cxx",
-    "%(n)sGraphicsStateGuardian.h",
-    "%(n)sSavedFrameBuffer.I",
-    "%(n)sSavedFrameBuffer.cxx",
-    "%(n)sSavedFrameBuffer.h",
-    "%(n)sTextureContext.I",
-    "%(n)sTextureContext.cxx",
-    "%(n)sTextureContext.h",
-    "%(n)sext.h",
-    "%(n)sgsg_composite1.cxx",
-    #"Sources.pp",
-)
-
-conversion=(
-    ("\"gl([A-Z])", "\"cr\\1"),
-    ("\\bgl([A-Z])", "chromium.\\1"),
-    ("\\bGL([A-TV-Z])", "CR\\1"),
-    ("glgsg", "crgsg"),
-    ("gl_", "cr_"),
-    ("gl-", "cr-"),
-    #("GL_", "CR_"),
-    ("PANDAGL", "PANDACR"),
-    ("#include <GL/gl.h>", """
-#include <GL/gl.h>
-// Chromium specific
-#ifdef WIN32_VC // [
-#define WINDOWS 1
-#endif //]
-#include "cr_glwrapper.h"
-#include "cr_applications.h"
-#include "cr_spu.h"
-extern SPUDispatchTable chromium;
-"""),
-    ("(TypeHandle CRGraphicsStateGuardian::_type_handle;)", "\\1\nSPUDispatchTable chromium;"),
-)
-
-for fn in files:
-    destPath=fn%({"n":"cr"})
-    print destPath
-    # Read the file:
-    f=open("../glgsg/"+(fn)%({"n":"gl"}), "rb")
-    text=f.read()
-    f.close()
-    
-    # Convert the text:
-    for i in conversion:
-        text=re.sub(i[0], i[1], text)
-    
-    # Write the file:
-    dest=open(destPath, "wb")
-    dest.write(text)
-    dest.close()
-
-
-
-
-
-"""
-    ("\\bglAccum", "chromium.Accum"),
-    ("\\bglActiveTextureARB", "chromium.ActiveTextureARB"),
-    ("\\bglAlphaFunc", "chromium.AlphaFunc"),
-    ("\\bglAreTexturesResident", "chromium.AreTexturesResident"),
-    ("\\bglArrayElement", "chromium.ArrayElement"),
-    ("\\bglBarrierCreate", "chromium.BarrierCreate"),
-    ("\\bglBarrierDestroy", "chromium.BarrierDestroy"),
-    ("\\bglBarrierExec", "chromium.BarrierExec"),
-    ("\\bglBegin", "chromium.Begin"),
-    ("\\bglBindTexture", "chromium.BindTexture"),
-    ("\\bglBitmap", "chromium.Bitmap"),
-    ("\\bglBlendColorEXT", "chromium.BlendColorEXT"),
-    ("\\bglBlendEquationEXT", "chromium.BlendEquationEXT"),
-    ("\\bglBlendFunc", "chromium.BlendFunc"),
-    ("\\bglBoundsInfo", "chromium.BoundsInfo"),
-    ("\\bglCallList", "chromium.CallList"),
-    ("\\bglCallLists", "chromium.CallLists"),
-    ("\\bglChromiumParameterfCR", "chromium.ChromiumParameterfCR"),
-    ("\\bglChromiumParameteriCR", "chromium.ChromiumParameteriCR"),
-    ("\\bglChromiumParametervCR", "chromium.ChromiumParametervCR"),
-    ("\\bglClear", "chromium.Clear"),
-    ("\\bglClearAccum", "chromium.ClearAccum"),
-    ("\\bglClearColor", "chromium.ClearColor"),
-    ("\\bglClearDepth", "chromium.ClearDepth"),
-    ("\\bglClearIndex", "chromium.ClearIndex"),
-    ("\\bglClearStencil", "chromium.ClearStencil"),
-    ("\\bglClientActiveTextureARB", "chromium.ClientActiveTextureARB"),
-    ("\\bglClipPlane", "chromium.ClipPlane"),
-    ("\\bglColor3b", "chromium.Color3b"),
-    ("\\bglColor3bv", "chromium.Color3bv"),
-    ("\\bglColor3d", "chromium.Color3d"),
-    ("\\bglColor3dv", "chromium.Color3dv"),
-    ("\\bglColor3f", "chromium.Color3f"),
-    ("\\bglColor3fv", "chromium.Color3fv"),
-    ("\\bglColor3i", "chromium.Color3i"),
-    ("\\bglColor3iv", "chromium.Color3iv"),
-    ("\\bglColor3s", "chromium.Color3s"),
-    ("\\bglColor3sv", "chromium.Color3sv"),
-    ("\\bglColor3ub", "chromium.Color3ub"),
-    ("\\bglColor3ubv", "chromium.Color3ubv"),
-    ("\\bglColor3ui", "chromium.Color3ui"),
-    ("\\bglColor3uiv", "chromium.Color3uiv"),
-    ("\\bglColor3us", "chromium.Color3us"),
-    ("\\bglColor3usv", "chromium.Color3usv"),
-    ("\\bglColor4b", "chromium.Color4b"),
-    ("\\bglColor4bv", "chromium.Color4bv"),
-    ("\\bglColor4d", "chromium.Color4d"),
-    ("\\bglColor4dv", "chromium.Color4dv"),
-    ("\\bglColor4f", "chromium.Color4f"),
-    ("\\bglColor4fv", "chromium.Color4fv"),
-    ("\\bglColor4i", "chromium.Color4i"),
-    ("\\bglColor4iv", "chromium.Color4iv"),
-    ("\\bglColor4s", "chromium.Color4s"),
-    ("\\bglColor4sv", "chromium.Color4sv"),
-    ("\\bglColor4ub", "chromium.Color4ub"),
-    ("\\bglColor4ubv", "chromium.Color4ubv"),
-    ("\\bglColor4ui", "chromium.Color4ui"),
-    ("\\bglColor4uiv", "chromium.Color4uiv"),
-    ("\\bglColor4us", "chromium.Color4us"),
-    ("\\bglColor4usv", "chromium.Color4usv"),
-    ("\\bglColorMask", "chromium.ColorMask"),
-    ("\\bglColorMaterial", "chromium.ColorMaterial"),
-    ("\\bglColorPointer", "chromium.ColorPointer"),
-    ("\\bglCombinerInputNV", "chromium.CombinerInputNV"),
-    ("\\bglCombinerOutputNV", "chromium.CombinerOutputNV"),
-    ("\\bglCombinerParameterfNV", "chromium.CombinerParameterfNV"),
-    ("\\bglCombinerParameterfvNV", "chromium.CombinerParameterfvNV"),
-    ("\\bglCombinerParameteriNV", "chromium.CombinerParameteriNV"),
-    ("\\bglCombinerParameterivNV", "chromium.CombinerParameterivNV"),
-    ("\\bglCombinerStageParameterfvNV", "chromium.CombinerStageParameterfvNV"),
-    ("\\bglCopyPixels", "chromium.CopyPixels"),
-    ("\\bglCopyTexImage1D", "chromium.CopyTexImage1D"),
-    ("\\bglCopyTexImage2D", "chromium.CopyTexImage2D"),
-    ("\\bglCopyTexSubImage1D", "chromium.CopyTexSubImage1D"),
-    ("\\bglCopyTexSubImage2D", "chromium.CopyTexSubImage2D"),
-    ("\\bglCreateContext", "chromium.CreateContext"),
-    ("\\bglCullFace", "chromium.CullFace"),
-    ("\\bglDeleteLists", "chromium.DeleteLists"),
-    ("\\bglDeleteTextures", "chromium.DeleteTextures"),
-    ("\\bglDepthFunc", "chromium.DepthFunc"),
-    ("\\bglDepthMask", "chromium.DepthMask"),
-    ("\\bglDepthRange", "chromium.DepthRange"),
-    ("\\bglDestroyContext", "chromium.DestroyContext"),
-    ("\\bglDisable", "chromium.Disable"),
-    ("\\bglDisableClientState", "chromium.DisableClientState"),
-    ("\\bglDrawArrays", "chromium.DrawArrays"),
-    ("\\bglDrawBuffer", "chromium.DrawBuffer"),
-    ("\\bglDrawElements", "chromium.DrawElements"),
-    ("\\bglDrawPixels", "chromium.DrawPixels"),
-    ("\\bglDrawRangeElements", "chromium.DrawRangeElements"),
-    ("\\bglEdgeFlag", "chromium.EdgeFlag"),
-    ("\\bglEdgeFlagPointer", "chromium.EdgeFlagPointer"),
-    ("\\bglEdgeFlagv", "chromium.EdgeFlagv"),
-    ("\\bglEnable", "chromium.Enable"),
-    ("\\bglEnableClientState", "chromium.EnableClientState"),
-    ("\\bglEnd", "chromium.End"),
-    ("\\bglEndList", "chromium.EndList"),
-    ("\\bglEvalCoord1d", "chromium.EvalCoord1d"),
-    ("\\bglEvalCoord1dv", "chromium.EvalCoord1dv"),
-    ("\\bglEvalCoord1f", "chromium.EvalCoord1f"),
-    ("\\bglEvalCoord1fv", "chromium.EvalCoord1fv"),
-    ("\\bglEvalCoord2d", "chromium.EvalCoord2d"),
-    ("\\bglEvalCoord2dv", "chromium.EvalCoord2dv"),
-    ("\\bglEvalCoord2f", "chromium.EvalCoord2f"),
-    ("\\bglEvalCoord2fv", "chromium.EvalCoord2fv"),
-    ("\\bglEvalMesh1", "chromium.EvalMesh1"),
-    ("\\bglEvalMesh2", "chromium.EvalMesh2"),
-    ("\\bglEvalPoint1", "chromium.EvalPoint1"),
-    ("\\bglEvalPoint2", "chromium.EvalPoint2"),
-    ("\\bglFeedbackBuffer", "chromium.FeedbackBuffer"),
-    ("\\bglFinalCombinerInputNV", "chromium.FinalCombinerInputNV"),
-    ("\\bglFinish", "chromium.Finish"),
-    ("\\bglFlush", "chromium.Flush"),
-    ("\\bglFogf", "chromium.Fogf"),
-    ("\\bglFogfv", "chromium.Fogfv"),
-    ("\\bglFogi", "chromium.Fogi"),
-    ("\\bglFogiv", "chromium.Fogiv"),
-    ("\\bglFrontFace", "chromium.FrontFace"),
-    ("\\bglFrustum", "chromium.Frustum"),
-    ("\\bglGenLists", "chromium.GenLists"),
-    ("\\bglGenTextures", "chromium.GenTextures"),
-    ("\\bglGetBooleanv", "chromium.GetBooleanv"),
-    ("\\bglGetChromiumParametervCR", "chromium.GetChromiumParametervCR"),
-    ("\\bglGetClipPlane", "chromium.GetClipPlane"),
-    ("\\bglGetCombinerInputParameterfvNV", "chromium.GetCombinerInputParameterfvNV"),
-    ("\\bglGetCombinerInputParameterivNV", "chromium.GetCombinerInputParameterivNV"),
-    ("\\bglGetCombinerOutputParameterfvNV", "chromium.GetCombinerOutputParameterfvNV"),
-    ("\\bglGetCombinerOutputParameterivNV", "chromium.GetCombinerOutputParameterivNV"),
-    ("\\bglGetCombinerStageParameterfvNV", "chromium.GetCombinerStageParameterfvNV"),
-    ("\\bglGetDoublev", "chromium.GetDoublev"),
-    ("\\bglGetError", "chromium.GetError"),
-    ("\\bglGetFinalCombinerInputParameterfvNV", "chromium.GetFinalCombinerInputParameterfvNV"),
-    ("\\bglGetFinalCombinerInputParameterivNV", "chromium.GetFinalCombinerInputParameterivNV"),
-    ("\\bglGetFloatv", "chromium.GetFloatv"),
-    ("\\bglGetIntegerv", "chromium.GetIntegerv"),
-    ("\\bglGetLightfv", "chromium.GetLightfv"),
-    ("\\bglGetLightiv", "chromium.GetLightiv"),
-    ("\\bglGetMapdv", "chromium.GetMapdv"),
-    ("\\bglGetMapfv", "chromium.GetMapfv"),
-    ("\\bglGetMapiv", "chromium.GetMapiv"),
-    ("\\bglGetMaterialfv", "chromium.GetMaterialfv"),
-    ("\\bglGetMaterialiv", "chromium.GetMaterialiv"),
-    ("\\bglGetPixelMapfv", "chromium.GetPixelMapfv"),
-    ("\\bglGetPixelMapuiv", "chromium.GetPixelMapuiv"),
-    ("\\bglGetPixelMapusv", "chromium.GetPixelMapusv"),
-    ("\\bglGetPointerv", "chromium.GetPointerv"),
-    ("\\bglGetPolygonStipple", "chromium.GetPolygonStipple"),
-    ("\\bglGetString", "chromium.GetString"),
-    ("\\bglGetTexEnvfv", "chromium.GetTexEnvfv"),
-    ("\\bglGetTexEnviv", "chromium.GetTexEnviv"),
-    ("\\bglGetTexGendv", "chromium.GetTexGendv"),
-    ("\\bglGetTexGenfv", "chromium.GetTexGenfv"),
-    ("\\bglGetTexGeniv", "chromium.GetTexGeniv"),
-    ("\\bglGetTexImage", "chromium.GetTexImage"),
-    ("\\bglGetTexLevelParameterfv", "chromium.GetTexLevelParameterfv"),
-    ("\\bglGetTexLevelParameteriv", "chromium.GetTexLevelParameteriv"),
-    ("\\bglGetTexParameterfv", "chromium.GetTexParameterfv"),
-    ("\\bglGetTexParameteriv", "chromium.GetTexParameteriv"),
-    ("\\bglHint", "chromium.Hint"),
-    ("\\bglIndexMask", "chromium.IndexMask"),
-    ("\\bglIndexPointer", "chromium.IndexPointer"),
-    ("\\bglIndexd", "chromium.Indexd"),
-    ("\\bglIndexdv", "chromium.Indexdv"),
-    ("\\bglIndexf", "chromium.Indexf"),
-    ("\\bglIndexfv", "chromium.Indexfv"),
-    ("\\bglIndexi", "chromium.Indexi"),
-    ("\\bglIndexiv", "chromium.Indexiv"),
-    ("\\bglIndexs", "chromium.Indexs"),
-    ("\\bglIndexsv", "chromium.Indexsv"),
-    ("\\bglIndexub", "chromium.Indexub"),
-    ("\\bglIndexubv", "chromium.Indexubv"),
-    ("\\bglInitNames", "chromium.InitNames"),
-    ("\\bglInterleavedArrays", "chromium.InterleavedArrays"),
-    ("\\bglIsEnabled", "chromium.IsEnabled"),
-    ("\\bglIsList", "chromium.IsList"),
-    ("\\bglIsTexture", "chromium.IsTexture"),
-    ("\\bglLightModelf", "chromium.LightModelf"),
-    ("\\bglLightModelfv", "chromium.LightModelfv"),
-    ("\\bglLightModeli", "chromium.LightModeli"),
-    ("\\bglLightModeliv", "chromium.LightModeliv"),
-    ("\\bglLightf", "chromium.Lightf"),
-    ("\\bglLightfv", "chromium.Lightfv"),
-    ("\\bglLighti", "chromium.Lighti"),
-    ("\\bglLightiv", "chromium.Lightiv"),
-    ("\\bglLineStipple", "chromium.LineStipple"),
-    ("\\bglLineWidth", "chromium.LineWidth"),
-    ("\\bglListBase", "chromium.ListBase"),
-    ("\\bglLoadIdentity", "chromium.LoadIdentity"),
-    ("\\bglLoadMatrixd", "chromium.LoadMatrixd"),
-    ("\\bglLoadMatrixf", "chromium.LoadMatrixf"),
-    ("\\bglLoadName", "chromium.LoadName"),
-    ("\\bglLogicOp", "chromium.LogicOp"),
-    ("\\bglMakeCurrent", "chromium.MakeCurrent"),
-    ("\\bglMap1d", "chromium.Map1d"),
-    ("\\bglMap1f", "chromium.Map1f"),
-    ("\\bglMap2d", "chromium.Map2d"),
-    ("\\bglMap2f", "chromium.Map2f"),
-    ("\\bglMapGrid1d", "chromium.MapGrid1d"),
-    ("\\bglMapGrid1f", "chromium.MapGrid1f"),
-    ("\\bglMapGrid2d", "chromium.MapGrid2d"),
-    ("\\bglMapGrid2f", "chromium.MapGrid2f"),
-    ("\\bglMaterialf", "chromium.Materialf"),
-    ("\\bglMaterialfv", "chromium.Materialfv"),
-    ("\\bglMateriali", "chromium.Materiali"),
-    ("\\bglMaterialiv", "chromium.Materialiv"),
-    ("\\bglMatrixMode", "chromium.MatrixMode"),
-    ("\\bglMultMatrixd", "chromium.MultMatrixd"),
-    ("\\bglMultMatrixf", "chromium.MultMatrixf"),
-    ("\\bglMultiTexCoord1dARB", "chromium.MultiTexCoord1dARB"),
-    ("\\bglMultiTexCoord1dvARB", "chromium.MultiTexCoord1dvARB"),
-    ("\\bglMultiTexCoord1fARB", "chromium.MultiTexCoord1fARB"),
-    ("\\bglMultiTexCoord1fvARB", "chromium.MultiTexCoord1fvARB"),
-    ("\\bglMultiTexCoord1iARB", "chromium.MultiTexCoord1iARB"),
-    ("\\bglMultiTexCoord1ivARB", "chromium.MultiTexCoord1ivARB"),
-    ("\\bglMultiTexCoord1sARB", "chromium.MultiTexCoord1sARB"),
-    ("\\bglMultiTexCoord1svARB", "chromium.MultiTexCoord1svARB"),
-    ("\\bglMultiTexCoord2dARB", "chromium.MultiTexCoord2dARB"),
-    ("\\bglMultiTexCoord2dvARB", "chromium.MultiTexCoord2dvARB"),
-    ("\\bglMultiTexCoord2fARB", "chromium.MultiTexCoord2fARB"),
-    ("\\bglMultiTexCoord2fvARB", "chromium.MultiTexCoord2fvARB"),
-    ("\\bglMultiTexCoord2iARB", "chromium.MultiTexCoord2iARB"),
-    ("\\bglMultiTexCoord2ivARB", "chromium.MultiTexCoord2ivARB"),
-    ("\\bglMultiTexCoord2sARB", "chromium.MultiTexCoord2sARB"),
-    ("\\bglMultiTexCoord2svARB", "chromium.MultiTexCoord2svARB"),
-    ("\\bglMultiTexCoord3dARB", "chromium.MultiTexCoord3dARB"),
-    ("\\bglMultiTexCoord3dvARB", "chromium.MultiTexCoord3dvARB"),
-    ("\\bglMultiTexCoord3fARB", "chromium.MultiTexCoord3fARB"),
-    ("\\bglMultiTexCoord3fvARB", "chromium.MultiTexCoord3fvARB"),
-    ("\\bglMultiTexCoord3iARB", "chromium.MultiTexCoord3iARB"),
-    ("\\bglMultiTexCoord3ivARB", "chromium.MultiTexCoord3ivARB"),
-    ("\\bglMultiTexCoord3sARB", "chromium.MultiTexCoord3sARB"),
-    ("\\bglMultiTexCoord3svARB", "chromium.MultiTexCoord3svARB"),
-    ("\\bglMultiTexCoord4dARB", "chromium.MultiTexCoord4dARB"),
-    ("\\bglMultiTexCoord4dvARB", "chromium.MultiTexCoord4dvARB"),
-    ("\\bglMultiTexCoord4fARB", "chromium.MultiTexCoord4fARB"),
-    ("\\bglMultiTexCoord4fvARB", "chromium.MultiTexCoord4fvARB"),
-    ("\\bglMultiTexCoord4iARB", "chromium.MultiTexCoord4iARB"),
-    ("\\bglMultiTexCoord4ivARB", "chromium.MultiTexCoord4ivARB"),
-    ("\\bglMultiTexCoord4sARB", "chromium.MultiTexCoord4sARB"),
-    ("\\bglMultiTexCoord4svARB", "chromium.MultiTexCoord4svARB"),
-    ("\\bglNewList", "chromium.NewList"),
-    ("\\bglNormal3b", "chromium.Normal3b"),
-    ("\\bglNormal3bv", "chromium.Normal3bv"),
-    ("\\bglNormal3d", "chromium.Normal3d"),
-    ("\\bglNormal3dv", "chromium.Normal3dv"),
-    ("\\bglNormal3f", "chromium.Normal3f"),
-    ("\\bglNormal3fv", "chromium.Normal3fv"),
-    ("\\bglNormal3i", "chromium.Normal3i"),
-    ("\\bglNormal3iv", "chromium.Normal3iv"),
-    ("\\bglNormal3s", "chromium.Normal3s"),
-    ("\\bglNormal3sv", "chromium.Normal3sv"),
-    ("\\bglNormalPointer", "chromium.NormalPointer"),
-    ("\\bglOrtho", "chromium.Ortho"),
-    ("\\bglPassThrough", "chromium.PassThrough"),
-    ("\\bglPixelMapfv", "chromium.PixelMapfv"),
-    ("\\bglPixelMapuiv", "chromium.PixelMapuiv"),
-    ("\\bglPixelMapusv", "chromium.PixelMapusv"),
-    ("\\bglPixelStoref", "chromium.PixelStoref"),
-    ("\\bglPixelStorei", "chromium.PixelStorei"),
-    ("\\bglPixelTransferf", "chromium.PixelTransferf"),
-    ("\\bglPixelTransferi", "chromium.PixelTransferi"),
-    ("\\bglPixelZoom", "chromium.PixelZoom"),
-    ("\\bglPointSize", "chromium.PointSize"),
-    ("\\bglPolygonMode", "chromium.PolygonMode"),
-    ("\\bglPolygonOffset", "chromium.PolygonOffset"),
-    ("\\bglPolygonStipple", "chromium.PolygonStipple"),
-    ("\\bglPopAttrib", "chromium.PopAttrib"),
-    ("\\bglPopClientAttrib", "chromium.PopClientAttrib"),
-    ("\\bglPopMatrix", "chromium.PopMatrix"),
-    ("\\bglPopName", "chromium.PopName"),
-    ("\\bglPrioritizeTextures", "chromium.PrioritizeTextures"),
-    ("\\bglPushAttrib", "chromium.PushAttrib"),
-    ("\\bglPushClientAttrib", "chromium.PushClientAttrib"),
-    ("\\bglPushMatrix", "chromium.PushMatrix"),
-    ("\\bglPushName", "chromium.PushName"),
-    ("\\bglRasterPos2d", "chromium.RasterPos2d"),
-    ("\\bglRasterPos2dv", "chromium.RasterPos2dv"),
-    ("\\bglRasterPos2f", "chromium.RasterPos2f"),
-    ("\\bglRasterPos2fv", "chromium.RasterPos2fv"),
-    ("\\bglRasterPos2i", "chromium.RasterPos2i"),
-    ("\\bglRasterPos2iv", "chromium.RasterPos2iv"),
-    ("\\bglRasterPos2s", "chromium.RasterPos2s"),
-    ("\\bglRasterPos2sv", "chromium.RasterPos2sv"),
-    ("\\bglRasterPos3d", "chromium.RasterPos3d"),
-    ("\\bglRasterPos3dv", "chromium.RasterPos3dv"),
-    ("\\bglRasterPos3f", "chromium.RasterPos3f"),
-    ("\\bglRasterPos3fv", "chromium.RasterPos3fv"),
-    ("\\bglRasterPos3i", "chromium.RasterPos3i"),
-    ("\\bglRasterPos3iv", "chromium.RasterPos3iv"),
-    ("\\bglRasterPos3s", "chromium.RasterPos3s"),
-    ("\\bglRasterPos3sv", "chromium.RasterPos3sv"),
-    ("\\bglRasterPos4d", "chromium.RasterPos4d"),
-    ("\\bglRasterPos4dv", "chromium.RasterPos4dv"),
-    ("\\bglRasterPos4f", "chromium.RasterPos4f"),
-    ("\\bglRasterPos4fv", "chromium.RasterPos4fv"),
-    ("\\bglRasterPos4i", "chromium.RasterPos4i"),
-    ("\\bglRasterPos4iv", "chromium.RasterPos4iv"),
-    ("\\bglRasterPos4s", "chromium.RasterPos4s"),
-    ("\\bglRasterPos4sv", "chromium.RasterPos4sv"),
-    ("\\bglReadBuffer", "chromium.ReadBuffer"),
-    ("\\bglReadPixels", "chromium.ReadPixels"),
-    ("\\bglRectd", "chromium.Rectd"),
-    ("\\bglRectdv", "chromium.Rectdv"),
-    ("\\bglRectf", "chromium.Rectf"),
-    ("\\bglRectfv", "chromium.Rectfv"),
-    ("\\bglRecti", "chromium.Recti"),
-    ("\\bglRectiv", "chromium.Rectiv"),
-    ("\\bglRects", "chromium.Rects"),
-    ("\\bglRectsv", "chromium.Rectsv"),
-    ("\\bglRenderMode", "chromium.RenderMode"),
-    ("\\bglRotated", "chromium.Rotated"),
-    ("\\bglRotatef", "chromium.Rotatef"),
-    ("\\bglScaled", "chromium.Scaled"),
-    ("\\bglScalef", "chromium.Scalef"),
-    ("\\bglScissor", "chromium.Scissor"),
-    ("\\bglSecondaryColor3bEXT", "chromium.SecondaryColor3bEXT"),
-    ("\\bglSecondaryColor3bvEXT", "chromium.SecondaryColor3bvEXT"),
-    ("\\bglSecondaryColor3dEXT", "chromium.SecondaryColor3dEXT"),
-    ("\\bglSecondaryColor3dvEXT", "chromium.SecondaryColor3dvEXT"),
-    ("\\bglSecondaryColor3fEXT", "chromium.SecondaryColor3fEXT"),
-    ("\\bglSecondaryColor3fvEXT", "chromium.SecondaryColor3fvEXT"),
-    ("\\bglSecondaryColor3iEXT", "chromium.SecondaryColor3iEXT"),
-    ("\\bglSecondaryColor3ivEXT", "chromium.SecondaryColor3ivEXT"),
-    ("\\bglSecondaryColor3sEXT", "chromium.SecondaryColor3sEXT"),
-    ("\\bglSecondaryColor3svEXT", "chromium.SecondaryColor3svEXT"),
-    ("\\bglSecondaryColor3ubEXT", "chromium.SecondaryColor3ubEXT"),
-    ("\\bglSecondaryColor3ubvEXT", "chromium.SecondaryColor3ubvEXT"),
-    ("\\bglSecondaryColor3uiEXT", "chromium.SecondaryColor3uiEXT"),
-    ("\\bglSecondaryColor3uivEXT", "chromium.SecondaryColor3uivEXT"),
-    ("\\bglSecondaryColor3usEXT", "chromium.SecondaryColor3usEXT"),
-    ("\\bglSecondaryColor3usvEXT", "chromium.SecondaryColor3usvEXT"),
-    ("\\bglSecondaryColorPointerEXT", "chromium.SecondaryColorPointerEXT"),
-    ("\\bglSelectBuffer", "chromium.SelectBuffer"),
-    ("\\bglSemaphoreCreate", "chromium.SemaphoreCreate"),
-    ("\\bglSemaphoreDestroy", "chromium.SemaphoreDestroy"),
-    ("\\bglSemaphoreP", "chromium.SemaphoreP"),
-    ("\\bglSemaphoreV", "chromium.SemaphoreV"),
-    ("\\bglShadeModel", "chromium.ShadeModel"),
-    ("\\bglStencilFunc", "chromium.StencilFunc"),
-    ("\\bglStencilMask", "chromium.StencilMask"),
-    ("\\bglStencilOp", "chromium.StencilOp"),
-    ("\\bglSwapBuffers", "chromium.SwapBuffers"),
-    ("\\bglTexCoord1d", "chromium.TexCoord1d"),
-    ("\\bglTexCoord1dv", "chromium.TexCoord1dv"),
-    ("\\bglTexCoord1f", "chromium.TexCoord1f"),
-    ("\\bglTexCoord1fv", "chromium.TexCoord1fv"),
-    ("\\bglTexCoord1i", "chromium.TexCoord1i"),
-    ("\\bglTexCoord1iv", "chromium.TexCoord1iv"),
-    ("\\bglTexCoord1s", "chromium.TexCoord1s"),
-    ("\\bglTexCoord1sv", "chromium.TexCoord1sv"),
-    ("\\bglTexCoord2d", "chromium.TexCoord2d"),
-    ("\\bglTexCoord2dv", "chromium.TexCoord2dv"),
-    ("\\bglTexCoord2f", "chromium.TexCoord2f"),
-    ("\\bglTexCoord2fv", "chromium.TexCoord2fv"),
-    ("\\bglTexCoord2i", "chromium.TexCoord2i"),
-    ("\\bglTexCoord2iv", "chromium.TexCoord2iv"),
-    ("\\bglTexCoord2s", "chromium.TexCoord2s"),
-    ("\\bglTexCoord2sv", "chromium.TexCoord2sv"),
-    ("\\bglTexCoord3d", "chromium.TexCoord3d"),
-    ("\\bglTexCoord3dv", "chromium.TexCoord3dv"),
-    ("\\bglTexCoord3f", "chromium.TexCoord3f"),
-    ("\\bglTexCoord3fv", "chromium.TexCoord3fv"),
-    ("\\bglTexCoord3i", "chromium.TexCoord3i"),
-    ("\\bglTexCoord3iv", "chromium.TexCoord3iv"),
-    ("\\bglTexCoord3s", "chromium.TexCoord3s"),
-    ("\\bglTexCoord3sv", "chromium.TexCoord3sv"),
-    ("\\bglTexCoord4d", "chromium.TexCoord4d"),
-    ("\\bglTexCoord4dv", "chromium.TexCoord4dv"),
-    ("\\bglTexCoord4f", "chromium.TexCoord4f"),
-    ("\\bglTexCoord4fv", "chromium.TexCoord4fv"),
-    ("\\bglTexCoord4i", "chromium.TexCoord4i"),
-    ("\\bglTexCoord4iv", "chromium.TexCoord4iv"),
-    ("\\bglTexCoord4s", "chromium.TexCoord4s"),
-    ("\\bglTexCoord4sv", "chromium.TexCoord4sv"),
-    ("\\bglTexCoordPointer", "chromium.TexCoordPointer"),
-    ("\\bglTexEnvf", "chromium.TexEnvf"),
-    ("\\bglTexEnvfv", "chromium.TexEnvfv"),
-    ("\\bglTexEnvi", "chromium.TexEnvi"),
-    ("\\bglTexEnviv", "chromium.TexEnviv"),
-    ("\\bglTexGend", "chromium.TexGend"),
-    ("\\bglTexGendv", "chromium.TexGendv"),
-    ("\\bglTexGenf", "chromium.TexGenf"),
-    ("\\bglTexGenfv", "chromium.TexGenfv"),
-    ("\\bglTexGeni", "chromium.TexGeni"),
-    ("\\bglTexGeniv", "chromium.TexGeniv"),
-    ("\\bglTexImage1D", "chromium.TexImage1D"),
-    ("\\bglTexImage2D", "chromium.TexImage2D"),
-    ("\\bglTexParameterf", "chromium.TexParameterf"),
-    ("\\bglTexParameterfv", "chromium.TexParameterfv"),
-    ("\\bglTexParameteri", "chromium.TexParameteri"),
-    ("\\bglTexParameteriv", "chromium.TexParameteriv"),
-    ("\\bglTexSubImage1D", "chromium.TexSubImage1D"),
-    ("\\bglTexSubImage2D", "chromium.TexSubImage2D"),
-    ("\\bglTranslated", "chromium.Translated"),
-    ("\\bglTranslatef", "chromium.Translatef"),
-    ("\\bglVertex2d", "chromium.Vertex2d"),
-    ("\\bglVertex2dv", "chromium.Vertex2dv"),
-    ("\\bglVertex2f", "chromium.Vertex2f"),
-    ("\\bglVertex2fv", "chromium.Vertex2fv"),
-    ("\\bglVertex2i", "chromium.Vertex2i"),
-    ("\\bglVertex2iv", "chromium.Vertex2iv"),
-    ("\\bglVertex2s", "chromium.Vertex2s"),
-    ("\\bglVertex2sv", "chromium.Vertex2sv"),
-    ("\\bglVertex3d", "chromium.Vertex3d"),
-    ("\\bglVertex3dv", "chromium.Vertex3dv"),
-    ("\\bglVertex3f", "chromium.Vertex3f"),
-    ("\\bglVertex3fv", "chromium.Vertex3fv"),
-    ("\\bglVertex3i", "chromium.Vertex3i"),
-    ("\\bglVertex3iv", "chromium.Vertex3iv"),
-    ("\\bglVertex3s", "chromium.Vertex3s"),
-    ("\\bglVertex3sv", "chromium.Vertex3sv"),
-    ("\\bglVertex4d", "chromium.Vertex4d"),
-    ("\\bglVertex4dv", "chromium.Vertex4dv"),
-    ("\\bglVertex4f", "chromium.Vertex4f"),
-    ("\\bglVertex4fv", "chromium.Vertex4fv"),
-    ("\\bglVertex4i", "chromium.Vertex4i"),
-    ("\\bglVertex4iv", "chromium.Vertex4iv"),
-    ("\\bglVertex4s", "chromium.Vertex4s"),
-    ("\\bglVertex4sv", "chromium.Vertex4sv"),
-    ("\\bglVertexPointer", "chromium.VertexPointer"),
-    ("\\bglViewport", "chromium.Viewport"),
-    ("\\bglWriteback", "chromium.Writeback"),
-
-
-#define glAccum chromium.Accum
-#define glActiveTextureARB chromium.ActiveTextureARB
-#define glAlphaFunc chromium.AlphaFunc
-#define glAreTexturesResident chromium.AreTexturesResident
-#define glArrayElement chromium.ArrayElement
-#define glBarrierCreate chromium.BarrierCreate
-#define glBarrierDestroy chromium.BarrierDestroy
-#define glBarrierExec chromium.BarrierExec
-#define glBegin chromium.Begin
-#define glBindTexture chromium.BindTexture
-#define glBitmap chromium.Bitmap
-#define glBlendColorEXT chromium.BlendColorEXT
-#define glBlendEquationEXT chromium.BlendEquationEXT
-#define glBlendFunc chromium.BlendFunc
-#define glBoundsInfo chromium.BoundsInfo
-#define glCallList chromium.CallList
-#define glCallLists chromium.CallLists
-#define glChromiumParameterfCR chromium.ChromiumParameterfCR
-#define glChromiumParameteriCR chromium.ChromiumParameteriCR
-#define glChromiumParametervCR chromium.ChromiumParametervCR
-#define glClear chromium.Clear
-#define glClearAccum chromium.ClearAccum
-#define glClearColor chromium.ClearColor
-#define glClearDepth chromium.ClearDepth
-#define glClearIndex chromium.ClearIndex
-#define glClearStencil chromium.ClearStencil
-#define glClientActiveTextureARB chromium.ClientActiveTextureARB
-#define glClipPlane chromium.ClipPlane
-#define glColor3b chromium.Color3b
-#define glColor3bv chromium.Color3bv
-#define glColor3d chromium.Color3d
-#define glColor3dv chromium.Color3dv
-#define glColor3f chromium.Color3f
-#define glColor3fv chromium.Color3fv
-#define glColor3i chromium.Color3i
-#define glColor3iv chromium.Color3iv
-#define glColor3s chromium.Color3s
-#define glColor3sv chromium.Color3sv
-#define glColor3ub chromium.Color3ub
-#define glColor3ubv chromium.Color3ubv
-#define glColor3ui chromium.Color3ui
-#define glColor3uiv chromium.Color3uiv
-#define glColor3us chromium.Color3us
-#define glColor3usv chromium.Color3usv
-#define glColor4b chromium.Color4b
-#define glColor4bv chromium.Color4bv
-#define glColor4d chromium.Color4d
-#define glColor4dv chromium.Color4dv
-#define glColor4f chromium.Color4f
-#define glColor4fv chromium.Color4fv
-#define glColor4i chromium.Color4i
-#define glColor4iv chromium.Color4iv
-#define glColor4s chromium.Color4s
-#define glColor4sv chromium.Color4sv
-#define glColor4ub chromium.Color4ub
-#define glColor4ubv chromium.Color4ubv
-#define glColor4ui chromium.Color4ui
-#define glColor4uiv chromium.Color4uiv
-#define glColor4us chromium.Color4us
-#define glColor4usv chromium.Color4usv
-#define glColorMask chromium.ColorMask
-#define glColorMaterial chromium.ColorMaterial
-#define glColorPointer chromium.ColorPointer
-#define glCombinerInputNV chromium.CombinerInputNV
-#define glCombinerOutputNV chromium.CombinerOutputNV
-#define glCombinerParameterfNV chromium.CombinerParameterfNV
-#define glCombinerParameterfvNV chromium.CombinerParameterfvNV
-#define glCombinerParameteriNV chromium.CombinerParameteriNV
-#define glCombinerParameterivNV chromium.CombinerParameterivNV
-#define glCombinerStageParameterfvNV chromium.CombinerStageParameterfvNV
-#define glCopyPixels chromium.CopyPixels
-#define glCopyTexImage1D chromium.CopyTexImage1D
-#define glCopyTexImage2D chromium.CopyTexImage2D
-#define glCopyTexSubImage1D chromium.CopyTexSubImage1D
-#define glCopyTexSubImage2D chromium.CopyTexSubImage2D
-#define glCreateContext chromium.CreateContext
-#define glCullFace chromium.CullFace
-#define glDeleteLists chromium.DeleteLists
-#define glDeleteTextures chromium.DeleteTextures
-#define glDepthFunc chromium.DepthFunc
-#define glDepthMask chromium.DepthMask
-#define glDepthRange chromium.DepthRange
-#define glDestroyContext chromium.DestroyContext
-#define glDisable chromium.Disable
-#define glDisableClientState chromium.DisableClientState
-#define glDrawArrays chromium.DrawArrays
-#define glDrawBuffer chromium.DrawBuffer
-#define glDrawElements chromium.DrawElements
-#define glDrawPixels chromium.DrawPixels
-#define glDrawRangeElements chromium.DrawRangeElements
-#define glEdgeFlag chromium.EdgeFlag
-#define glEdgeFlagPointer chromium.EdgeFlagPointer
-#define glEdgeFlagv chromium.EdgeFlagv
-#define glEnable chromium.Enable
-#define glEnableClientState chromium.EnableClientState
-#define glEnd chromium.End
-#define glEndList chromium.EndList
-#define glEvalCoord1d chromium.EvalCoord1d
-#define glEvalCoord1dv chromium.EvalCoord1dv
-#define glEvalCoord1f chromium.EvalCoord1f
-#define glEvalCoord1fv chromium.EvalCoord1fv
-#define glEvalCoord2d chromium.EvalCoord2d
-#define glEvalCoord2dv chromium.EvalCoord2dv
-#define glEvalCoord2f chromium.EvalCoord2f
-#define glEvalCoord2fv chromium.EvalCoord2fv
-#define glEvalMesh1 chromium.EvalMesh1
-#define glEvalMesh2 chromium.EvalMesh2
-#define glEvalPoint1 chromium.EvalPoint1
-#define glEvalPoint2 chromium.EvalPoint2
-#define glFeedbackBuffer chromium.FeedbackBuffer
-#define glFinalCombinerInputNV chromium.FinalCombinerInputNV
-#define glFinish chromium.Finish
-#define glFlush chromium.Flush
-#define glFogf chromium.Fogf
-#define glFogfv chromium.Fogfv
-#define glFogi chromium.Fogi
-#define glFogiv chromium.Fogiv
-#define glFrontFace chromium.FrontFace
-#define glFrustum chromium.Frustum
-#define glGenLists chromium.GenLists
-#define glGenTextures chromium.GenTextures
-#define glGetBooleanv chromium.GetBooleanv
-#define glGetChromiumParametervCR chromium.GetChromiumParametervCR
-#define glGetClipPlane chromium.GetClipPlane
-#define glGetCombinerInputParameterfvNV chromium.GetCombinerInputParameterfvNV
-#define glGetCombinerInputParameterivNV chromium.GetCombinerInputParameterivNV
-#define glGetCombinerOutputParameterfvNV chromium.GetCombinerOutputParameterfvNV
-#define glGetCombinerOutputParameterivNV chromium.GetCombinerOutputParameterivNV
-#define glGetCombinerStageParameterfvNV chromium.GetCombinerStageParameterfvNV
-#define glGetDoublev chromium.GetDoublev
-#define glGetError chromium.GetError
-#define glGetFinalCombinerInputParameterfvNV chromium.GetFinalCombinerInputParameterfvNV
-#define glGetFinalCombinerInputParameterivNV chromium.GetFinalCombinerInputParameterivNV
-#define glGetFloatv chromium.GetFloatv
-#define glGetIntegerv chromium.GetIntegerv
-#define glGetLightfv chromium.GetLightfv
-#define glGetLightiv chromium.GetLightiv
-#define glGetMapdv chromium.GetMapdv
-#define glGetMapfv chromium.GetMapfv
-#define glGetMapiv chromium.GetMapiv
-#define glGetMaterialfv chromium.GetMaterialfv
-#define glGetMaterialiv chromium.GetMaterialiv
-#define glGetPixelMapfv chromium.GetPixelMapfv
-#define glGetPixelMapuiv chromium.GetPixelMapuiv
-#define glGetPixelMapusv chromium.GetPixelMapusv
-#define glGetPointerv chromium.GetPointerv
-#define glGetPolygonStipple chromium.GetPolygonStipple
-#define glGetString chromium.GetString
-#define glGetTexEnvfv chromium.GetTexEnvfv
-#define glGetTexEnviv chromium.GetTexEnviv
-#define glGetTexGendv chromium.GetTexGendv
-#define glGetTexGenfv chromium.GetTexGenfv
-#define glGetTexGeniv chromium.GetTexGeniv
-#define glGetTexImage chromium.GetTexImage
-#define glGetTexLevelParameterfv chromium.GetTexLevelParameterfv
-#define glGetTexLevelParameteriv chromium.GetTexLevelParameteriv
-#define glGetTexParameterfv chromium.GetTexParameterfv
-#define glGetTexParameteriv chromium.GetTexParameteriv
-#define glHint chromium.Hint
-#define glIndexMask chromium.IndexMask
-#define glIndexPointer chromium.IndexPointer
-#define glIndexd chromium.Indexd
-#define glIndexdv chromium.Indexdv
-#define glIndexf chromium.Indexf
-#define glIndexfv chromium.Indexfv
-#define glIndexi chromium.Indexi
-#define glIndexiv chromium.Indexiv
-#define glIndexs chromium.Indexs
-#define glIndexsv chromium.Indexsv
-#define glIndexub chromium.Indexub
-#define glIndexubv chromium.Indexubv
-#define glInitNames chromium.InitNames
-#define glInterleavedArrays chromium.InterleavedArrays
-#define glIsEnabled chromium.IsEnabled
-#define glIsList chromium.IsList
-#define glIsTexture chromium.IsTexture
-#define glLightModelf chromium.LightModelf
-#define glLightModelfv chromium.LightModelfv
-#define glLightModeli chromium.LightModeli
-#define glLightModeliv chromium.LightModeliv
-#define glLightf chromium.Lightf
-#define glLightfv chromium.Lightfv
-#define glLighti chromium.Lighti
-#define glLightiv chromium.Lightiv
-#define glLineStipple chromium.LineStipple
-#define glLineWidth chromium.LineWidth
-#define glListBase chromium.ListBase
-#define glLoadIdentity chromium.LoadIdentity
-#define glLoadMatrixd chromium.LoadMatrixd
-#define glLoadMatrixf chromium.LoadMatrixf
-#define glLoadName chromium.LoadName
-#define glLogicOp chromium.LogicOp
-#define glMakeCurrent chromium.MakeCurrent
-#define glMap1d chromium.Map1d
-#define glMap1f chromium.Map1f
-#define glMap2d chromium.Map2d
-#define glMap2f chromium.Map2f
-#define glMapGrid1d chromium.MapGrid1d
-#define glMapGrid1f chromium.MapGrid1f
-#define glMapGrid2d chromium.MapGrid2d
-#define glMapGrid2f chromium.MapGrid2f
-#define glMaterialf chromium.Materialf
-#define glMaterialfv chromium.Materialfv
-#define glMateriali chromium.Materiali
-#define glMaterialiv chromium.Materialiv
-#define glMatrixMode chromium.MatrixMode
-#define glMultMatrixd chromium.MultMatrixd
-#define glMultMatrixf chromium.MultMatrixf
-#define glMultiTexCoord1dARB chromium.MultiTexCoord1dARB
-#define glMultiTexCoord1dvARB chromium.MultiTexCoord1dvARB
-#define glMultiTexCoord1fARB chromium.MultiTexCoord1fARB
-#define glMultiTexCoord1fvARB chromium.MultiTexCoord1fvARB
-#define glMultiTexCoord1iARB chromium.MultiTexCoord1iARB
-#define glMultiTexCoord1ivARB chromium.MultiTexCoord1ivARB
-#define glMultiTexCoord1sARB chromium.MultiTexCoord1sARB
-#define glMultiTexCoord1svARB chromium.MultiTexCoord1svARB
-#define glMultiTexCoord2dARB chromium.MultiTexCoord2dARB
-#define glMultiTexCoord2dvARB chromium.MultiTexCoord2dvARB
-#define glMultiTexCoord2fARB chromium.MultiTexCoord2fARB
-#define glMultiTexCoord2fvARB chromium.MultiTexCoord2fvARB
-#define glMultiTexCoord2iARB chromium.MultiTexCoord2iARB
-#define glMultiTexCoord2ivARB chromium.MultiTexCoord2ivARB
-#define glMultiTexCoord2sARB chromium.MultiTexCoord2sARB
-#define glMultiTexCoord2svARB chromium.MultiTexCoord2svARB
-#define glMultiTexCoord3dARB chromium.MultiTexCoord3dARB
-#define glMultiTexCoord3dvARB chromium.MultiTexCoord3dvARB
-#define glMultiTexCoord3fARB chromium.MultiTexCoord3fARB
-#define glMultiTexCoord3fvARB chromium.MultiTexCoord3fvARB
-#define glMultiTexCoord3iARB chromium.MultiTexCoord3iARB
-#define glMultiTexCoord3ivARB chromium.MultiTexCoord3ivARB
-#define glMultiTexCoord3sARB chromium.MultiTexCoord3sARB
-#define glMultiTexCoord3svARB chromium.MultiTexCoord3svARB
-#define glMultiTexCoord4dARB chromium.MultiTexCoord4dARB
-#define glMultiTexCoord4dvARB chromium.MultiTexCoord4dvARB
-#define glMultiTexCoord4fARB chromium.MultiTexCoord4fARB
-#define glMultiTexCoord4fvARB chromium.MultiTexCoord4fvARB
-#define glMultiTexCoord4iARB chromium.MultiTexCoord4iARB
-#define glMultiTexCoord4ivARB chromium.MultiTexCoord4ivARB
-#define glMultiTexCoord4sARB chromium.MultiTexCoord4sARB
-#define glMultiTexCoord4svARB chromium.MultiTexCoord4svARB
-#define glNewList chromium.NewList
-#define glNormal3b chromium.Normal3b
-#define glNormal3bv chromium.Normal3bv
-#define glNormal3d chromium.Normal3d
-#define glNormal3dv chromium.Normal3dv
-#define glNormal3f chromium.Normal3f
-#define glNormal3fv chromium.Normal3fv
-#define glNormal3i chromium.Normal3i
-#define glNormal3iv chromium.Normal3iv
-#define glNormal3s chromium.Normal3s
-#define glNormal3sv chromium.Normal3sv
-#define glNormalPointer chromium.NormalPointer
-#define glOrtho chromium.Ortho
-#define glPassThrough chromium.PassThrough
-#define glPixelMapfv chromium.PixelMapfv
-#define glPixelMapuiv chromium.PixelMapuiv
-#define glPixelMapusv chromium.PixelMapusv
-#define glPixelStoref chromium.PixelStoref
-#define glPixelStorei chromium.PixelStorei
-#define glPixelTransferf chromium.PixelTransferf
-#define glPixelTransferi chromium.PixelTransferi
-#define glPixelZoom chromium.PixelZoom
-#define glPointSize chromium.PointSize
-#define glPolygonMode chromium.PolygonMode
-#define glPolygonOffset chromium.PolygonOffset
-#define glPolygonStipple chromium.PolygonStipple
-#define glPopAttrib chromium.PopAttrib
-#define glPopClientAttrib chromium.PopClientAttrib
-#define glPopMatrix chromium.PopMatrix
-#define glPopName chromium.PopName
-#define glPrioritizeTextures chromium.PrioritizeTextures
-#define glPushAttrib chromium.PushAttrib
-#define glPushClientAttrib chromium.PushClientAttrib
-#define glPushMatrix chromium.PushMatrix
-#define glPushName chromium.PushName
-#define glRasterPos2d chromium.RasterPos2d
-#define glRasterPos2dv chromium.RasterPos2dv
-#define glRasterPos2f chromium.RasterPos2f
-#define glRasterPos2fv chromium.RasterPos2fv
-#define glRasterPos2i chromium.RasterPos2i
-#define glRasterPos2iv chromium.RasterPos2iv
-#define glRasterPos2s chromium.RasterPos2s
-#define glRasterPos2sv chromium.RasterPos2sv
-#define glRasterPos3d chromium.RasterPos3d
-#define glRasterPos3dv chromium.RasterPos3dv
-#define glRasterPos3f chromium.RasterPos3f
-#define glRasterPos3fv chromium.RasterPos3fv
-#define glRasterPos3i chromium.RasterPos3i
-#define glRasterPos3iv chromium.RasterPos3iv
-#define glRasterPos3s chromium.RasterPos3s
-#define glRasterPos3sv chromium.RasterPos3sv
-#define glRasterPos4d chromium.RasterPos4d
-#define glRasterPos4dv chromium.RasterPos4dv
-#define glRasterPos4f chromium.RasterPos4f
-#define glRasterPos4fv chromium.RasterPos4fv
-#define glRasterPos4i chromium.RasterPos4i
-#define glRasterPos4iv chromium.RasterPos4iv
-#define glRasterPos4s chromium.RasterPos4s
-#define glRasterPos4sv chromium.RasterPos4sv
-#define glReadBuffer chromium.ReadBuffer
-#define glReadPixels chromium.ReadPixels
-#define glRectd chromium.Rectd
-#define glRectdv chromium.Rectdv
-#define glRectf chromium.Rectf
-#define glRectfv chromium.Rectfv
-#define glRecti chromium.Recti
-#define glRectiv chromium.Rectiv
-#define glRects chromium.Rects
-#define glRectsv chromium.Rectsv
-#define glRenderMode chromium.RenderMode
-#define glRotated chromium.Rotated
-#define glRotatef chromium.Rotatef
-#define glScaled chromium.Scaled
-#define glScalef chromium.Scalef
-#define glScissor chromium.Scissor
-#define glSecondaryColor3bEXT chromium.SecondaryColor3bEXT
-#define glSecondaryColor3bvEXT chromium.SecondaryColor3bvEXT
-#define glSecondaryColor3dEXT chromium.SecondaryColor3dEXT
-#define glSecondaryColor3dvEXT chromium.SecondaryColor3dvEXT
-#define glSecondaryColor3fEXT chromium.SecondaryColor3fEXT
-#define glSecondaryColor3fvEXT chromium.SecondaryColor3fvEXT
-#define glSecondaryColor3iEXT chromium.SecondaryColor3iEXT
-#define glSecondaryColor3ivEXT chromium.SecondaryColor3ivEXT
-#define glSecondaryColor3sEXT chromium.SecondaryColor3sEXT
-#define glSecondaryColor3svEXT chromium.SecondaryColor3svEXT
-#define glSecondaryColor3ubEXT chromium.SecondaryColor3ubEXT
-#define glSecondaryColor3ubvEXT chromium.SecondaryColor3ubvEXT
-#define glSecondaryColor3uiEXT chromium.SecondaryColor3uiEXT
-#define glSecondaryColor3uivEXT chromium.SecondaryColor3uivEXT
-#define glSecondaryColor3usEXT chromium.SecondaryColor3usEXT
-#define glSecondaryColor3usvEXT chromium.SecondaryColor3usvEXT
-#define glSecondaryColorPointerEXT chromium.SecondaryColorPointerEXT
-#define glSelectBuffer chromium.SelectBuffer
-#define glSemaphoreCreate chromium.SemaphoreCreate
-#define glSemaphoreDestroy chromium.SemaphoreDestroy
-#define glSemaphoreP chromium.SemaphoreP
-#define glSemaphoreV chromium.SemaphoreV
-#define glShadeModel chromium.ShadeModel
-#define glStencilFunc chromium.StencilFunc
-#define glStencilMask chromium.StencilMask
-#define glStencilOp chromium.StencilOp
-#define glSwapBuffers chromium.SwapBuffers
-#define glTexCoord1d chromium.TexCoord1d
-#define glTexCoord1dv chromium.TexCoord1dv
-#define glTexCoord1f chromium.TexCoord1f
-#define glTexCoord1fv chromium.TexCoord1fv
-#define glTexCoord1i chromium.TexCoord1i
-#define glTexCoord1iv chromium.TexCoord1iv
-#define glTexCoord1s chromium.TexCoord1s
-#define glTexCoord1sv chromium.TexCoord1sv
-#define glTexCoord2d chromium.TexCoord2d
-#define glTexCoord2dv chromium.TexCoord2dv
-#define glTexCoord2f chromium.TexCoord2f
-#define glTexCoord2fv chromium.TexCoord2fv
-#define glTexCoord2i chromium.TexCoord2i
-#define glTexCoord2iv chromium.TexCoord2iv
-#define glTexCoord2s chromium.TexCoord2s
-#define glTexCoord2sv chromium.TexCoord2sv
-#define glTexCoord3d chromium.TexCoord3d
-#define glTexCoord3dv chromium.TexCoord3dv
-#define glTexCoord3f chromium.TexCoord3f
-#define glTexCoord3fv chromium.TexCoord3fv
-#define glTexCoord3i chromium.TexCoord3i
-#define glTexCoord3iv chromium.TexCoord3iv
-#define glTexCoord3s chromium.TexCoord3s
-#define glTexCoord3sv chromium.TexCoord3sv
-#define glTexCoord4d chromium.TexCoord4d
-#define glTexCoord4dv chromium.TexCoord4dv
-#define glTexCoord4f chromium.TexCoord4f
-#define glTexCoord4fv chromium.TexCoord4fv
-#define glTexCoord4i chromium.TexCoord4i
-#define glTexCoord4iv chromium.TexCoord4iv
-#define glTexCoord4s chromium.TexCoord4s
-#define glTexCoord4sv chromium.TexCoord4sv
-#define glTexCoordPointer chromium.TexCoordPointer
-#define glTexEnvf chromium.TexEnvf
-#define glTexEnvfv chromium.TexEnvfv
-#define glTexEnvi chromium.TexEnvi
-#define glTexEnviv chromium.TexEnviv
-#define glTexGend chromium.TexGend
-#define glTexGendv chromium.TexGendv
-#define glTexGenf chromium.TexGenf
-#define glTexGenfv chromium.TexGenfv
-#define glTexGeni chromium.TexGeni
-#define glTexGeniv chromium.TexGeniv
-#define glTexImage1D chromium.TexImage1D
-#define glTexImage2D chromium.TexImage2D
-#define glTexParameterf chromium.TexParameterf
-#define glTexParameterfv chromium.TexParameterfv
-#define glTexParameteri chromium.TexParameteri
-#define glTexParameteriv chromium.TexParameteriv
-#define glTexSubImage1D chromium.TexSubImage1D
-#define glTexSubImage2D chromium.TexSubImage2D
-#define glTranslated chromium.Translated
-#define glTranslatef chromium.Translatef
-#define glVertex2d chromium.Vertex2d
-#define glVertex2dv chromium.Vertex2dv
-#define glVertex2f chromium.Vertex2f
-#define glVertex2fv chromium.Vertex2fv
-#define glVertex2i chromium.Vertex2i
-#define glVertex2iv chromium.Vertex2iv
-#define glVertex2s chromium.Vertex2s
-#define glVertex2sv chromium.Vertex2sv
-#define glVertex3d chromium.Vertex3d
-#define glVertex3dv chromium.Vertex3dv
-#define glVertex3f chromium.Vertex3f
-#define glVertex3fv chromium.Vertex3fv
-#define glVertex3i chromium.Vertex3i
-#define glVertex3iv chromium.Vertex3iv
-#define glVertex3s chromium.Vertex3s
-#define glVertex3sv chromium.Vertex3sv
-#define glVertex4d chromium.Vertex4d
-#define glVertex4dv chromium.Vertex4dv
-#define glVertex4f chromium.Vertex4f
-#define glVertex4fv chromium.Vertex4fv
-#define glVertex4i chromium.Vertex4i
-#define glVertex4iv chromium.Vertex4iv
-#define glVertex4s chromium.Vertex4s
-#define glVertex4sv chromium.Vertex4sv
-#define glVertexPointer chromium.VertexPointer
-#define glViewport chromium.Viewport
-#define glWriteback chromium.Writeback 
-
-
-#define glgsg crgsg
-#define NotifyCategoryGetCategory_glgsg NotifyCategoryGetCategory_crgsg
-
-#define gl_show_transforms cr_show_transforms
-#define gl_cheap_textures cr_cheap_textures
-#define gl_cull_traversal cr_cull_traversal
-#define gl_ignore_mipmaps cr_ignore_mipmaps
-#define gl_force_mipmaps cr_force_mipmaps
-#define gl_show_mipmaps cr_show_mipmaps
-#define gl_save_mipmaps cr_save_mipmaps
-#define gl_auto_normalize_lighting cr_auto_normalize_lighting
-#define gl_supports_bgr cr_supports_bgr
-
-#define GLDecalType CRDecalType
-#define gl_decal_type cr_decal_type
-
-#define init_libglgsg init_libcrgsg
-
-
-#define glgsg_cat crgsg_cat
-
-#define GLGraphicsStateGuardian CRGraphicsStateGuardian
-#define GLTextureContext CRTextureContext
-#define GLGeomNodeContext CRGeomNodeContext
-#define GLSavedFrameBuffer CRSavedFrameBuffer
-
-#define make_GlGraphicsStateGuardian make_CRGraphicsStateGuardian
-
-"""

+ 0 - 3296
panda/src/crgsg/crext.h

@@ -1,3296 +0,0 @@
-#ifndef __glext_h_
-#define __glext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright 1998, 1999, 2000, 2001, NVIDIA Corporation.
-** All rights Reserved.
-** 
-** THE INFORMATION CONTAINED HEREIN IS PROPRIETARY AND CONFIDENTIAL TO
-** NVIDIA, CORPORATION.  USE, REPRODUCTION OR DISCLOSURE TO ANY THIRD PARTY
-** IS SUBJECT TO WRITTEN PRE-APPROVAL BY NVIDIA, CORPORATION.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
-** http://oss.sgi.com/projects/FreeB
-** 
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-** 
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-** 
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-
-/*************************************************************/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-#define GL_GLEXT_VERSION 6
-
-#ifndef GL_VERSION_1_2
-#define GL_CONSTANT_COLOR                 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
-#define GL_CONSTANT_ALPHA                 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
-#define GL_BLEND_COLOR                    0x8005
-#define GL_FUNC_ADD                       0x8006
-#define GL_MIN                            0x8007
-#define GL_MAX                            0x8008
-#define GL_BLEND_EQUATION                 0x8009
-#define GL_FUNC_SUBTRACT                  0x800A
-#define GL_FUNC_REVERSE_SUBTRACT          0x800B
-#define GL_CONVOLUTION_1D                 0x8010
-#define GL_CONVOLUTION_2D                 0x8011
-#define GL_SEPARABLE_2D                   0x8012
-#define GL_CONVOLUTION_BORDER_MODE        0x8013
-#define GL_CONVOLUTION_FILTER_SCALE       0x8014
-#define GL_CONVOLUTION_FILTER_BIAS        0x8015
-#define GL_REDUCE                         0x8016
-#define GL_CONVOLUTION_FORMAT             0x8017
-#define GL_CONVOLUTION_WIDTH              0x8018
-#define GL_CONVOLUTION_HEIGHT             0x8019
-#define GL_MAX_CONVOLUTION_WIDTH          0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT         0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE     0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS      0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023
-#define GL_HISTOGRAM                      0x8024
-#define GL_PROXY_HISTOGRAM                0x8025
-#define GL_HISTOGRAM_WIDTH                0x8026
-#define GL_HISTOGRAM_FORMAT               0x8027
-#define GL_HISTOGRAM_RED_SIZE             0x8028
-#define GL_HISTOGRAM_GREEN_SIZE           0x8029
-#define GL_HISTOGRAM_BLUE_SIZE            0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE           0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C
-#define GL_HISTOGRAM_SINK                 0x802D
-#define GL_MINMAX                         0x802E
-#define GL_MINMAX_FORMAT                  0x802F
-#define GL_MINMAX_SINK                    0x8030
-#define GL_TABLE_TOO_LARGE                0x8031
-#define GL_UNSIGNED_BYTE_3_3_2            0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
-#define GL_UNSIGNED_INT_8_8_8_8           0x8035
-#define GL_UNSIGNED_INT_10_10_10_2        0x8036
-#define GL_RESCALE_NORMAL                 0x803A
-#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
-#define GL_UNSIGNED_SHORT_5_6_5           0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
-#define GL_COLOR_MATRIX                   0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA
-#define GL_COLOR_TABLE                    0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2
-#define GL_PROXY_COLOR_TABLE              0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE              0x80D6
-#define GL_COLOR_TABLE_BIAS               0x80D7
-#define GL_COLOR_TABLE_FORMAT             0x80D8
-#define GL_COLOR_TABLE_WIDTH              0x80D9
-#define GL_COLOR_TABLE_RED_SIZE           0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF
-#define GL_CLAMP_TO_EDGE                  0x812F
-#define GL_TEXTURE_MIN_LOD                0x813A
-#define GL_TEXTURE_MAX_LOD                0x813B
-#define GL_TEXTURE_BASE_LEVEL             0x813C
-#define GL_TEXTURE_MAX_LEVEL              0x813D
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB                   0x84C0
-#define GL_TEXTURE1_ARB                   0x84C1
-#define GL_TEXTURE2_ARB                   0x84C2
-#define GL_TEXTURE3_ARB                   0x84C3
-#define GL_TEXTURE4_ARB                   0x84C4
-#define GL_TEXTURE5_ARB                   0x84C5
-#define GL_TEXTURE6_ARB                   0x84C6
-#define GL_TEXTURE7_ARB                   0x84C7
-#define GL_TEXTURE8_ARB                   0x84C8
-#define GL_TEXTURE9_ARB                   0x84C9
-#define GL_TEXTURE10_ARB                  0x84CA
-#define GL_TEXTURE11_ARB                  0x84CB
-#define GL_TEXTURE12_ARB                  0x84CC
-#define GL_TEXTURE13_ARB                  0x84CD
-#define GL_TEXTURE14_ARB                  0x84CE
-#define GL_TEXTURE15_ARB                  0x84CF
-#define GL_TEXTURE16_ARB                  0x84D0
-#define GL_TEXTURE17_ARB                  0x84D1
-#define GL_TEXTURE18_ARB                  0x84D2
-#define GL_TEXTURE19_ARB                  0x84D3
-#define GL_TEXTURE20_ARB                  0x84D4
-#define GL_TEXTURE21_ARB                  0x84D5
-#define GL_TEXTURE22_ARB                  0x84D6
-#define GL_TEXTURE23_ARB                  0x84D7
-#define GL_TEXTURE24_ARB                  0x84D8
-#define GL_TEXTURE25_ARB                  0x84D9
-#define GL_TEXTURE26_ARB                  0x84DA
-#define GL_TEXTURE27_ARB                  0x84DB
-#define GL_TEXTURE28_ARB                  0x84DC
-#define GL_TEXTURE29_ARB                  0x84DD
-#define GL_TEXTURE30_ARB                  0x84DE
-#define GL_TEXTURE31_ARB                  0x84DF
-#define GL_ACTIVE_TEXTURE_ARB             0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB                0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F
-#define GL_SAMPLE_COVERAGE_ARB            0x80A0
-#define GL_SAMPLE_BUFFERS_ARB             0x80A8
-#define GL_SAMPLES_ARB                    0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB
-#define GL_MULTISAMPLE_BIT_ARB            0x20000000
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB                 0x8511
-#define GL_REFLECTION_MAP_ARB             0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB           0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB           0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB       0x84EC
-#define GL_COMPRESSED_RGB_ARB             0x84ED
-#define GL_COMPRESSED_RGBA_ARB            0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF
-#define GL_TEXTURE_IMAGE_SIZE_ARB         0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB         0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT                       0x8000
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT             0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002
-#define GL_CONSTANT_ALPHA_EXT             0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004
-#define GL_BLEND_COLOR_EXT                0x8005
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT             0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT                     0x803B
-#define GL_ALPHA8_EXT                     0x803C
-#define GL_ALPHA12_EXT                    0x803D
-#define GL_ALPHA16_EXT                    0x803E
-#define GL_LUMINANCE4_EXT                 0x803F
-#define GL_LUMINANCE8_EXT                 0x8040
-#define GL_LUMINANCE12_EXT                0x8041
-#define GL_LUMINANCE16_EXT                0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT          0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT          0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT         0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT        0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT        0x8048
-#define GL_INTENSITY_EXT                  0x8049
-#define GL_INTENSITY4_EXT                 0x804A
-#define GL_INTENSITY8_EXT                 0x804B
-#define GL_INTENSITY12_EXT                0x804C
-#define GL_INTENSITY16_EXT                0x804D
-#define GL_RGB2_EXT                       0x804E
-#define GL_RGB4_EXT                       0x804F
-#define GL_RGB5_EXT                       0x8050
-#define GL_RGB8_EXT                       0x8051
-#define GL_RGB10_EXT                      0x8052
-#define GL_RGB12_EXT                      0x8053
-#define GL_RGB16_EXT                      0x8054
-#define GL_RGBA2_EXT                      0x8055
-#define GL_RGBA4_EXT                      0x8056
-#define GL_RGB5_A1_EXT                    0x8057
-#define GL_RGBA8_EXT                      0x8058
-#define GL_RGB10_A2_EXT                   0x8059
-#define GL_RGBA12_EXT                     0x805A
-#define GL_RGBA16_EXT                     0x805B
-#define GL_TEXTURE_RED_SIZE_EXT           0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061
-#define GL_REPLACE_EXT                    0x8062
-#define GL_PROXY_TEXTURE_1D_EXT           0x8063
-#define GL_PROXY_TEXTURE_2D_EXT           0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT          0x8065
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES               0x806B
-#define GL_PACK_SKIP_IMAGES_EXT           0x806B
-#define GL_PACK_IMAGE_HEIGHT              0x806C
-#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C
-#define GL_UNPACK_SKIP_IMAGES             0x806D
-#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D
-#define GL_UNPACK_IMAGE_HEIGHT            0x806E
-#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E
-#define GL_TEXTURE_3D                     0x806F
-#define GL_TEXTURE_3D_EXT                 0x806F
-#define GL_PROXY_TEXTURE_3D               0x8070
-#define GL_PROXY_TEXTURE_3D_EXT           0x8070
-#define GL_TEXTURE_DEPTH                  0x8071
-#define GL_TEXTURE_DEPTH_EXT              0x8071
-#define GL_TEXTURE_WRAP_R                 0x8072
-#define GL_TEXTURE_WRAP_R_EXT             0x8072
-#define GL_MAX_3D_TEXTURE_SIZE            0x8073
-#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS                   0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147
-#endif
-
-#ifndef GL_EXT_subtexture
-#endif
-
-#ifndef GL_EXT_copy_texture
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT                  0x8024
-#define GL_PROXY_HISTOGRAM_EXT            0x8025
-#define GL_HISTOGRAM_WIDTH_EXT            0x8026
-#define GL_HISTOGRAM_FORMAT_EXT           0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C
-#define GL_HISTOGRAM_SINK_EXT             0x802D
-#define GL_MINMAX_EXT                     0x802E
-#define GL_MINMAX_FORMAT_EXT              0x802F
-#define GL_MINMAX_SINK_EXT                0x8030
-#define GL_TABLE_TOO_LARGE_EXT            0x8031
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT             0x8010
-#define GL_CONVOLUTION_2D_EXT             0x8011
-#define GL_SEPARABLE_2D_EXT               0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015
-#define GL_REDUCE_EXT                     0x8016
-#define GL_CONVOLUTION_FORMAT_EXT         0x8017
-#define GL_CONVOLUTION_WIDTH_EXT          0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT         0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI               0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI                0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI          0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI          0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI           0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS             0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX             0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133
-#define GL_TEXTURE_4D_SGIS                0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS          0x8135
-#define GL_TEXTURE_4DSIZE_SGIS            0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS            0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS        0x814F
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT                       0x800C
-#define GL_CMYKA_EXT                      0x800D
-#define GL_PACK_CMYK_HINT_EXT             0x800E
-#define GL_UNPACK_CMYK_HINT_EXT           0x800F
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT           0x8066
-#define GL_TEXTURE_RESIDENT_EXT           0x8067
-#define GL_TEXTURE_1D_BINDING_EXT         0x8068
-#define GL_TEXTURE_2D_BINDING_EXT         0x8069
-#define GL_TEXTURE_3D_BINDING_EXT         0x806A
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS             0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS            0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS           0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS           0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS               0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F
-#define GL_SAMPLE_MASK_SGIS               0x80A0
-#define GL_1PASS_SGIS                     0x80A1
-#define GL_2PASS_0_SGIS                   0x80A2
-#define GL_2PASS_1_SGIS                   0x80A3
-#define GL_4PASS_0_SGIS                   0x80A4
-#define GL_4PASS_1_SGIS                   0x80A5
-#define GL_4PASS_2_SGIS                   0x80A6
-#define GL_4PASS_3_SGIS                   0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS            0x80A8
-#define GL_SAMPLES_SGIS                   0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB
-#define GL_SAMPLE_PATTERN_SGIS            0x80AC
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT             0x803A
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT               0x8074
-#define GL_NORMAL_ARRAY_EXT               0x8075
-#define GL_COLOR_ARRAY_EXT                0x8076
-#define GL_INDEX_ARRAY_EXT                0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS           0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX           0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS             0x812F
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS           0x812D
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT                   0x8006
-#define GL_MIN_EXT                        0x8007
-#define GL_MAX_EXT                        0x8008
-#define GL_BLEND_EQUATION_EXT             0x8009
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT              0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX                 0x8094
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145
-#endif
-
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS               0x8110
-#define GL_DUAL_ALPHA8_SGIS               0x8111
-#define GL_DUAL_ALPHA12_SGIS              0x8112
-#define GL_DUAL_ALPHA16_SGIS              0x8113
-#define GL_DUAL_LUMINANCE4_SGIS           0x8114
-#define GL_DUAL_LUMINANCE8_SGIS           0x8115
-#define GL_DUAL_LUMINANCE12_SGIS          0x8116
-#define GL_DUAL_LUMINANCE16_SGIS          0x8117
-#define GL_DUAL_INTENSITY4_SGIS           0x8118
-#define GL_DUAL_INTENSITY8_SGIS           0x8119
-#define GL_DUAL_INTENSITY12_SGIS          0x811A
-#define GL_DUAL_INTENSITY16_SGIS          0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D
-#define GL_QUAD_ALPHA4_SGIS               0x811E
-#define GL_QUAD_ALPHA8_SGIS               0x811F
-#define GL_QUAD_LUMINANCE4_SGIS           0x8120
-#define GL_QUAD_LUMINANCE8_SGIS           0x8121
-#define GL_QUAD_INTENSITY4_SGIS           0x8122
-#define GL_QUAD_INTENSITY8_SGIS           0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX                    0x8148
-#define GL_SPRITE_MODE_SGIX               0x8149
-#define GL_SPRITE_AXIS_SGIX               0x814A
-#define GL_SPRITE_TRANSLATION_SGIX        0x814B
-#define GL_SPRITE_AXIAL_SGIX              0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_EXT             0x8126
-#define GL_POINT_SIZE_MIN_SGIS            0x8126
-#define GL_POINT_SIZE_MAX_EXT             0x8127
-#define GL_POINT_SIZE_MAX_SGIS            0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT       0x8129
-#define GL_DISTANCE_ATTENUATION_SGIS      0x8129
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX                 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX           0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX         0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX         0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX         0x81A7
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS                  0x812A
-#define GL_FOG_FUNC_POINTS_SGIS           0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX                0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX          0x8199
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP               0x8155
-#define GL_IMAGE_SCALE_Y_HP               0x8156
-#define GL_IMAGE_TRANSLATE_X_HP           0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP           0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B
-#define GL_IMAGE_MAG_FILTER_HP            0x815C
-#define GL_IMAGE_MIN_FILTER_HP            0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E
-#define GL_CUBIC_HP                       0x815F
-#define GL_AVERAGE_HP                     0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP          0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP               0x8150
-#define GL_CONSTANT_BORDER_HP             0x8151
-#define GL_REPLICATE_BORDER_HP            0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154
-#endif
-
-#ifndef GL_INGR_palette_buffer
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE
-#endif
-
-#ifndef GL_EXT_color_subtable
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI           0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI            0x1A22D
-#define GL_COLOR3_BIT_PGI                 0x00010000
-#define GL_COLOR4_BIT_PGI                 0x00020000
-#define GL_EDGEFLAG_BIT_PGI               0x00040000
-#define GL_INDEX_BIT_PGI                  0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI            0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000
-#define GL_MAT_EMISSION_BIT_PGI           0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000
-#define GL_MAT_SHININESS_BIT_PGI          0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI           0x04000000
-#define GL_NORMAL_BIT_PGI                 0x08000000
-#define GL_TEXCOORD1_BIT_PGI              0x10000000
-#define GL_TEXCOORD2_BIT_PGI              0x20000000
-#define GL_TEXCOORD3_BIT_PGI              0x40000000
-#define GL_TEXCOORD4_BIT_PGI              0x80000000
-#define GL_VERTEX23_BIT_PGI               0x00000004
-#define GL_VERTEX4_BIT_PGI                0x00000008
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI          0x1A219
-#define GL_CLIP_NEAR_HINT_PGI             0x1A220
-#define GL_CLIP_FAR_HINT_PGI              0x1A221
-#define GL_WIDE_LINE_HINT_PGI             0x1A222
-#define GL_BACK_NORMALS_HINT_PGI          0x1A223
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT               0x80E2
-#define GL_COLOR_INDEX2_EXT               0x80E3
-#define GL_COLOR_INDEX4_EXT               0x80E4
-#define GL_COLOR_INDEX8_EXT               0x80E5
-#define GL_COLOR_INDEX12_EXT              0x80E6
-#define GL_COLOR_INDEX16_EXT              0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX             0x8182
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX            0x817F
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX            0x80BF
-#endif
-
-#ifndef GL_EXT_index_texture
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT             0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT                 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT            0x81B6
-#define GL_INDEX_TEST_REF_EXT             0x81B7
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT                    0x81AD
-#define GL_IUI_V3F_EXT                    0x81AE
-#define GL_IUI_N3F_V2F_EXT                0x81AF
-#define GL_IUI_N3F_V3F_EXT                0x81B0
-#define GL_T2F_IUI_V2F_EXT                0x81B1
-#define GL_T2F_IUI_V3F_EXT                0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT                0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX                 0x81BB
-#define GL_YCRCB_444_SGIX                 0x81BC
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406
-#define GL_LIGHT_ENV_MODE_SGIX            0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX           0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX           0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX           0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX           0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX           0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX           0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX           0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX           0x8413
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP       0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN                      0x80EA
-#define GL_PHONG_HINT_WIN                 0x80EB
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT          0x8349
-#define GL_FRAGMENT_NORMAL_EXT            0x834A
-#define GL_FRAGMENT_COLOR_EXT             0x834C
-#define GL_ATTENUATION_EXT                0x834D
-#define GL_SHADOW_ATTENUATION_EXT         0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F
-#define GL_TEXTURE_LIGHT_EXT              0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX                 0x8320
-#define GL_ALPHA_MAX_SGIX                 0x8321
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT                        0x80E0
-#define GL_BGRA_EXT                       0x80E1
-#endif
-
-#ifndef GL_INTEL_texture_scissor
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL          0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP              0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP       0x8166
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330
-#define GL_PIXEL_MAG_FILTER_EXT           0x8331
-#define GL_PIXEL_MIN_FILTER_EXT           0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333
-#define GL_CUBIC_EXT                      0x8334
-#define GL_AVERAGE_EXT                    0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
-#define GL_SINGLE_COLOR_EXT               0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT                  0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT                    0x85AE
-#define GL_TEXTURE_NORMAL_EXT             0x85AF
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450
-#define GL_FOG_COORDINATE_EXT             0x8451
-#define GL_FRAGMENT_DEPTH_EXT             0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND        0x8490
-#define GL_INVERTED_SCREEN_W_REND         0x8491
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT              0x8439
-#define GL_BINORMAL_ARRAY_EXT             0x843A
-#define GL_CURRENT_TANGENT_EXT            0x843B
-#define GL_CURRENT_BINORMAL_EXT           0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443
-#define GL_MAP1_TANGENT_EXT               0x8444
-#define GL_MAP2_TANGENT_EXT               0x8445
-#define GL_MAP1_BINORMAL_EXT              0x8446
-#define GL_MAP2_BINORMAL_EXT              0x8447
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT                    0x8570
-#define GL_COMBINE_RGB_EXT                0x8571
-#define GL_COMBINE_ALPHA_EXT              0x8572
-#define GL_RGB_SCALE_EXT                  0x8573
-#define GL_ADD_SIGNED_EXT                 0x8574
-#define GL_INTERPOLATE_EXT                0x8575
-#define GL_CONSTANT_EXT                   0x8576
-#define GL_PRIMARY_COLOR_EXT              0x8577
-#define GL_PREVIOUS_EXT                   0x8578
-#define GL_SOURCE0_RGB_EXT                0x8580
-#define GL_SOURCE1_RGB_EXT                0x8581
-#define GL_SOURCE2_RGB_EXT                0x8582
-#define GL_SOURCE3_RGB_EXT                0x8583
-#define GL_SOURCE4_RGB_EXT                0x8584
-#define GL_SOURCE5_RGB_EXT                0x8585
-#define GL_SOURCE6_RGB_EXT                0x8586
-#define GL_SOURCE7_RGB_EXT                0x8587
-#define GL_SOURCE0_ALPHA_EXT              0x8588
-#define GL_SOURCE1_ALPHA_EXT              0x8589
-#define GL_SOURCE2_ALPHA_EXT              0x858A
-#define GL_SOURCE3_ALPHA_EXT              0x858B
-#define GL_SOURCE4_ALPHA_EXT              0x858C
-#define GL_SOURCE5_ALPHA_EXT              0x858D
-#define GL_SOURCE6_ALPHA_EXT              0x858E
-#define GL_SOURCE7_ALPHA_EXT              0x858F
-#define GL_OPERAND0_RGB_EXT               0x8590
-#define GL_OPERAND1_RGB_EXT               0x8591
-#define GL_OPERAND2_RGB_EXT               0x8592
-#define GL_OPERAND3_RGB_EXT               0x8593
-#define GL_OPERAND4_RGB_EXT               0x8594
-#define GL_OPERAND5_RGB_EXT               0x8595
-#define GL_OPERAND6_RGB_EXT               0x8596
-#define GL_OPERAND7_RGB_EXT               0x8597
-#define GL_OPERAND0_ALPHA_EXT             0x8598
-#define GL_OPERAND1_ALPHA_EXT             0x8599
-#define GL_OPERAND2_ALPHA_EXT             0x859A
-#define GL_OPERAND3_ALPHA_EXT             0x859B
-#define GL_OPERAND4_ALPHA_EXT             0x859C
-#define GL_OPERAND5_ALPHA_EXT             0x859D
-#define GL_OPERAND6_ALPHA_EXT             0x859E
-#define GL_OPERAND7_ALPHA_EXT             0x859F
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE           0x85B1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX                 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX           0x81FD
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN               0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN                    0x01
-#define GL_REPLACE_MIDDLE_SUN             0x02
-#define GL_REPLACE_OLDEST_SUN             0x03
-#define GL_TRIANGLE_LIST_SUN              0x81D7
-#define GL_REPLACEMENT_CODE_SUN           0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN                   0x85C4
-#define GL_R1UI_C4UB_V3F_SUN              0x85C5
-#define GL_R1UI_C3F_V3F_SUN               0x85C6
-#define GL_R1UI_N3F_V3F_SUN               0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8
-#define GL_R1UI_T2F_V3F_SUN               0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB
-#endif
-
-#ifndef GL_SUN_vertex
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT              0x80C8
-#define GL_BLEND_SRC_RGB_EXT              0x80C9
-#define GL_BLEND_DST_ALPHA_EXT            0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT            0x80CB
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR             0x8560
-#define GL_GREEN_MIN_CLAMP_INGR           0x8561
-#define GL_BLUE_MIN_CLAMP_INGR            0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR           0x8563
-#define GL_RED_MAX_CLAMP_INGR             0x8564
-#define GL_GREEN_MAX_CLAMP_INGR           0x8565
-#define GL_BLUE_MAX_CLAMP_INGR            0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR           0x8567
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR            0x8568
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT                  0x8507
-#define GL_DECR_WRAP_EXT                  0x8508
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT                        0x80CC
-#define GL_422_REV_EXT                    0x80CD
-#define GL_422_AVERAGE_EXT                0x80CE
-#define GL_422_REV_AVERAGE_EXT            0x80CF
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV                  0x8511
-#define GL_REFLECTION_MAP_NV              0x8512
-#endif
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT                 0x8511
-#define GL_REFLECTION_MAP_EXT             0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT           0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN                0x81D4
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502
-#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW_MATRIX1_EXT          0x8506
-#define GL_VERTEX_WEIGHTING_EXT           0x8509
-#define GL_MODELVIEW0_EXT                 GL_MODELVIEW
-#define GL_MODELVIEW1_EXT                 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV               0x8504
-#define GL_MAX_SPOT_EXPONENT_NV           0x8505
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV          0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV          0x8522
-#define GL_VARIABLE_A_NV                  0x8523
-#define GL_VARIABLE_B_NV                  0x8524
-#define GL_VARIABLE_C_NV                  0x8525
-#define GL_VARIABLE_D_NV                  0x8526
-#define GL_VARIABLE_E_NV                  0x8527
-#define GL_VARIABLE_F_NV                  0x8528
-#define GL_VARIABLE_G_NV                  0x8529
-#define GL_CONSTANT_COLOR0_NV             0x852A
-#define GL_CONSTANT_COLOR1_NV             0x852B
-#define GL_PRIMARY_COLOR_NV               0x852C
-#define GL_SECONDARY_COLOR_NV             0x852D
-#define GL_SPARE0_NV                      0x852E
-#define GL_SPARE1_NV                      0x852F
-#define GL_DISCARD_NV                     0x8530
-#define GL_E_TIMES_F_NV                   0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV           0x8536
-#define GL_UNSIGNED_INVERT_NV             0x8537
-#define GL_EXPAND_NORMAL_NV               0x8538
-#define GL_EXPAND_NEGATE_NV               0x8539
-#define GL_HALF_BIAS_NORMAL_NV            0x853A
-#define GL_HALF_BIAS_NEGATE_NV            0x853B
-#define GL_SIGNED_IDENTITY_NV             0x853C
-#define GL_SIGNED_NEGATE_NV               0x853D
-#define GL_SCALE_BY_TWO_NV                0x853E
-#define GL_SCALE_BY_FOUR_NV               0x853F
-#define GL_SCALE_BY_ONE_HALF_NV           0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541
-#define GL_COMBINER_INPUT_NV              0x8542
-#define GL_COMBINER_MAPPING_NV            0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546
-#define GL_COMBINER_MUX_SUM_NV            0x8547
-#define GL_COMBINER_SCALE_NV              0x8548
-#define GL_COMBINER_BIAS_NV               0x8549
-#define GL_COMBINER_AB_OUTPUT_NV          0x854A
-#define GL_COMBINER_CD_OUTPUT_NV          0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV         0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV       0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV       0x854E
-#define GL_COLOR_SUM_CLAMP_NV             0x854F
-#define GL_COMBINER0_NV                   0x8550
-#define GL_COMBINER1_NV                   0x8551
-#define GL_COMBINER2_NV                   0x8552
-#define GL_COMBINER3_NV                   0x8553
-#define GL_COMBINER4_NV                   0x8554
-#define GL_COMBINER5_NV                   0x8555
-#define GL_COMBINER6_NV                   0x8556
-#define GL_COMBINER7_NV                   0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV           0x855A
-#define GL_EYE_RADIAL_NV                  0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C
-/* reuse GL_EYE_PLANE */
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV                0x855D
-#define GL_EMBOSS_CONSTANT_NV             0x855E
-#define GL_EMBOSS_MAP_NV                  0x855F
-#endif
-
-#ifndef GL_NV_blend_square
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV                    0x8503
-#define GL_SOURCE3_RGB_NV                 0x8583
-#define GL_SOURCE3_ALPHA_NV               0x858B
-#define GL_OPERAND3_RGB_NV                0x8593
-#define GL_OPERAND3_ALPHA_NV              0x859B
-#endif
-
-
-#ifndef GL_MESA_resize_buffers
-#endif
-
-#ifndef GL_MESA_window_pos
-#endif
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM                103050
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM          103070
-#define GL_NORMAL_ARRAY_LIST_IBM          103071
-#define GL_COLOR_ARRAY_LIST_IBM           103072
-#define GL_INDEX_ARRAY_LIST_IBM           103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX                     0x8318
-#define GL_YCRCBA_SGIX                    0x8319
-#endif
-
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX               0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX            0x86B3
-#define GL_SAMPLES_3DFX                   0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX           0x20000000
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT                0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
-#define GL_SAMPLE_MASK_EXT                0x80A0
-#define GL_1PASS_EXT                      0x80A1
-#define GL_2PASS_0_EXT                    0x80A2
-#define GL_2PASS_1_EXT                    0x80A3
-#define GL_4PASS_0_EXT                    0x80A4
-#define GL_4PASS_1_EXT                    0x80A5
-#define GL_4PASS_2_EXT                    0x80A6
-#define GL_4PASS_3_EXT                    0x80A7
-#define GL_SAMPLE_BUFFERS_EXT             0x80A8
-#define GL_SAMPLES_EXT                    0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB
-#define GL_SAMPLE_PATTERN_EXT             0x80AC
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX            0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX          0x8316
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX             0x842C
-#define GL_UNPACK_RESAMPLE_SGIX           0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX        0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX         0x8430
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3
-#define GL_EYE_POINT_SGIS                 0x81F4
-#define GL_OBJECT_POINT_SGIS              0x81F5
-#define GL_EYE_LINE_SGIS                  0x81F6
-#define GL_OBJECT_LINE_SGIS               0x81F7
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF
-#endif
-
-
-/*************************************************************/
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.BlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
-extern void APIENTRY chromium.BlendEquation (GLenum);
-extern void APIENTRY chromium.DrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ColorTableParameterfv (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.ColorTableParameteriv (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.CopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.GetColorTable (GLenum, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetColorTableParameterfv (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetColorTableParameteriv (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.ColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.CopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.ConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ConvolutionParameterf (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.ConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.ConvolutionParameteri (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.ConvolutionParameteriv (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.CopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.CopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-extern void APIENTRY chromium.GetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetConvolutionParameteriv (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-extern void APIENTRY chromium.SeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-extern void APIENTRY chromium.GetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetHistogramParameterfv (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetHistogramParameteriv (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetMinmaxParameteriv (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.Histogram (GLenum, GLsizei, GLenum, GLboolean);
-extern void APIENTRY chromium.Minmax (GLenum, GLenum, GLboolean);
-extern void APIENTRY chromium.ResetHistogram (GLenum);
-extern void APIENTRY chromium.ResetMinmax (GLenum);
-extern void APIENTRY chromium.TexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.TexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.CopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ActiveTextureARB (GLenum);
-extern void APIENTRY chromium.ClientActiveTextureARB (GLenum);
-extern void APIENTRY chromium.MultiTexCoord1dARB (GLenum, GLdouble);
-extern void APIENTRY chromium.MultiTexCoord1dvARB (GLenum, const GLdouble *);
-extern void APIENTRY chromium.MultiTexCoord1fARB (GLenum, GLfloat);
-extern void APIENTRY chromium.MultiTexCoord1fvARB (GLenum, const GLfloat *);
-extern void APIENTRY chromium.MultiTexCoord1iARB (GLenum, GLint);
-extern void APIENTRY chromium.MultiTexCoord1ivARB (GLenum, const GLint *);
-extern void APIENTRY chromium.MultiTexCoord1sARB (GLenum, GLshort);
-extern void APIENTRY chromium.MultiTexCoord1svARB (GLenum, const GLshort *);
-extern void APIENTRY chromium.MultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
-extern void APIENTRY chromium.MultiTexCoord2dvARB (GLenum, const GLdouble *);
-extern void APIENTRY chromium.MultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
-extern void APIENTRY chromium.MultiTexCoord2fvARB (GLenum, const GLfloat *);
-extern void APIENTRY chromium.MultiTexCoord2iARB (GLenum, GLint, GLint);
-extern void APIENTRY chromium.MultiTexCoord2ivARB (GLenum, const GLint *);
-extern void APIENTRY chromium.MultiTexCoord2sARB (GLenum, GLshort, GLshort);
-extern void APIENTRY chromium.MultiTexCoord2svARB (GLenum, const GLshort *);
-extern void APIENTRY chromium.MultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.MultiTexCoord3dvARB (GLenum, const GLdouble *);
-extern void APIENTRY chromium.MultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.MultiTexCoord3fvARB (GLenum, const GLfloat *);
-extern void APIENTRY chromium.MultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
-extern void APIENTRY chromium.MultiTexCoord3ivARB (GLenum, const GLint *);
-extern void APIENTRY chromium.MultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.MultiTexCoord3svARB (GLenum, const GLshort *);
-extern void APIENTRY chromium.MultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.MultiTexCoord4dvARB (GLenum, const GLdouble *);
-extern void APIENTRY chromium.MultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.MultiTexCoord4fvARB (GLenum, const GLfloat *);
-extern void APIENTRY chromium.MultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
-extern void APIENTRY chromium.MultiTexCoord4ivARB (GLenum, const GLint *);
-extern void APIENTRY chromium.MultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.MultiTexCoord4svARB (GLenum, const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.LoadTransposeMatrixfARB (const GLfloat *);
-extern void APIENTRY chromium.LoadTransposeMatrixdARB (const GLdouble *);
-extern void APIENTRY chromium.MultTransposeMatrixfARB (const GLfloat *);
-extern void APIENTRY chromium.MultTransposeMatrixdARB (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SampleCoverageARB (GLclampf, GLboolean);
-extern void APIENTRY chromium.SamplePassARB (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.CompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.CompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.CompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.CompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.CompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.CompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.GetCompressedTexImageARB (GLenum, GLint, void *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img);
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.BlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.PolygonOffsetEXT (GLfloat, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.TexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.GetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.TexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.TexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.CopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-extern void APIENTRY chromium.CopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-extern void APIENTRY chromium.CopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.CopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-extern void APIENTRY chromium.CopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.GetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetHistogramParameterivEXT (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.HistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
-extern void APIENTRY chromium.MinmaxEXT (GLenum, GLenum, GLboolean);
-extern void APIENTRY chromium.ResetHistogramEXT (GLenum);
-extern void APIENTRY chromium.ResetMinmaxEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.ConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.ConvolutionParameteriEXT (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.ConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.CopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.CopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-extern void APIENTRY chromium.GetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-extern void APIENTRY chromium.SeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
-
-#ifndef GL_EXT_color_matrix
-#define GL_EXT_color_matrix 1
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.ColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.ColorTableParameterivSGI (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.CopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
-extern void APIENTRY chromium.GetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetColorTableParameterivSGI (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.PixelTexGenSGIX (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.PixelTexGenParameteriSGIS (GLenum, GLint);
-extern void APIENTRY chromium.PixelTexGenParameterivSGIS (GLenum, const GLint *);
-extern void APIENTRY chromium.PixelTexGenParameterfSGIS (GLenum, GLfloat);
-extern void APIENTRY chromium.PixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
-extern void APIENTRY chromium.GetPixelTexGenParameterivSGIS (GLenum, GLint *);
-extern void APIENTRY chromium.GetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.TexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern GLboolean APIENTRY chromium.AreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
-extern void APIENTRY chromium.BindTextureEXT (GLenum, GLuint);
-extern void APIENTRY chromium.DeleteTexturesEXT (GLsizei, const GLuint *);
-extern void APIENTRY chromium.GenTexturesEXT (GLsizei, GLuint *);
-extern GLboolean APIENTRY chromium.IsTextureEXT (GLuint);
-extern void APIENTRY chromium.PrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.DetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-extern void APIENTRY chromium.GetDetailTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-extern void APIENTRY chromium.GetSharpenTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SampleMaskSGIS (GLclampf, GLboolean);
-extern void APIENTRY chromium.SamplePatternSGIS (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ArrayElementEXT (GLint);
-extern void APIENTRY chromium.ColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.DrawArraysEXT (GLenum, GLint, GLsizei);
-extern void APIENTRY chromium.EdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
-extern void APIENTRY chromium.GetPointervEXT (GLenum, GLvoid* *);
-extern void APIENTRY chromium.IndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.NormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.TexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.VertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.BlendEquationEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SpriteParameterfSGIX (GLenum, GLfloat);
-extern void APIENTRY chromium.SpriteParameterfvSGIX (GLenum, const GLfloat *);
-extern void APIENTRY chromium.SpriteParameteriSGIX (GLenum, GLint);
-extern void APIENTRY chromium.SpriteParameterivSGIX (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.PointParameterfEXT (GLenum, GLfloat);
-extern void APIENTRY chromium.PointParameterfvEXT (GLenum, const GLfloat *);
-extern void APIENTRY chromium.PointParameterfSGIS (GLenum, GLfloat);
-extern void APIENTRY chromium.PointParameterfvSGIS (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern GLint APIENTRY chromium.GetInstrumentsSGIX (void);
-extern void APIENTRY chromium.InstrumentsBufferSGIX (GLsizei, GLint *);
-extern GLint APIENTRY chromium.PollInstrumentsSGIX (GLint *);
-extern void APIENTRY chromium.ReadInstrumentsSGIX (GLint);
-extern void APIENTRY chromium.StartInstrumentsSGIX (void);
-extern void APIENTRY chromium.StopInstrumentsSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FrameZoomSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ReferencePlaneSGIX (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FogFuncSGIS (GLsizei, const GLfloat *);
-extern void APIENTRY chromium.GetFogFuncSGIS (const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points);
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ImageTransformParameteriHP (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.ImageTransformParameterfHP (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.ImageTransformParameterivHP (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.ImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.GetImageTransformParameterivHP (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.CopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.HintPGI (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void APIENTRY chromium.GetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
-extern void APIENTRY chromium.GetColorTableParameterivEXT (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.GetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetListParameterivSGIX (GLuint, GLenum, GLint *);
-extern void APIENTRY chromium.ListParameterfSGIX (GLuint, GLenum, GLfloat);
-extern void APIENTRY chromium.ListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
-extern void APIENTRY chromium.ListParameteriSGIX (GLuint, GLenum, GLint);
-extern void APIENTRY chromium.ListParameterivSGIX (GLuint, GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.IndexMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.IndexFuncEXT (GLenum, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.LockArraysEXT (GLint, GLsizei);
-extern void APIENTRY chromium.UnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.CullParameterdvEXT (GLenum, GLdouble *);
-extern void APIENTRY chromium.CullParameterfvEXT (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FragmentColorMaterialSGIX (GLenum, GLenum);
-extern void APIENTRY chromium.FragmentLightfSGIX (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.FragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.FragmentLightiSGIX (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.FragmentLightivSGIX (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.FragmentLightModelfSGIX (GLenum, GLfloat);
-extern void APIENTRY chromium.FragmentLightModelfvSGIX (GLenum, const GLfloat *);
-extern void APIENTRY chromium.FragmentLightModeliSGIX (GLenum, GLint);
-extern void APIENTRY chromium.FragmentLightModelivSGIX (GLenum, const GLint *);
-extern void APIENTRY chromium.FragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.FragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
-extern void APIENTRY chromium.FragmentMaterialiSGIX (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.FragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.GetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetFragmentLightivSGIX (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.LightEnviSGIX (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.DrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ApplyTextureEXT (GLenum);
-extern void APIENTRY chromium.TextureLightEXT (GLenum);
-extern void APIENTRY chromium.TextureMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.VertexPointervINTEL (GLint, GLenum, const GLvoid* *);
-extern void APIENTRY chromium.NormalPointervINTEL (GLenum, const GLvoid* *);
-extern void APIENTRY chromium.ColorPointervINTEL (GLint, GLenum, const GLvoid* *);
-extern void APIENTRY chromium.TexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.PixelTransformParameteriEXT (GLenum, GLenum, GLint);
-extern void APIENTRY chromium.PixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
-extern void APIENTRY chromium.PixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
-extern void APIENTRY chromium.PixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
-extern void APIENTRY chromium.SecondaryColor3bvEXT (const GLbyte *);
-extern void APIENTRY chromium.SecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.SecondaryColor3dvEXT (const GLdouble *);
-extern void APIENTRY chromium.SecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.SecondaryColor3fvEXT (const GLfloat *);
-extern void APIENTRY chromium.SecondaryColor3iEXT (GLint, GLint, GLint);
-extern void APIENTRY chromium.SecondaryColor3ivEXT (const GLint *);
-extern void APIENTRY chromium.SecondaryColor3sEXT (GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.SecondaryColor3svEXT (const GLshort *);
-extern void APIENTRY chromium.SecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
-extern void APIENTRY chromium.SecondaryColor3ubvEXT (const GLubyte *);
-extern void APIENTRY chromium.SecondaryColor3uiEXT (GLuint, GLuint, GLuint);
-extern void APIENTRY chromium.SecondaryColor3uivEXT (const GLuint *);
-extern void APIENTRY chromium.SecondaryColor3usEXT (GLushort, GLushort, GLushort);
-extern void APIENTRY chromium.SecondaryColor3usvEXT (const GLushort *);
-extern void APIENTRY chromium.SecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TextureNormalEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.MultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
-extern void APIENTRY chromium.MultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FogCoordfEXT (GLfloat);
-extern void APIENTRY chromium.FogCoordfvEXT (const GLfloat *);
-extern void APIENTRY chromium.FogCoorddEXT (GLdouble);
-extern void APIENTRY chromium.FogCoorddvEXT (const GLdouble *);
-extern void APIENTRY chromium.FogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.Tangent3bEXT (GLbyte, GLbyte, GLbyte);
-extern void APIENTRY chromium.Tangent3bvEXT (const GLbyte *);
-extern void APIENTRY chromium.Tangent3dEXT (GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.Tangent3dvEXT (const GLdouble *);
-extern void APIENTRY chromium.Tangent3fEXT (GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Tangent3fvEXT (const GLfloat *);
-extern void APIENTRY chromium.Tangent3iEXT (GLint, GLint, GLint);
-extern void APIENTRY chromium.Tangent3ivEXT (const GLint *);
-extern void APIENTRY chromium.Tangent3sEXT (GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.Tangent3svEXT (const GLshort *);
-extern void APIENTRY chromium.Binormal3bEXT (GLbyte, GLbyte, GLbyte);
-extern void APIENTRY chromium.Binormal3bvEXT (const GLbyte *);
-extern void APIENTRY chromium.Binormal3dEXT (GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.Binormal3dvEXT (const GLdouble *);
-extern void APIENTRY chromium.Binormal3fEXT (GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Binormal3fvEXT (const GLfloat *);
-extern void APIENTRY chromium.Binormal3iEXT (GLint, GLint, GLint);
-extern void APIENTRY chromium.Binormal3ivEXT (const GLint *);
-extern void APIENTRY chromium.Binormal3sEXT (GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.Binormal3svEXT (const GLshort *);
-extern void APIENTRY chromium.TangentPointerEXT (GLenum, GLsizei, const GLvoid *);
-extern void APIENTRY chromium.BinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void);
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.GlobalAlphaFactorbSUN (GLbyte);
-extern void APIENTRY chromium.GlobalAlphaFactorsSUN (GLshort);
-extern void APIENTRY chromium.GlobalAlphaFactoriSUN (GLint);
-extern void APIENTRY chromium.GlobalAlphaFactorfSUN (GLfloat);
-extern void APIENTRY chromium.GlobalAlphaFactordSUN (GLdouble);
-extern void APIENTRY chromium.GlobalAlphaFactorubSUN (GLubyte);
-extern void APIENTRY chromium.GlobalAlphaFactorusSUN (GLushort);
-extern void APIENTRY chromium.GlobalAlphaFactoruiSUN (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ReplacementCodeuiSUN (GLuint);
-extern void APIENTRY chromium.ReplacementCodeusSUN (GLushort);
-extern void APIENTRY chromium.ReplacementCodeubSUN (GLubyte);
-extern void APIENTRY chromium.ReplacementCodeuivSUN (const GLuint *);
-extern void APIENTRY chromium.ReplacementCodeusvSUN (const GLushort *);
-extern void APIENTRY chromium.ReplacementCodeubvSUN (const GLubyte *);
-extern void APIENTRY chromium.ReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.Color4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
-extern void APIENTRY chromium.Color4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
-extern void APIENTRY chromium.Color4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Color4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
-extern void APIENTRY chromium.Color3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Color3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.Normal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Normal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.Color4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.Color4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.TexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.TexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.BlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.VertexWeightfEXT (GLfloat);
-extern void APIENTRY chromium.VertexWeightfvEXT (const GLfloat *);
-extern void APIENTRY chromium.VertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.FlushVertexArrayRangeNV (void);
-extern void APIENTRY chromium.VertexArrayRangeNV (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.CombinerParameterfvNV (GLenum, const GLfloat *);
-extern void APIENTRY chromium.CombinerParameterfNV (GLenum, GLfloat);
-extern void APIENTRY chromium.CombinerParameterivNV (GLenum, const GLint *);
-extern void APIENTRY chromium.CombinerParameteriNV (GLenum, GLint);
-extern void APIENTRY chromium.CombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
-extern void APIENTRY chromium.CombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
-extern void APIENTRY chromium.FinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
-extern void APIENTRY chromium.GetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
-extern void APIENTRY chromium.GetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
-extern void APIENTRY chromium.GetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void);
-#endif
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.WindowPos2dMESA (GLdouble, GLdouble);
-extern void APIENTRY chromium.WindowPos2dvMESA (const GLdouble *);
-extern void APIENTRY chromium.WindowPos2fMESA (GLfloat, GLfloat);
-extern void APIENTRY chromium.WindowPos2fvMESA (const GLfloat *);
-extern void APIENTRY chromium.WindowPos2iMESA (GLint, GLint);
-extern void APIENTRY chromium.WindowPos2ivMESA (const GLint *);
-extern void APIENTRY chromium.WindowPos2sMESA (GLshort, GLshort);
-extern void APIENTRY chromium.WindowPos2svMESA (const GLshort *);
-extern void APIENTRY chromium.WindowPos3dMESA (GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.WindowPos3dvMESA (const GLdouble *);
-extern void APIENTRY chromium.WindowPos3fMESA (GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.WindowPos3fvMESA (const GLfloat *);
-extern void APIENTRY chromium.WindowPos3iMESA (GLint, GLint, GLint);
-extern void APIENTRY chromium.WindowPos3ivMESA (const GLint *);
-extern void APIENTRY chromium.WindowPos3sMESA (GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.WindowPos3svMESA (const GLshort *);
-extern void APIENTRY chromium.WindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
-extern void APIENTRY chromium.WindowPos4dvMESA (const GLdouble *);
-extern void APIENTRY chromium.WindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
-extern void APIENTRY chromium.WindowPos4fvMESA (const GLfloat *);
-extern void APIENTRY chromium.WindowPos4iMESA (GLint, GLint, GLint, GLint);
-extern void APIENTRY chromium.WindowPos4ivMESA (const GLint *);
-extern void APIENTRY chromium.WindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
-extern void APIENTRY chromium.WindowPos4svMESA (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.MultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint);
-extern void APIENTRY chromium.MultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.ColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.SecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.EdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
-extern void APIENTRY chromium.FogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.IndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.NormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.TexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-extern void APIENTRY chromium.VertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TbufferMask3DFX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.SampleMaskEXT (GLclampf, GLboolean);
-extern void APIENTRY chromium.SamplePatternEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGI_vertex_preclip
-#define GL_SGI_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#ifdef GL_GLEXT_PROTOTYPES
-extern void APIENTRY chromium.TextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-
-
-
-/* added by Cass -- this part will be auto-generated in the future*/
-
-
-/* Extensions */
-#define GL_ARB_texture_border_clamp       1
-#define GL_ARB_texture_env_combine        1
-#define GL_ARB_texture_env_dot3           1
-#define GL_EXT_texture_env_dot3           1
-#define GL_IBM_texture_mirrored_repeat    1
-#define GL_NV_evaluators                  1
-#define GL_NV_fence                       1
-#define GL_NV_multisample_filter_hint     1
-#define GL_NV_packed_depth_stencil        1
-#define GL_NV_register_combiners2         1
-#define GL_NV_texture_compression_vtc     1
-#define GL_NV_texture_rectangle           1
-#define GL_NV_texture_shader              1
-#define GL_NV_texture_shader2             1
-#define GL_NV_vertex_program              1
-
-/* ARB_texture_border_clamp */
-#define GL_CLAMP_TO_BORDER_ARB            0x812D
-
-/* ARB_texture_env_combine */
-#define GL_COMBINE_ARB                    0x8570
-#define GL_COMBINE_RGB_ARB                0x8571
-#define GL_COMBINE_ALPHA_ARB              0x8572
-#define GL_RGB_SCALE_ARB                  0x8573
-#define GL_ADD_SIGNED_ARB                 0x8574
-#define GL_INTERPOLATE_ARB                0x8575
-#define GL_CONSTANT_ARB                   0x8576
-#define GL_PRIMARY_COLOR_ARB              0x8577
-#define GL_PREVIOUS_ARB                   0x8578
-#define GL_SOURCE0_RGB_ARB                0x8580
-#define GL_SOURCE1_RGB_ARB                0x8581
-#define GL_SOURCE2_RGB_ARB                0x8582
-#define GL_SOURCE0_ALPHA_ARB              0x8588
-#define GL_SOURCE1_ALPHA_ARB              0x8589
-#define GL_SOURCE2_ALPHA_ARB              0x858A
-#define GL_OPERAND0_RGB_ARB               0x8590
-#define GL_OPERAND1_RGB_ARB               0x8591
-#define GL_OPERAND2_RGB_ARB               0x8592
-#define GL_OPERAND0_ALPHA_ARB             0x8598
-#define GL_OPERAND1_ALPHA_ARB             0x8599
-#define GL_OPERAND2_ALPHA_ARB             0x859A
-#define GL_SUBTRACT_ARB                   0x84E7
-
-/* ARB_texture_env_dot3 */
-#define GL_DOT3_RGB_ARB                   0x86AE
-#define GL_DOT3_RGBA_ARB                  0x86AF
-
-/* EXT_texture_env_dot3 */
-#define GL_DOT3_RGB_EXT                   0x8740
-#define GL_DOT3_RGBA_EXT                  0x8741
-
-/* IBM_texture_mirrored_repeat */
-#define GL_MIRRORED_REPEAT_IBM            0x8370
-
-/* NV_vertex_program */
-#define GL_VERTEX_PROGRAM_NV              0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV        0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625
-#define GL_CURRENT_ATTRIB_NV              0x8626
-#define GL_PROGRAM_LENGTH_NV              0x8627
-#define GL_PROGRAM_STRING_NV              0x8628
-#define GL_MODELVIEW_PROJECTION_NV        0x8629
-#define GL_IDENTITY_NV                    0x862A
-#define GL_INVERSE_NV                     0x862B
-#define GL_TRANSPOSE_NV                   0x862C
-#define GL_INVERSE_TRANSPOSE_NV           0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV          0x862F
-#define GL_MATRIX0_NV                     0x8630
-#define GL_MATRIX1_NV                     0x8631
-#define GL_MATRIX2_NV                     0x8632
-#define GL_MATRIX3_NV                     0x8633
-#define GL_MATRIX4_NV                     0x8634
-#define GL_MATRIX5_NV                     0x8635
-#define GL_MATRIX6_NV                     0x8636
-#define GL_MATRIX7_NV                     0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640
-#define GL_CURRENT_MATRIX_NV              0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643
-#define GL_PROGRAM_PARAMETER_NV           0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645
-#define GL_PROGRAM_TARGET_NV              0x8646
-#define GL_PROGRAM_RESIDENT_NV            0x8647
-#define GL_TRACK_MATRIX_NV                0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV      0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F
-
-/* NV_evaluators */
-#define GL_EVAL_2D_NV                     0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1
-#define GL_MAP_TESSELLATION_NV            0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV        0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7
-
-/* NV_fence */
-#define GL_ALL_COMPLETED_NV               0x84F2
-#define GL_FENCE_STATUS_NV                0x84F3
-#define GL_FENCE_CONDITION_NV             0x84F4
-
-/* NV_texture_rectangle */
-#define GL_TEXTURE_RECTANGLE_NV           0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8
-
-/* NV_texture_shader */
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV          0x86DC
-#define GL_SHADER_CONSISTENT_NV           0x86DD
-#define GL_TEXTURE_SHADER_NV              0x86DE
-#define GL_SHADER_OPERATION_NV            0x86DF
-#define GL_CULL_MODES_NV                  0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4
-#define GL_CONST_EYE_NV                   0x86E5
-#define GL_PASS_THROUGH_NV                0x86E6
-#define GL_CULL_FRAGMENT_NV               0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV           0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA
-#define GL_DOT_PRODUCT_NV                 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV                        0x86F4
-#define GL_DSDT_NV                        0x86F5
-#define GL_DSDT_MAG_NV                    0x86F6
-#define GL_DSDT_MAG_VIB_NV                0x86F7
-#define GL_HILO16_NV                      0x86F8
-#define GL_SIGNED_HILO_NV                 0x86F9
-#define GL_SIGNED_HILO16_NV               0x86FA
-#define GL_SIGNED_RGBA_NV                 0x86FB
-#define GL_SIGNED_RGBA8_NV                0x86FC
-#define GL_SIGNED_RGB_NV                  0x86FE
-#define GL_SIGNED_RGB8_NV                 0x86FF
-#define GL_SIGNED_LUMINANCE_NV            0x8701
-#define GL_SIGNED_LUMINANCE8_NV           0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704
-#define GL_SIGNED_ALPHA_NV                0x8705
-#define GL_SIGNED_ALPHA8_NV               0x8706
-#define GL_SIGNED_INTENSITY_NV            0x8707
-#define GL_SIGNED_INTENSITY8_NV           0x8708
-#define GL_DSDT8_NV                       0x8709
-#define GL_DSDT8_MAG8_NV                  0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV                    0x870E
-#define GL_LO_SCALE_NV                    0x870F
-#define GL_DS_SCALE_NV                    0x8710
-#define GL_DT_SCALE_NV                    0x8711
-#define GL_MAGNITUDE_SCALE_NV             0x8712
-#define GL_VIBRANCE_SCALE_NV              0x8713
-#define GL_HI_BIAS_NV                     0x8714
-#define GL_LO_BIAS_NV                     0x8715
-#define GL_DS_BIAS_NV                     0x8716
-#define GL_DT_BIAS_NV                     0x8717
-#define GL_MAGNITUDE_BIAS_NV              0x8718
-#define GL_VIBRANCE_BIAS_NV               0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV       0x871A
-#define GL_TEXTURE_HI_SIZE_NV             0x871B
-#define GL_TEXTURE_LO_SIZE_NV             0x871C
-#define GL_TEXTURE_DS_SIZE_NV             0x871D
-#define GL_TEXTURE_DT_SIZE_NV             0x871E
-#define GL_TEXTURE_MAG_SIZE_NV            0x871F
-
-/* NV_texture_shader2 */
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
-
-/* NV_register_combiners2 */
-#define GL_PER_STAGE_CONSTANTS_NV         0x8535
-
-/* NV_packed_depth_stencil */
-#define GL_DEPTH_STENCIL_NV               0x84F9
-#define GL_UNSIGNED_INT_24_8_NV           0x84FA
-
-/* NV_multisample_filter_hint */
-#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534
-
-/* NV_texture_compression_vtc */
-
-/* NV_vertex_program */
-typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-
-/* NV_evaluators */
-typedef void (APIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (APIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (APIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-
-/* NV_fence */
-typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-
-
-/* NV_register_combiners2 */
-typedef void (APIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-

+ 0 - 5
panda/src/crgsg/crgsg_composite1.cxx

@@ -1,5 +0,0 @@
-
-#include "config_crgsg.cxx"
-#include "crSavedFrameBuffer.cxx"
-#include "crGeomNodeContext.cxx"
-#include "crTextureContext.cxx"

+ 0 - 6
panda/src/crgsg/index.html

@@ -1,6 +0,0 @@
-
-<h1>        CR GSG          </h1>
-
-<p> The Chromium Graphics State Guardian. </p>
-
-<p> CR is an abbreviation for Chromium. <p>

+ 1 - 3
panda/src/display/Sources.pp

@@ -18,7 +18,6 @@
     displayRegionStack.h \
     frameBufferProperties.I frameBufferProperties.h \
     frameBufferStack.I frameBufferStack.h \
-    geomContext.I geomContext.h geomNodeContext.I geomNodeContext.h \
     graphicsChannel.I graphicsChannel.h \
     graphicsEngine.I graphicsEngine.h \
     graphicsLayer.I  \
@@ -46,7 +45,7 @@
     drawableRegion.cxx \
     displayRegion.cxx \
     frameBufferProperties.cxx \
-    geomContext.cxx geomNodeContext.cxx graphicsChannel.cxx  \
+    graphicsChannel.cxx  \
     graphicsEngine.cxx \
     graphicsLayer.cxx \
     graphicsOutput.cxx \
@@ -69,7 +68,6 @@
     displayRegionStack.h \
     frameBufferProperties.I frameBufferProperties.h \
     frameBufferStack.I frameBufferStack.h \
-    geomContext.I geomContext.h geomNodeContext.I geomNodeContext.h \
     graphicsChannel.I graphicsChannel.h \
     graphicsEngine.I graphicsEngine.h \
     graphicsLayer.I graphicsLayer.h \

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

@@ -29,7 +29,6 @@
 #include "parasiteBuffer.h"
 #include "hardwareChannel.h"
 #include "textureContext.h"
-#include "geomNodeContext.h"
 #include "geomContext.h"
 
 ConfigureDef(config_display);
@@ -137,6 +136,5 @@ init_libdisplay() {
   HardwareChannel::init_type();
   ParasiteBuffer::init_type();
   TextureContext::init_type();
-  GeomNodeContext::init_type();
   GeomContext::init_type();
 }

+ 0 - 1
panda/src/display/display_composite1.cxx

@@ -1,7 +1,6 @@
 #include "drawableRegion.cxx"
 #include "displayRegion.cxx"
 #include "geomContext.cxx"
-#include "geomNodeContext.cxx"
 #include "graphicsChannel.cxx"
 #include "graphicsEngine.cxx"
 #include "graphicsLayer.cxx"

+ 0 - 27
panda/src/display/geomContext.I

@@ -1,27 +0,0 @@
-// Filename: geomContext.I
-// Created by:  drose (11Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: GeomContext::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE GeomContext::
-GeomContext(Geom *geom) : _geom(geom) {
-}

+ 0 - 29
panda/src/display/geomNodeContext.I

@@ -1,29 +0,0 @@
-// Filename: geomNodeContext.I
-// Created by:  drose (11Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: GeomNodeContext::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE GeomNodeContext::
-GeomNodeContext(GeomNode *node) :
-  _node(node)
-{
-}

+ 0 - 21
panda/src/display/geomNodeContext.cxx

@@ -1,21 +0,0 @@
-// Filename: geomNodeContext.cxx
-// Created by:  drose (11Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "geomNodeContext.h"
-
-TypeHandle GeomNodeContext::_type_handle;

+ 0 - 75
panda/src/display/geomNodeContext.h

@@ -1,75 +0,0 @@
-// Filename: geomNodeContext.h
-// Created by:  drose (11Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef GEOMNODECONTEXT_H
-#define GEOMNODECONTEXT_H
-
-#include "pandabase.h"
-
-#include "savedContext.h"
-
-class GeomNode;
-
-////////////////////////////////////////////////////////////////////
-//       Class : GeomNodeContext
-// Description : This is a special class object, similar to a
-//               TextureContext, that holds all the information
-//               returned by a particular GSG to cache the rendering
-//               information associated with one or more GeomNodes.
-//               This is similar to, but different from, a Geom
-//               context, which is associated with the containing Geom
-//               class; a GSG might prefer to associate data with
-//               either the Geom or the GeomNode or both.
-//
-//               This allows the GSG to precompute some information
-//               necessary for drawing the Geoms as quickly as
-//               possible and reuse that information across multiple
-//               frames.  Typically, only static Geoms
-//               (e.g. nonindexed) will be assigned GeomContexts.
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA GeomNodeContext : public SavedContext {
-public:
-  INLINE GeomNodeContext(GeomNode *node);
-
-  // This cannot be a PT(GeomNode), because the geomNode and the GSG
-  // both own their GeomNodeContexts!  That would create a circular
-  // reference count.
-  GeomNode *_node;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    SavedContext::init_type();
-    register_type(_type_handle, "GeomNodeContext",
-                  SavedContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "geomNodeContext.I"
-
-#endif
-

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

@@ -195,48 +195,6 @@ void GraphicsStateGuardian::
 release_texture(TextureContext *) {
 }
 
-////////////////////////////////////////////////////////////////////
-//     Function: GraphicsStateGuardian::prepare_geom_node
-//       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *GraphicsStateGuardian::
-prepare_geom_node(GeomNode *) {
-  return (GeomNodeContext *)NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: GraphicsStateGuardian::draw_geom_node
-//       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
-////////////////////////////////////////////////////////////////////
-void GraphicsStateGuardian::
-draw_geom_node(GeomNode *node, const RenderState *state,
-               GeomNodeContext *) {
-#if 0   // temporarily disabled until ported to new scene graph
-  int num_geoms = node->get_num_geoms();
-  for (int i = 0; i < num_geoms; i++) {
-    node->get_geom(i)->draw(this);
-  }
-#endif   // temporarily disabled until ported to new scene graph
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: GraphicsStateGuardian::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void GraphicsStateGuardian::
-release_geom_node(GeomNodeContext *) {
-}
-
 ////////////////////////////////////////////////////////////////////
 //     Function: GraphicsStateGuardian::prepare_geom
 //       Access: Public, Virtual
@@ -1262,7 +1220,6 @@ init_frame_pstats() {
   if (PStatClient::is_connected()) {
     _current_textures.clear();
     _current_geoms.clear();
-    _current_geom_nodes.clear();
     _active_texusage_pcollector.clear_level();
     _active_geom_pcollector.clear_level();
     _active_geom_node_pcollector.clear_level();
@@ -1313,24 +1270,6 @@ add_to_geom_record(GeomContext *gc) {
     }
   }
 }
-
-////////////////////////////////////////////////////////////////////
-//     Function: GraphicsStateGuardian::add_to_geom_node_record
-//       Access: Protected
-//  Description: Records that the indicated GeomNode has been drawn
-//               this frame.  This function is only used to update the
-//               PStats current_texmem collector; it gets compiled out
-//               if we aren't using PStats.
-////////////////////////////////////////////////////////////////////
-void GraphicsStateGuardian::
-add_to_geom_node_record(GeomNodeContext *gnc) {
-  if (PStatClient::is_connected()) {
-    if (gnc != (GeomNodeContext *)NULL && 
-        _current_geom_nodes.insert(gnc).second) {
-      _active_geom_node_pcollector.add_level(1);
-    }
-  }
-}
 #endif  // DO_PSTATS
 
 ////////////////////////////////////////////////////////////////////

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

@@ -91,11 +91,6 @@ public:
   virtual void apply_texture(TextureContext *tc);
   virtual void release_texture(TextureContext *tc);
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
-
   virtual GeomContext *prepare_geom(Geom *geom);
   virtual void release_geom(GeomContext *gc);
 
@@ -208,16 +203,13 @@ protected:
   void init_frame_pstats();
   void add_to_texture_record(TextureContext *tc);
   void add_to_geom_record(GeomContext *gc);
-  void add_to_geom_node_record(GeomNodeContext *gnc);
 
   pset<TextureContext *> _current_textures;
   pset<GeomContext *> _current_geoms;
-  pset<GeomNodeContext *> _current_geom_nodes;
 #else
   INLINE void init_frame_pstats() { }
   INLINE void add_to_texture_record(TextureContext *) { }
   INLINE void add_to_geom_record(GeomContext *) { }
-  INLINE void add_to_geom_node_record(GeomNodeContext *) { }
   INLINE void record_state_change(TypeHandle) { }
 #endif
 

+ 1 - 2
panda/src/dxgsg7/Sources.pp

@@ -21,7 +21,7 @@
   // need to install these due to external projects that link directly with libpandadx (bartop)  
   #define INSTALL_HEADERS \
     config_dxgsg7.h dxGraphicsStateGuardian7.I dxGraphicsStateGuardian7.h \
-    dxTextureContext7.h dxGeomNodeContext7.h dxGeomNodeContext7.I dxgsg7base.h
+    dxTextureContext7.h dxgsg7base.h
 
   // build dxGraphicsStateGuardian separately since its so big
   
@@ -35,7 +35,6 @@
     config_dxgsg7.cxx \
     dxgsg7base.cxx \
     dxSavedFrameBuffer7.cxx dxTextureContext7.cxx \
-    dxGeomNodeContext7.cxx \
     wdxGraphicsPipe7.cxx wdxGraphicsWindow7.cxx
 
 #end lib_target

+ 0 - 1
panda/src/dxgsg7/config_dxgsg7.cxx

@@ -150,7 +150,6 @@ init_libdxgsg7() {
   DXGraphicsStateGuardian7::init_type();
   DXSavedFrameBuffer7::init_type();
   DXTextureContext7::init_type();
-  DXGeomNodeContext7::init_type();
 
   wdxGraphicsPipe7::init_type();
   wdxGraphicsWindow7::init_type();

+ 0 - 31
panda/src/dxgsg7/dxGeomNodeContext7.I

@@ -1,31 +0,0 @@
-// Filename: dxGeomNodeContext7.I
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGeomNodeContext7::Constructor
-//       Access: Public                                 
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE DXGeomNodeContext7::
-DXGeomNodeContext7(GeomNode *node) : GeomNodeContext(node)
-{
-  _num_verts = 0;
-  _pVB = NULL;
-  _pXformed_VB = NULL;
-}

+ 0 - 33
panda/src/dxgsg7/dxGeomNodeContext7.cxx

@@ -1,33 +0,0 @@
-// Filename: dxGeomNodeContext7.cxx
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "DXGeomNodeContext7.h"
-
-TypeHandle DXGeomNodeContext7::_type_handle;
-
-DXGeomNodeContext7::~DXGeomNodeContext7()
-{
-   if(_pXformed_VB!=NULL)
-       _pXformed_VB->Release();
-   _pXformed_VB=NULL;
-
-   if(_pVB!=NULL)
-       _pVB->Release();
-   _pVB=NULL;
-}
-

+ 0 - 84
panda/src/dxgsg7/dxGeomNodeContext7.h

@@ -1,84 +0,0 @@
-// Filename: dxGeomNodeContext7.h
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef DXGEOMNODECONTEXT7_H
-#define DXGEOMNODECONTEXT7_H
-
-#include "dxgsg7base.h"
-
-#include "geomNodeContext.h"
-#include "geomNode.h"
-#include "pvector.h"
-
-typedef struct {
-     DWORD nVerts;
-     D3DPRIMITIVETYPE primtype;
-} DPInfo;
-
-////////////////////////////////////////////////////////////////////
-//       Class : DXGeomNodeContext7
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDADX DXGeomNodeContext7 : public GeomNodeContext {
-public:
-  INLINE DXGeomNodeContext7(GeomNode *node);
-  ~DXGeomNodeContext7();
-
-  // A list of the dynamic Geoms within the GeomNode; these aren't
-  // part of the above display list and must be drawn separately
-  typedef pvector< PT(Geom) > Geoms;
-  Geoms _cached_geoms,_other_geoms;
-
-  // VB's are already reference-counted by D3D, no need to make separate panda object to do that
-  // but we will want a way to know if VB has already been xformed by ProcessVerts this frame
-  // if multiple geomnodes share VBs
-
-  LPDIRECT3DVERTEXBUFFER7 _pVB;
-  LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
-
-  int _start_index;   // starting offset of this geom's verts within the VB
-  int _num_verts;     // number of verts used by this geomcontext within the VB
-  
-  BYTE *_pEndofVertData;  // ptr to end of current vert data in VB (note: only used/valid during setup)
-
-  // for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
-  // per geom vector of perprim vectors lengths
-  vector<DPInfo> _PrimInfo;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    GeomNodeContext::init_type();
-    register_type(_type_handle, "DXGeomNodeContext7",
-                  GeomNodeContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "dxGeomNodeContext7.I"
-
-#endif
-

+ 0 - 591
panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx

@@ -5373,594 +5373,3 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DVECTOR& vFrom, D3DVECTOR& vAt,
 
 #endif
 
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian7::prepare_geom_node
-//       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *DXGraphicsStateGuardian7::
-prepare_geom_node(GeomNode *node) {
-#if 0   // temporarily disabled until ported to new scene graph
- if(link_tristrips) {
-  for(int iGeom=0;iGeom<node->get_num_geoms();iGeom++) {
-    dDrawable *drawable1 = node->get_geom(iGeom);
-
-    if(!drawable1->is_of_type(Geom::get_class_type()))
-      continue;
-
-    Geom *geomptr=DCAST(Geom, drawable1);
-    assert(geomptr!=NULL);
-
-    if(!geomptr->is_of_type(GeomTristrip::get_class_type()))
-      continue;
-
-    GeomTristrip *me = DCAST(GeomTristrip, geomptr);
-    assert(me!=NULL);
-
-    int nPrims=me->get_num_prims();
-    if(nPrims==1)
-      continue;
-
-    if(dxgsg7_cat.is_debug()) {
-       static bool bPrintedMsg=false;
-       if(!bPrintedMsg) {
-           dxgsg7_cat.debug() << "linking tristrips together with degenerate tris\n";
-           bPrintedMsg=true;
-       }
-    }
-
-    bool bStripReversalNeeded;
-    unsigned int nOrigTotalVerts=0;
-    PTA_int new_lengths;
-    int p;
-
-    // sum things up so can reserve space for new vecs
-    for(p=0;p<nPrims;p++) {
-      nOrigTotalVerts+=me->get_length(p);
-    }
-
-    // could compute it exactly if I wanted to reproduce all the cTotalVertsOutputSoFar logic in the loop below
-    // might save on memory reallocations. try to overestimate using *3.
-    int cEstimatedTotalVerts=nOrigTotalVerts+nPrims*3-2;
-
-    #define INIT_ATTRVARS(ATTRNAME,PTA_TYPENAME)                                                 \
-       PTA_##PTA_TYPENAME old_##ATTRNAME##s,new_##ATTRNAME##s;                                   \
-       PTA_ushort old_##ATTRNAME##_indices,new_##ATTRNAME##_indices;                             \
-       GeomBindType ATTRNAME##binding;                                                           \
-       me->get_##ATTRNAME##s(old_##ATTRNAME##s, ATTRNAME##binding, old_##ATTRNAME##_indices);    \
-                                                                                                 \
-       PTA_##PTA_TYPENAME::iterator old_##ATTRNAME##_iter=old_##ATTRNAME##s.begin();             \
-       PTA_ushort::iterator old_##ATTRNAME##index_iter;                                          \
-                                                                                                 \
-       if((ATTRNAME##binding!=G_OFF)&&(ATTRNAME##binding!=G_OVERALL)) {                          \
-         if(old_##ATTRNAME##_indices!=NULL) {                                                    \
-             old_##ATTRNAME##index_iter=old_##ATTRNAME##_indices.begin();                        \
-             new_##ATTRNAME##_indices.reserve(cEstimatedTotalVerts);                             \
-         } else {                                                                                \
-             new_##ATTRNAME##s.reserve(cEstimatedTotalVerts);                                    \
-         }                                                                                       \
-       }
-
-    INIT_ATTRVARS(coord,Vertexf);
-    INIT_ATTRVARS(color,Colorf);
-    INIT_ATTRVARS(normal,Normalf);
-    INIT_ATTRVARS(texcoord,TexCoordf);
-
-#define IsOdd(X) (((X) & 0x1)!=0)
-
-    uint cTotalVertsOutputSoFar=0;
-    int nVerts;
-    bool bAddExtraStartVert;
-
-    for(p=0;p<nPrims;p++) {
-      nVerts=me->get_length(p);
-
-         // if bStripStateStartsBackfacing, then if the current strip
-         // ends frontfacing, we can fix the problem by just reversing
-         // the current strip order.  But if the current strip ends
-         // backfacing, this will not work, since last tri is encoded for backfacing slot
-         // so it will be incorrectly backfacing when you put it in a backfacing
-         // slot AND reverse the vtx order.
-
-         // insert an extra pad vertex at the beginning to force the
-         // strip backface-state parity to change (more expensive, since
-         // we make 1 more degen tri).  We always want the first tri
-         // to start in a front-facing slot (unless it's a reversed end
-
-         bStripReversalNeeded = false;
-         bAddExtraStartVert=false;
-
-         if(p==0) {
-           cTotalVertsOutputSoFar+=nVerts+1;
-         } else {
-            if(!IsOdd(cTotalVertsOutputSoFar)) {
-               // we're starting on a backfacing slot
-               if(IsOdd(nVerts)) {
-                  bStripReversalNeeded = true;
-               } else {
-                bAddExtraStartVert=true;
-                cTotalVertsOutputSoFar++;
-               }
-            }
-
-            cTotalVertsOutputSoFar+=nVerts+2;
-            if(p==nPrims-1)
-              cTotalVertsOutputSoFar--;
-         }
-
-#define PERVERTEX_ATTRLOOP(OLDVERT_ITERATOR,NEWVERT_VECTOR,VECLENGTH,NUMSTARTPADDINGATTRS,NUMENDPADDINGATTRS)    \
-          if(bStripReversalNeeded) {                                                        \
-              /* to preserve normal-direction property for backface-cull purposes, */       \
-              /* vtx order must be reversed*/                                               \
-                                                                                            \
-              OLDVERT_ITERATOR+=((VECLENGTH)-1);  /* start at last vert, and go back*/      \
-              /*dxgsg7_cat.debug() << "doing reversal on strip " << p << " of length " << nVerts << endl;*/ \
-                                                                                            \
-              if(p!=0) {                                                                    \
-                 /* copy first vert twice to link with last strip*/                         \
-                 for(int i=0;i<NUMSTARTPADDINGATTRS;i++)                                    \
-                      NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR);                          \
-              }                                                                             \
-                                                                                            \
-              for(int v=0;v<(VECLENGTH);v++,OLDVERT_ITERATOR--) {                           \
-                  NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR);                              \
-              }                                                                             \
-                                                                                            \
-              OLDVERT_ITERATOR++;                                                           \
-                                                                                            \
-              if(p!=(nPrims-1)) {                                                           \
-                  /* copy last vert twice to link to next strip  */                         \
-                 for(int i=0;i<NUMENDPADDINGATTRS;i++)                                      \
-                    NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR);                            \
-              }                                                                             \
-                                                                                            \
-              OLDVERT_ITERATOR+=(VECLENGTH);                                                \
-                                                                                            \
-          } else {                                                                          \
-              if(p!=0) {                                                                    \
-                 /* copy first vert twice to link with last strip*/                         \
-                 for(int i=0;i<NUMSTARTPADDINGATTRS;i++)                                    \
-                      NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR);                          \
-              }                                                                             \
-                                                                                            \
-              for(int v=0;v<(VECLENGTH);v++,OLDVERT_ITERATOR++)                             \
-                  NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR);                              \
-                                                                                            \
-              if(p!=(nPrims-1)) {                                                           \
-                  /* copy last vert twice to link to next strip  */                         \
-                 for(int i=0;i<NUMENDPADDINGATTRS;i++)                                      \
-                    NEWVERT_VECTOR.push_back(*(OLDVERT_ITERATOR-1));                        \
-              }                                                                             \
-          }
-
-
-#define CONVERT_ATTR_VECTOR(ATTRNAME)                                                          \
-      switch(ATTRNAME##binding) {                                                              \
-            case G_OFF:                                                                        \
-            case G_OVERALL:                                                                    \
-                break;                                                                         \
-                                                                                               \
-            case G_PER_PRIM: {                                                                 \
-              /* must convert to per-component*/                                               \
-              /* nPrims*2+origTotalVerts-2 components  */                                      \
-                int veclength=nVerts+2;                                                        \
-                if((p==0)||(p==(nPrims-1)))                                                    \
-                    veclength--;                                                               \
-                if(bAddExtraStartVert)                                                         \
-                   veclength++;                                                                \
-                                                                                               \
-                if(old_##ATTRNAME##_indices!=NULL) {                                           \
-                    for(int v=0;v<veclength;v++)                                               \
-                       new_##ATTRNAME##_indices.push_back(*old_##ATTRNAME##index_iter);        \
-                                                                                               \
-                    old_##ATTRNAME##index_iter++; /* move on to val for next strip*/           \
-                 } else {                                                                      \
-                      for(int v=0;v<veclength;v++)                                             \
-                         new_##ATTRNAME##s.push_back(*old_##ATTRNAME##_iter);                  \
-                                                                                               \
-                      old_##ATTRNAME##_iter++; /* move on to val for next strip*/              \
-                 }                                                                             \
-                 break;                                                                        \
-             }                                                                                 \
-                                                                                               \
-            case G_PER_COMPONENT:                                                              \
-            case G_PER_VERTEX: {                                                               \
-                int veclength,numstartcopies,numendcopies;                                     \
-                                                                                               \
-                if(ATTRNAME##binding==G_PER_VERTEX) {                                          \
-                    veclength=nVerts;                                                          \
-                    numstartcopies=numendcopies=1;                                             \
-                } else {                                                                       \
-                    veclength=nVerts-2;                                                        \
-                    numstartcopies=numendcopies=2;                                             \
-                }                                                                              \
-                if(bAddExtraStartVert)                                                         \
-                   numstartcopies++;                                                           \
-                                                                                               \
-                if(old_##ATTRNAME##_indices!=NULL) {                                           \
-                    PERVERTEX_ATTRLOOP(old_##ATTRNAME##index_iter,new_##ATTRNAME##_indices,veclength,numstartcopies,numendcopies); \
-                } else {                                                                       \
-                    /* non-indexed case */                                                     \
-                    PERVERTEX_ATTRLOOP(old_##ATTRNAME##_iter,new_##ATTRNAME##s,veclength,numstartcopies,numendcopies); \
-                }                                                                              \
-            }                                                                                  \
-            break;                                                                             \
-      }                                                                                        \
-
-
-      CONVERT_ATTR_VECTOR(coord);
-
-      #ifdef _DEBUG
-         if(old_coord_indices==NULL)
-           assert(cTotalVertsOutputSoFar==new_coords.size());
-         else
-           assert(cTotalVertsOutputSoFar==new_coord_indices.size());
-      #endif
-
-      CONVERT_ATTR_VECTOR(color);
-      CONVERT_ATTR_VECTOR(normal);
-      CONVERT_ATTR_VECTOR(texcoord);
-
-    }  // end per-Prim (strip) loop
-
-    if(old_coord_indices!=NULL)  {
-        me->set_coords(old_coords, new_coord_indices);
-        new_lengths.push_back(new_coord_indices.size());
-    } else {
-        me->set_coords(new_coords);
-        new_lengths.push_back(new_coords.size());
-    }
-
-    me->set_lengths(new_lengths);
-    me->set_num_prims(1);
-
-    #define SET_NEW_ATTRIBS(ATTRNAME)                                                                 \
-    if((ATTRNAME##binding!=G_OFF) && (ATTRNAME##binding!=G_OVERALL)) {                                \
-        if(ATTRNAME##binding==G_PER_PRIM)                                                             \
-           ATTRNAME##binding=G_PER_COMPONENT;                                                         \
-        if(old_##ATTRNAME##_indices==NULL) {                                                          \
-           me->set_##ATTRNAME##s(new_##ATTRNAME##s, ATTRNAME##binding);                               \
-        } else {                                                                                      \
-           me->set_##ATTRNAME##s(old_##ATTRNAME##s, ATTRNAME##binding, new_##ATTRNAME##_indices);     \
-        }                                                                                             \
-    }
-    /*
-    int ii;
-    for( ii=0;ii<old_coords.size();ii++)
-        dxgsg7_cat.debug() << "old coord[" << ii <<"] " << old_coords[ii] << endl;
-    dxgsg7_cat.debug() << "=================\n";
-    for(ii=0;ii<new_coords.size();ii++)
-        dxgsg7_cat.debug() << "new coord[" << ii <<"] " << new_coords[ii] << endl;
-    dxgsg7_cat.debug() << "=================\n";
-
-    for( ii=0;ii<old_normals.size();ii++)
-        dxgsg7_cat.debug() << "old norm[" << ii <<"] " << old_normals[ii] << endl;
-    dxgsg7_cat.debug() << "=================\n";
-    for(ii=0;ii<new_normals.size();ii++)
-        dxgsg7_cat.debug() << "new norm[" << ii <<"] " << new_normals[ii] << endl;
-
-    if(old_color_indices!=NULL) {
-
-    for( ii=0;ii<old_color_indices.size();ii++)
-        dxgsg7_cat.debug() << "old colorindex[" << ii <<"] " << old_color_indices[ii] << endl;
-    dxgsg7_cat.debug() << "=================\n";
-    for( ii=0;ii<new_color_indices.size();ii++)
-        dxgsg7_cat.debug() << "new colorindex[" << ii <<"] " << new_color_indices[ii] << endl;
-    }
-    */
-
-    SET_NEW_ATTRIBS(color);
-    SET_NEW_ATTRIBS(normal);
-    SET_NEW_ATTRIBS(texcoord);
-
-    me->make_dirty();
-  }
- } // if(link_tristrips)
-
-  // for now, only using vertexbufs for static Geom, so
-  // Make sure we have at least some static Geoms in the GeomNode;
-  int cNumVerts=0,i,num_geoms = node->get_num_geoms();
-
-  // need to always put in space for color because we might have some scene-graph color we need to add?
-  // will that even work?  I think we'd have to overwrite all the VB colors dynamically, and then restore
-  // them from somewhere if the global color goes away
-
-  DWORD fvfFlags=D3DFVF_XYZ;// | D3DFVF_DIFFUSE;
-
-  for (i = 0; (i < num_geoms); i++) {
-    dDrawable *drawable1 = node->get_geom(i);
-    if(!drawable1->is_of_type(Geom::get_class_type()))
-      continue;
-
-    Geom *geom=DCAST(Geom, drawable1);
-    assert(geom!=NULL);
-
-    DWORD new_fvfFlags=D3DFVF_XYZ;
-
-    if(!geom->is_dynamic()) {
-        cNumVerts+=geom->get_num_vertices();
-        if(geom->get_binding(G_COLOR) != G_OFF)
-            new_fvfFlags |= D3DFVF_DIFFUSE;
-        if(geom->get_binding(G_NORMAL) != G_OFF)
-            new_fvfFlags |= D3DFVF_NORMAL;
-        if(geom->get_binding(G_TEXCOORD) != G_OFF)
-            new_fvfFlags |= (D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE2(0));
-    }
-    if(i!=0) {
-       if(fvfFlags!=new_fvfFlags) {
-           // all primitives within a geom must use the same FVF type for the DrawPrim api
-           dxgsg7_cat.error() << "error creating vertex buffer, geoms within geomnode require differing vertex data types!!\n";
-           exit(1);
-       }
-    } else fvfFlags=new_fvfFlags;
-  }
-
-  if(cNumVerts==0) {
-    // Never mind.
-    return (GeomNodeContext *)NULL;
-  }
-
-  if(cNumVerts>D3DMAXNUMVERTICES) {
-      dxgsg7_cat.error() << "geom node contains more than " << D3DMAXNUMVERTICES << " vertices, cant create 1 vertex buffer\n";
-      exit(1);
-  }
-
-  // Ok, we've got something; use it.
-  DXGeomNodeContext7 *dx_gnc = new DXGeomNodeContext7(node);
-
-  assert(dx_gnc!=NULL);
-
-  // right now there is a 1-1 correspondence b/w vertbufs and geomnodecontexts.
-  // later multiple geomnodecontexts will use the same vertbuf
-
-  HRESULT hr;
-  LPDIRECT3D7 pD3D;
-
-  assert(_pScrn->pD3DDevice!=NULL);
-  hr=_pScrn->pD3DDevice->GetDirect3D(&pD3D);
-  assert(!FAILED(hr));
-  LPDIRECT3DVERTEXBUFFER7 pD3DVertexBuffer;
-  DX_DECLARE_CLEAN(D3DVERTEXBUFFERDESC, VBdesc);
-
-  VBdesc.dwCaps = D3DVBCAPS_WRITEONLY;
-  VBdesc.dwCaps |= _pScrn->bIsTNLDevice ? 0x0 : D3DVBCAPS_SYSTEMMEMORY;
-  VBdesc.dwFVF=fvfFlags;
-  VBdesc.dwNumVertices=cNumVerts;
-
-  hr=pD3D->CreateVertexBuffer(&VBdesc,&pD3DVertexBuffer,0x0);
-  if(FAILED(hr)) {
-    dxgsg7_cat.error() << "error creating vertex buffer: " << ConvD3DErrorToString(hr) << endl;
-    delete dx_gnc;
-    exit(1);
-  }
-
-  dx_gnc->_pVB = pD3DVertexBuffer;
-
-  if(!_pScrn->bIsTNLDevice) {
-      // create VB for ProcessVerts to xform to
-
-      fvfFlags&=~D3DFVF_XYZ;    // switch to xformed vert type
-      fvfFlags&=~D3DFVF_NORMAL; // xformed verts are also lighted, so no normals allowed
-      fvfFlags|=D3DFVF_XYZRHW;
-      VBdesc.dwFVF=fvfFlags;
-
-      hr=pD3D->CreateVertexBuffer(&VBdesc,&pD3DVertexBuffer,0x0);
-      if(FAILED(hr)) {
-          dxgsg7_cat.error() << "error creating xformed vertex buffer: " << ConvD3DErrorToString(hr) << endl;
-          delete dx_gnc;
-          exit(1);
-      }
-
-      dx_gnc->_pXformed_VB = pD3DVertexBuffer;
-  }
-
-  pD3D->Release();
-
-  dx_gnc->_num_verts=0;
-  dx_gnc->_start_index=0;
-
-  LPVOID pVertData=NULL;
-  DWORD dwVBFlags = DDLOCK_NOOVERWRITE | DDLOCK_NOSYSLOCK | DDLOCK_SURFACEMEMORYPTR |
-                    DDLOCK_WAIT | DDLOCK_DISCARDCONTENTS;
-
-  hr=dx_gnc->_pVB->Lock(dwVBFlags,&pVertData,NULL);
-  if(FAILED(hr)) {
-        dxgsg7_cat.error() << "error locking vertex buffer: " << ConvD3DErrorToString(hr) << endl;
-        delete dx_gnc;
-        exit(1);
-  }
-
-  assert(pVertData!=NULL);
-  _pCurrentGeomContext = dx_gnc;
-  _pCurrentGeomContext->_pEndofVertData=(BYTE*)pVertData;
-  _bDrawPrimDoSetupVertexBuffer = true;
-
-
-  for (i = 0; (i < num_geoms); i++) {
-    dDrawable *drawable1 = node->get_geom(i);
-    if(!drawable1->is_of_type(Geom::get_class_type()))
-      continue;
-
-    Geom *geom=DCAST(Geom, drawable1);
-    assert(geom!=NULL);
-
-    if(geom->is_dynamic()) {
-      dx_gnc->_other_geoms.push_back(geom);
-    } else {
-       dx_gnc->_cached_geoms.push_back(geom);
-       node->get_geom(i)->draw(this);
-    }
-  }
-
-  _bDrawPrimDoSetupVertexBuffer = false;
-  _pCurrentGeomContext->_pEndofVertData=NULL;
-  _pCurrentGeomContext = NULL;
-
-  hr=dx_gnc->_pVB->Unlock();
-  if(FAILED(hr)) {
-      dxgsg7_cat.error() << "error unlocking vertex buffer: " << ConvD3DErrorToString(hr) << endl;
-      delete dx_gnc;
-      exit(1);
-  }
-
-  assert(cNumVerts==dx_gnc->_num_verts);
-
-  hr=dx_gnc->_pVB->Optimize(_pScrn->pD3DDevice,0x0);
-  if(FAILED(hr)) {
-      dxgsg7_cat.error() << "error optimizing vertex buffer: " << ConvD3DErrorToString(hr) << endl;
-      delete dx_gnc;
-      exit(1);
-  }
-
-  if(dxgsg7_cat.is_spam())
-      dxgsg7_cat.spam() << "creating vertex buffer of size: " << cNumVerts << endl;
-
-#if 0  //DO_PSTATS
-  float num_verts_after =
-    _vertices_tristrip_pcollector.get_level() +
-    _vertices_trifan_pcollector.get_level() +
-    _vertices_tri_pcollector.get_level() +
-    _vertices_other_pcollector.get_level();
-  float num_verts = num_verts_after - num_verts_before;
-  ggnc->_num_verts = (int)(num_verts + 0.5);
-#endif
-
-  bool inserted = mark_prepared_geom_node(dx_gnc);
-
-  // If this assertion fails, the same GeomNode was prepared twice,
-  // which shouldn't be possible, since the GeomNode itself should
-  // detect this.
-  nassertr(inserted, NULL);
-
-  return dx_gnc;
-#endif   // temporarily disabled until ported to new scene graph
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian7::draw_geom_node
-//       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian7::
-draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) {
-#if 0   // temporarily disabled until ported to new scene graph
-
-  uint i,num_geoms = node->get_num_geoms();
-
-  if (gnc == (GeomNodeContext *)NULL) {
-
-    // We don't have a saved context; just draw the GeomNode in
-    // immediate mode.
-    for (i = 0; i < num_geoms; i++) {
-        node->get_geom(i)->draw(this);
-    }
-    return;
-  }
-
-  // We do have a saved context; use it.
-  add_to_geom_node_record(gnc);
-  DXGeomNodeContext7 *dx_gnc = DCAST(DXGeomNodeContext7, gnc);
-
-  #ifdef _DEBUG
-     assert(dx_gnc->_pVB!=NULL);
-     assert((!_pScrn->bIsTNLDevice)==(dx_gnc->_pXformed_VB!=NULL));
-  #endif
-
-  if(!_pScrn->bIsTNLDevice) {
-      HRESULT hr;
-
-      DWORD PVOp=D3DVOP_CLIP | D3DVOP_TRANSFORM | D3DVOP_EXTENTS;
-
-      D3DVERTEXBUFFERDESC VBdesc;
-      VBdesc.dwSize=sizeof(VBdesc);
-      hr=dx_gnc->_pVB->GetVertexBufferDesc(&VBdesc);   // would be useful to keep fvf in vertbuf struct to avoid having to do this
-      if(FAILED(hr)) {
-        dxgsg7_cat.error() << "error in getvbdesc: " << ConvD3DErrorToString(hr) << endl;
-        exit(1);
-      }
-
-      if(_lighting_enabled && (VBdesc.dwFVF & D3DFVF_NORMAL)) {
-          PVOp|=D3DVOP_LIGHT;
-      }
-
-      hr=dx_gnc->_pXformed_VB->ProcessVertices(PVOp,0,dx_gnc->_num_verts,dx_gnc->_pVB,0,_pScrn->pD3DDevice,0x0);
-      if(FAILED(hr)) {
-        dxgsg7_cat.error() << "error in ProcessVertices: " << ConvD3DErrorToString(hr) << endl;
-        exit(1);
-      }
-
-      // disable clipping, since VB is already xformed and clipped
-      if(_clipping_enabled)
-          _pScrn->pD3DDevice->SetRenderState(D3DRENDERSTATE_CLIPPING, false);
-  }
-
-  // assume we need gouraud for now.  we can make this more complex to select flat conditionally later
-  set_shademode(D3DSHADE_GOURAUD);
-  int cur_startvert=dx_gnc->_start_index;
-
-  for (i = 0; i < dx_gnc->_cached_geoms.size(); i++) {
-    // I think we can just draw them directly? since cant account for issued stuff (since
-    // its already encoded in the VB), and we can set the renderstates here (e.g. gouraud mode)
-    //      dx_gnc->_cached_geoms[i]->draw(this);
-
-     DPInfo *dpi=&dx_gnc->_PrimInfo[i];
-
-     LPDIRECT3DVERTEXBUFFER7 pVB;
-     if(_pScrn->bIsTNLDevice) {
-         pVB=dx_gnc->_pVB;
-     } else {
-         pVB=dx_gnc->_pXformed_VB;
-     }
-
-     HRESULT hr = _pScrn->pD3DDevice->DrawPrimitiveVB(dpi->primtype,pVB,cur_startvert,dpi->nVerts,0x0);
-     TestDrawPrimFailure(DrawPrim,hr,_pScrn->pDD,dpi->nVerts,0);
-
-     cur_startvert+=dpi->nVerts;
-  }
-
-  if((!_pScrn->bIsTNLDevice) && _clipping_enabled)
-      _pScrn->pD3DDevice->SetRenderState(D3DRENDERSTATE_CLIPPING, true);
-
-  // Also draw all the dynamic Geoms.
-  for (i = 0; i < dx_gnc->_other_geoms.size(); i++) {
-      dx_gnc->_other_geoms[i]->draw(this);
-  }
-
-#if 0 //def DO_PSTATS
-    DO_PSTATS_STUFF(PStatTimer timer(_draw_primitive_pcollector));
-    _vertices_display_list_pcollector.add_level(dx_gnc->_num_verts);
-#endif
-#endif   // temporarily disabled until ported to new scene graph
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian7::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian7::
-release_geom_node(GeomNodeContext *gnc) {
-#if 0   // temporarily disabled until ported to new scene graph
-  if (gnc != (GeomNodeContext *)NULL) {
-    DXGeomNodeContext7 *dx_gnc = DCAST(DXGeomNodeContext7, gnc);
-
-    bool erased = unmark_prepared_geom_node(dx_gnc);
-
-    // If this assertion fails, a GeomNode was released that hadn't
-    // been prepared (or a GeomNode was released twice).
-    nassertv(erased);
-
-    dx_gnc->_node->clear_gsg(this);
-    delete dx_gnc;  // should release vertex buffer
-  }
-#endif   // temporarily disabled until ported to new scene graph
-}

+ 0 - 7
panda/src/dxgsg7/dxGraphicsStateGuardian7.h

@@ -22,7 +22,6 @@
 //#define GSG_VERBOSE 1
 
 #include "dxgsg7base.h"
-#include "dxGeomNodeContext7.h"
 #include "dxTextureContext7.h"
 #include "config_dxgsg7.h"
 
@@ -89,11 +88,6 @@ public:
   virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
   virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
-
   virtual TextureContext *prepare_texture(Texture *tex);
   virtual void apply_texture(TextureContext *tc);
   virtual void release_texture(TextureContext *tc);
@@ -246,7 +240,6 @@ protected:
   D3DSHADEMODE _CurShadeMode;
 
   bool _bDrawPrimDoSetupVertexBuffer;       // if true, draw methods just copy vertex data into pCurrentGeomContext
-  DXGeomNodeContext7 *_pCurrentGeomContext;  // used in vertex buffer setup
 
   // iterators for primitives
   Geom::VertexIterator vi;

+ 0 - 1
panda/src/dxgsg7/dxgsg7_composite1.cxx

@@ -3,6 +3,5 @@
 #include "config_dxgsg7.cxx"
 #include "dxSavedFrameBuffer7.cxx"
 #include "dxTextureContext7.cxx"
-#include "dxGeomNodeContext7.cxx"
 #include "wdxGraphicsPipe7.cxx"
 #include "wdxGraphicsWindow7.cxx"

+ 1 - 2
panda/src/dxgsg8/Sources.pp

@@ -20,7 +20,7 @@
   // need to install these due to external projects that link directly with libpandadx (bartop)  
   #define INSTALL_HEADERS \
     dxgsg8base.h config_dxgsg8.h dxGraphicsStateGuardian8.I dxGraphicsStateGuardian8.h \
-    dxTextureContext8.h dxGeomNodeContext8.h dxGeomNodeContext8.I d3dfont8.h \
+    dxTextureContext8.h d3dfont8.h \
     dxGraphicsDevice8.h
 
   // build dxGraphicsStateGuardian separately since its so big
@@ -35,7 +35,6 @@
   #define INCLUDED_SOURCES \
     config_dxgsg8.cxx \
     dxSavedFrameBuffer8.cxx dxTextureContext8.cxx \
-    dxGeomNodeContext8.cxx \
     d3dfont8.cxx \
     dxGraphicsDevice8.cxx \
     wdxGraphicsPipe8.cxx wdxGraphicsWindow8.cxx

+ 0 - 1
panda/src/dxgsg8/config_dxgsg8.cxx

@@ -195,7 +195,6 @@ init_libdxgsg8() {
   DXGraphicsStateGuardian8::init_type();
   DXSavedFrameBuffer8::init_type();
   DXTextureContext8::init_type();
-  DXGeomNodeContext8::init_type();
 
   wdxGraphicsPipe8::init_type();
   wdxGraphicsWindow8::init_type();

+ 0 - 33
panda/src/dxgsg8/dxGeomNodeContext8.I

@@ -1,33 +0,0 @@
-// Filename: dxGeomNodeContext.I
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGeomNodeContext8::Constructor
-//       Access: Public                                 
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE DXGeomNodeContext8::
-DXGeomNodeContext8(GeomNode *node) : GeomNodeContext(node)
-{
-  _num_verts = 0;
-/*
-  _pVB = NULL;
-  _pXformed_VB = NULL;
-*/  
-}

+ 0 - 35
panda/src/dxgsg8/dxGeomNodeContext8.cxx

@@ -1,35 +0,0 @@
-// Filename: dxGeomNodeContext.cxx
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "dxGeomNodeContext8.h"
-
-TypeHandle DXGeomNodeContext8::_type_handle;
-
-DXGeomNodeContext8::~DXGeomNodeContext8()
-{
-/*
-   if(_pXformed_VB!=NULL)
-       _pXformed_VB->Release();
-   _pXformed_VB=NULL;
-
-   if(_pVB!=NULL)
-       _pVB->Release();
-   _pVB=NULL;
-*/   
-}
-

+ 0 - 89
panda/src/dxgsg8/dxGeomNodeContext8.h

@@ -1,89 +0,0 @@
-// Filename: dxGeomNodeContext8.h
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef DXGEOMNODECONTEXT8_H
-#define DXGEOMNODECONTEXT8_H
-
-#include "dxgsg8base.h"
-
-#include "geomNodeContext.h"
-#include "geomNode.h"
-#include "pvector.h"
-
-typedef struct {
-     DWORD nVerts;
-     D3DPRIMITIVETYPE primtype;
-} DPInfo;
-
-// empty shell unimplemented for DX8 right now
-
-////////////////////////////////////////////////////////////////////
-//       Class : DXGeomNodeContext8
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDADX DXGeomNodeContext8 : public GeomNodeContext {
-public:
-  INLINE DXGeomNodeContext8(GeomNode *node);
-  ~DXGeomNodeContext8();
-
-  // A list of the dynamic Geoms within the GeomNode; these aren't
-  // part of the above display list and must be drawn separately
-  typedef pvector< PT(Geom) > Geoms;
-  Geoms _cached_geoms,_other_geoms;
-
-  // VB's are already reference-counted by D3D, no need to make separate panda object to do that
-  // but we will want a way to know if VB has already been xformed by ProcessVerts this frame
-  // if multiple geomnodes share VBs
-
-/*  unimplemented right now
-  LPDIRECT3DVERTEXBUFFER7 _pVB;
-  LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
-*/  
-  
-
-  int _start_index;   // starting offset of this geom's verts within the VB
-  int _num_verts;     // number of verts used by this geomcontext within the VB
-  
-  BYTE *_pEndofVertData;  // ptr to end of current vert data in VB (note: only used/valid during setup)
-
-  // for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
-  // per geom vector of perprim vectors lengths
-  vector<DPInfo> _PrimInfo;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    GeomNodeContext::init_type();
-    register_type(_type_handle, "DXGeomNodeContext8",
-                  GeomNodeContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "dxGeomNodeContext8.I"
-
-#endif
-

+ 0 - 39
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

@@ -5075,45 +5075,6 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DXVECTOR3& vFrom, D3DXVECTOR3& vAt,
 
 #endif
 
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian8::prepare_geom_node
-//       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *DXGraphicsStateGuardian8::
-prepare_geom_node(GeomNode *node) {
-  dxgsg8_cat.error() << "prepare_geom_node unimplemented for DX8!\n";
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian8::draw_geom_node
-//       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian8::
-draw_geom_node(GeomNode *node, const RenderState *state,
-               GeomNodeContext *gnc) {
-  return;  // unimplemented
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian8::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian8::
-release_geom_node(GeomNodeContext *gnc) {
-}
-
 HRESULT CreateDX8Cursor(LPDIRECT3DDEVICE8 pd3dDevice, HCURSOR hCursor,BOOL bAddWatermark) {
 // copied directly from dxsdk SetDeviceCursor
     HRESULT hr = E_FAIL;

+ 0 - 7
panda/src/dxgsg8/dxGraphicsStateGuardian8.h

@@ -22,7 +22,6 @@
 //#define GSG_VERBOSE 1
 
 #include "dxgsg8base.h"
-#include "dxGeomNodeContext8.h"
 #include "dxTextureContext8.h"
 #include "d3dfont8.h"
 #include "config_dxgsg8.h"
@@ -93,11 +92,6 @@ public:
   virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
   virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
-
   virtual TextureContext *prepare_texture(Texture *tex);
   virtual void apply_texture(TextureContext *tc);
   virtual void release_texture(TextureContext *tc);
@@ -248,7 +242,6 @@ protected:
   bool _bGouraudShadingOn;
   UINT _color_writemask;
   bool _bDrawPrimDoSetupVertexBuffer;       // if true, draw methods just copy vertex data into pCurrentGeomContext
-  DXGeomNodeContext8 *_pCurrentGeomContext;  // used in vertex buffer setup
 
   // iterators for primitives
   Geom::VertexIterator vi;

+ 0 - 1
panda/src/dxgsg8/dxgsg8_composite1.cxx

@@ -2,7 +2,6 @@
 #include "config_dxgsg8.cxx"
 #include "dxSavedFrameBuffer8.cxx"
 #include "dxTextureContext8.cxx"
-#include "dxGeomNodeContext8.cxx"
 #include "d3dfont8.cxx"
 #include "wdxGraphicsPipe8.cxx"
 #include "wdxGraphicsWindow8.cxx"

+ 1 - 2
panda/src/dxgsg9/Sources.pp

@@ -18,7 +18,7 @@
   // need to install these due to external projects that link directly with libpandadx (bartop)  
   #define INSTALL_HEADERS \
     dxgsg9base.h config_dxgsg9.h dxGraphicsStateGuardian9.I dxGraphicsStateGuardian9.h \
-    dxTextureContext9.h dxGeomNodeContext9.h dxGeomNodeContext9.I d3dfont9.h \
+    dxTextureContext9.h d3dfont9.h \
     dxGraphicsDevice9.h
 
   // build dxGraphicsStateGuardian separately since its so big
@@ -33,7 +33,6 @@
   #define INCLUDED_SOURCES \
     config_dxgsg9.cxx \
     dxSavedFrameBuffer9.cxx dxTextureContext9.cxx \
-    dxGeomNodeContext9.cxx \
     d3dfont9.cxx \
     dxGraphicsDevice9.cxx \
     wdxGraphicsPipe9.cxx wdxGraphicsWindow9.cxx

+ 0 - 1
panda/src/dxgsg9/config_dxgsg9.cxx

@@ -195,7 +195,6 @@ init_libdxgsg9() {
   DXGraphicsStateGuardian9::init_type();
   DXSavedFrameBuffer9::init_type();
   DXTextureContext9::init_type();
-  DXGeomNodeContext9::init_type();
 
   wdxGraphicsPipe9::init_type();
   wdxGraphicsWindow9::init_type();

+ 0 - 33
panda/src/dxgsg9/dxGeomNodeContext9.I

@@ -1,33 +0,0 @@
-// Filename: dxGeomNodeContext.I
-// Created by:   masad (02Jan04)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGeomNodeContext9::Constructor
-//       Access: Public                                 
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE DXGeomNodeContext9::
-DXGeomNodeContext9(GeomNode *node) : GeomNodeContext(node)
-{
-  _num_verts = 0;
-/*
-  _pVB = NULL;
-  _pXformed_VB = NULL;
-*/  
-}

+ 0 - 35
panda/src/dxgsg9/dxGeomNodeContext9.cxx

@@ -1,35 +0,0 @@
-// Filename: dxGeomNodeContext.cxx
-// Created by:   masad (02Jan04)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "dxGeomNodeContext9.h"
-
-TypeHandle DXGeomNodeContext9::_type_handle;
-
-DXGeomNodeContext9::~DXGeomNodeContext9()
-{
-/*
-   if(_pXformed_VB!=NULL)
-       _pXformed_VB->Release();
-   _pXformed_VB=NULL;
-
-   if(_pVB!=NULL)
-       _pVB->Release();
-   _pVB=NULL;
-*/   
-}
-

+ 0 - 89
panda/src/dxgsg9/dxGeomNodeContext9.h

@@ -1,89 +0,0 @@
-// Filename: dxGeomNodeContext8.h
-// Created by:  masad (02Jan04)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#ifndef DXGEOMNODECONTEXT9_H
-#define DXGEOMNODECONTEXT9_H
-
-#include "dxgsg9base.h"
-
-#include "geomNodeContext.h"
-#include "geomNode.h"
-#include "pvector.h"
-
-typedef struct {
-     DWORD nVerts;
-     D3DPRIMITIVETYPE primtype;
-} DPInfo;
-
-// empty shell unimplemented for DX9 right now
-
-////////////////////////////////////////////////////////////////////
-//       Class : DXGeomNodeContext9
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDADX DXGeomNodeContext9 : public GeomNodeContext {
-public:
-  INLINE DXGeomNodeContext9(GeomNode *node);
-  ~DXGeomNodeContext9();
-
-  // A list of the dynamic Geoms within the GeomNode; these aren't
-  // part of the above display list and must be drawn separately
-  typedef pvector< PT(Geom) > Geoms;
-  Geoms _cached_geoms,_other_geoms;
-
-  // VB's are already reference-counted by D3D, no need to make separate panda object to do that
-  // but we will want a way to know if VB has already been xformed by ProcessVerts this frame
-  // if multiple geomnodes share VBs
-
-/*  unimplemented right now
-  LPDIRECT3DVERTEXBUFFER7 _pVB;
-  LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
-*/  
-  
-
-  int _start_index;   // starting offset of this geom's verts within the VB
-  int _num_verts;     // number of verts used by this geomcontext within the VB
-  
-  BYTE *_pEndofVertData;  // ptr to end of current vert data in VB (note: only used/valid during setup)
-
-  // for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
-  // per geom vector of perprim vectors lengths
-  vector<DPInfo> _PrimInfo;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    GeomNodeContext::init_type();
-    register_type(_type_handle, "DXGeomNodeContext9",
-                  GeomNodeContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "dxGeomNodeContext9.I"
-
-#endif
-

+ 0 - 38
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -5076,44 +5076,6 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DXVECTOR3& vFrom, D3DXVECTOR3& vAt,
 #endif
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian9::prepare_geom_node
-//       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *DXGraphicsStateGuardian9::
-prepare_geom_node(GeomNode *node) {
-  dxgsg9_cat.error() << "prepare_geom_node unimplemented for DX9!\n";
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian9::draw_geom_node
-//       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian9::
-draw_geom_node(GeomNode *node, const RenderState *state,
-               GeomNodeContext *gnc) {
-  return;  // unimplemented
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian9::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian9::
-release_geom_node(GeomNodeContext *gnc) {
-}
-
 HRESULT CreateDX9Cursor(LPDIRECT3DDEVICE9 pd3dDevice, HCURSOR hCursor,BOOL bAddWatermark) {
 // copied directly from dxsdk SetDeviceCursor
     HRESULT hr = E_FAIL;

+ 0 - 7
panda/src/dxgsg9/dxGraphicsStateGuardian9.h

@@ -22,7 +22,6 @@
 //#define GSG_VERBOSE 1
 
 #include "dxgsg9base.h"
-#include "dxGeomNodeContext9.h"
 #include "dxTextureContext9.h"
 #include "d3dfont9.h"
 #include "config_dxgsg9.h"
@@ -93,11 +92,6 @@ public:
   virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
   virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
-
   virtual TextureContext *prepare_texture(Texture *tex);
   virtual void apply_texture(TextureContext *tc);
   virtual void release_texture(TextureContext *tc);
@@ -248,7 +242,6 @@ protected:
   bool _bGouraudShadingOn;
   UINT _color_writemask;
   bool _bDrawPrimDoSetupVertexBuffer;       // if true, draw methods just copy vertex data into pCurrentGeomContext
-  DXGeomNodeContext9 *_pCurrentGeomContext;  // used in vertex buffer setup
 
   // iterators for primitives
   Geom::VertexIterator vi;

+ 0 - 1
panda/src/dxgsg9/dxgsg9_composite1.cxx

@@ -2,7 +2,6 @@
 #include "config_dxgsg9.cxx"
 #include "dxSavedFrameBuffer9.cxx"
 #include "dxTextureContext9.cxx"
-#include "dxGeomNodeContext9.cxx"
 #include "d3dfont9.cxx"
 #include "wdxGraphicsPipe9.cxx"
 #include "wdxGraphicsWindow9.cxx"

+ 4 - 4
panda/src/glstuff/Sources.pp

@@ -15,6 +15,9 @@
      glstuff_src.cxx \
      glstuff_src.h \
      glstuff_undef_src.h \
+     glGeomContext_src.cxx \
+     glGeomContext_src.I \
+     glGeomContext_src.h \
      glGraphicsStateGuardian_src.cxx \
      glGraphicsStateGuardian_src.I \
      glGraphicsStateGuardian_src.h \
@@ -23,10 +26,7 @@
      glSavedFrameBuffer_src.h \
      glTextureContext_src.cxx \
      glTextureContext_src.I \
-     glTextureContext_src.h \
-     glGeomNodeContext_src.cxx \
-     glGeomNodeContext_src.I \
-     glGeomNodeContext_src.h
+     glTextureContext_src.h
 
   #define SOURCES \
     $[INSTALL_HEADERS] glpure.cxx

+ 9 - 7
panda/src/crgsg/crGeomNodeContext.I → panda/src/glstuff/glGeomContext_src.I

@@ -1,5 +1,5 @@
-// Filename: chromium.GeomNodeContext.I
-// Created by:  drose (12Jun01)
+// Filename: glGeomContext_src.I
+// Created by:  drose (19Mar04)
 //
 ////////////////////////////////////////////////////////////////////
 //
@@ -18,14 +18,16 @@
 
 
 ////////////////////////////////////////////////////////////////////
-//     Function: CRGeomNodeContext::Constructor
+//     Function: CLP(GeomContext)::Constructor
 //       Access: Public
 //  Description:
 ////////////////////////////////////////////////////////////////////
-INLINE CRGeomNodeContext::
-CRGeomNodeContext(GeomNode *node) :
-  GeomNodeContext(node)
+INLINE CLP(GeomContext)::
+CLP(GeomContext)(Geom *geom) :
+  GeomContext(geom)
 {
   _index = 0;
-  DO_PSTATS_STUFF(_num_verts = 0;)
+#ifdef DO_PSTATS
+  _num_verts = 0;
+#endif
 }

+ 4 - 3
panda/src/glstuff/glGeomNodeContext_src.cxx → panda/src/glstuff/glGeomContext_src.cxx

@@ -1,5 +1,5 @@
-// Filename: glGeomNodeContext_src.cxx
-// Created by:  drose (12Jun01)
+// Filename: glGeomContext_src.cxx
+// Created by:  drose (19Mar04)
 //
 ////////////////////////////////////////////////////////////////////
 //
@@ -16,4 +16,5 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-TypeHandle CLP(GeomNodeContext)::_type_handle;
+TypeHandle CLP(GeomContext)::_type_handle;
+

+ 18 - 24
panda/src/crgsg/crSavedFrameBuffer.h → panda/src/glstuff/glGeomContext_src.h

@@ -1,5 +1,5 @@
-// Filename: chromium.SavedFrameBuffer.h
-// Created by:  drose (06Oct99)
+// Filename: glGeomContext_src.h
+// Created by:  drose (19Mar04)
 //
 ////////////////////////////////////////////////////////////////////
 //
@@ -16,38 +16,34 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-#ifndef CRSAVEDFRAMEBUFFER_H
-#define CRSAVEDFRAMEBUFFER_H
-
 #include "pandabase.h"
-
-#include "savedFrameBuffer.h"
-#include "texture.h"
-#include "textureContext.h"
-#include "pixelBuffer.h"
-
+#include "geomContext.h"
 
 ////////////////////////////////////////////////////////////////////
-//       Class : CRSavedFrameBuffer
+//       Class : GLGeomContext
 // Description :
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDACR CRSavedFrameBuffer : public SavedFrameBuffer {
+class EXPCL_GL CLP(GeomContext) : public GeomContext {
 public:
-  INLINE CRSavedFrameBuffer(const RenderBuffer &buffer,
-                            CPT(DisplayRegion) dr);
-  INLINE ~CRSavedFrameBuffer();
+  INLINE CLP(GeomContext)(Geom *geom);
 
-  PT(Texture) _back_rgba;
-  PT(PixelBuffer) _depth;
+  // This is the GL display list index.
+  GLuint _index;
+
+  // The number of vertices encoded in the display list, for stats
+  // reporting.
+#ifdef DO_PSTATS
+  int _num_verts;
+#endif
 
 public:
   static TypeHandle get_class_type() {
     return _type_handle;
   }
   static void init_type() {
-    SavedFrameBuffer::init_type();
-    register_type(_type_handle, "CRSavedFrameBuffer",
-                  SavedFrameBuffer::get_class_type());
+    GeomContext::init_type();
+    register_type(_type_handle, CLASSPREFIX_QUOTED "GeomContext",
+                  GeomContext::get_class_type());
   }
   virtual TypeHandle get_type() const {
     return get_class_type();
@@ -58,7 +54,5 @@ private:
   static TypeHandle _type_handle;
 };
 
-#include "crSavedFrameBuffer.I"
-
-#endif
+#include "glGeomContext_src.I"
 

+ 0 - 31
panda/src/glstuff/glGeomNodeContext_src.I

@@ -1,31 +0,0 @@
-// Filename: glGeomNodeContext_src.I
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: CLP(GeomNodeContext)::Constructor
-//       Access: Public
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE CLP(GeomNodeContext)::
-CLP(GeomNodeContext)(GeomNode *node) :
-  GeomNodeContext(node)
-{
-  _index = 0;
-  DO_PSTATS_STUFF(_num_verts = 0;)
-}

+ 0 - 63
panda/src/glstuff/glGeomNodeContext_src.h

@@ -1,63 +0,0 @@
-// Filename: glGeomNodeContext_src.h
-// Created by:  drose (12Jun01)
-//
-////////////////////////////////////////////////////////////////////
-//
-// PANDA 3D SOFTWARE
-// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
-//
-// All use of this software is subject to the terms of the Panda 3d
-// Software license.  You should have received a copy of this license
-// along with this source code; you will also find a current copy of
-// the license at http://etc.cmu.edu/panda3d/docs/license/ .
-//
-// To contact the maintainers of this program write to
-// [email protected] .
-//
-////////////////////////////////////////////////////////////////////
-
-#include "pandabase.h"
-#include "geomNodeContext.h"
-#include "geomNode.h"
-#include "pvector.h"
-
-////////////////////////////////////////////////////////////////////
-//       Class : GLGeomNodeContext
-// Description :
-////////////////////////////////////////////////////////////////////
-class EXPCL_GL CLP(GeomNodeContext) : public GeomNodeContext {
-public:
-  INLINE CLP(GeomNodeContext)(GeomNode *node);
-
-  // The GL display list index that draws the contents of this
-  // GeomNode.
-  GLuint _index;
-
-  // A list of the dynamic Geoms within the GeomNode; these aren't
-  // part of the above display list.
-  typedef pvector< PT(Geom) > Geoms;
-  Geoms _dynamic_geoms;
-
-  // The number of vertices represented by the display list.  This is
-  // strictly for the benefit of PStats reporting.
-  DO_PSTATS_STUFF(int _num_verts;)
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    GeomNodeContext::init_type();
-    register_type(_type_handle, CLASSPREFIX_QUOTED "GeomNodeContext",
-                  GeomNodeContext::get_class_type());
-  }
-  virtual TypeHandle get_type() const {
-    return get_class_type();
-  }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-
-private:
-  static TypeHandle _type_handle;
-};
-
-#include "glGeomNodeContext_src.I"

+ 160 - 121
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -612,6 +612,8 @@ begin_frame() {
     return false;
   }
 
+  _vertices_display_list_pcollector.clear_level();
+
   report_my_gl_errors();
   return true;
 }
@@ -645,10 +647,23 @@ end_frame() {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_point(GeomPoint *geom, GeomContext *) {
+draw_point(GeomPoint *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_point()" << endl;
 #endif
+
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
+
 #ifdef DO_PSTATS
   PStatTimer timer(_draw_primitive_pcollector);
   _vertices_other_pcollector.add_level(geom->get_num_vertices());
@@ -705,10 +720,22 @@ draw_point(GeomPoint *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_line(GeomLine *geom, GeomContext *) {
+draw_line(GeomLine *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_line()" << endl;
 #endif
+
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   PStatTimer timer(_draw_primitive_pcollector);
   _vertices_other_pcollector.add_level(geom->get_num_vertices());
@@ -776,11 +803,22 @@ draw_line(GeomLine *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_linestrip(GeomLinestrip *geom, GeomContext *) {
+draw_linestrip(GeomLinestrip *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_linestrip()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1147,11 +1185,22 @@ draw_sprite(GeomSprite *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_polygon(GeomPolygon *geom, GeomContext *) {
+draw_polygon(GeomPolygon *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_polygon()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1226,11 +1275,22 @@ draw_polygon(GeomPolygon *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_tri(GeomTri *geom, GeomContext *) {
+draw_tri(GeomTri *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_tri()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1302,11 +1362,22 @@ draw_tri(GeomTri *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_quad(GeomQuad *geom, GeomContext *) {
+draw_quad(GeomQuad *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_quad()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1376,11 +1447,23 @@ draw_quad(GeomQuad *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_tristrip(GeomTristrip *geom, GeomContext *) {
+draw_tristrip(GeomTristrip *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_tristrip()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1472,11 +1555,22 @@ draw_tristrip(GeomTristrip *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_trifan(GeomTrifan *geom, GeomContext *) {
+draw_trifan(GeomTrifan *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_trifan()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1569,11 +1663,22 @@ draw_trifan(GeomTrifan *geom, GeomContext *) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_sphere(GeomSphere *geom, GeomContext *) {
+draw_sphere(GeomSphere *geom, GeomContext *gc) {
 #ifdef GSG_VERBOSE
   GLCAT.spam() << "draw_sphere()" << endl;
 #endif
 
+  if (gc != (GeomContext *)NULL) {
+    _draw_primitive_pcollector.start();
+    CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+    GLP(CallList)(ggc->_index);
+#ifdef DO_PSTATS
+    _vertices_display_list_pcollector.add_level(ggc->_num_verts);
+#endif
+    _draw_primitive_pcollector.stop();
+    return;
+  }
+
 #ifdef DO_PSTATS
   //  PStatTimer timer(_draw_primitive_pcollector);
   // Using PStatTimer may cause a compiler crash.
@@ -1722,43 +1827,34 @@ release_texture(TextureContext *tc) {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: CLP(GraphicsStateGuardian)::prepare_geom_node
+//     Function: CLP(GraphicsStateGuardian)::prepare_geom
 //       Access: Public, Virtual
-//  Description: Prepares the indicated GeomNode for retained-mode
-//               rendering.  If this function returns non-NULL, the
-//               value returned will be passed back to a future call
-//               to draw_geom_node(), which is expected to draw the
-//               contents of the node.
-////////////////////////////////////////////////////////////////////
-GeomNodeContext *CLP(GraphicsStateGuardian)::
-prepare_geom_node(GeomNode *node) {
-#if 0  // temporarily disabled until we bring to new scene graph
-
-  // Make sure we have at least some static Geoms in the GeomNode;
-  // otherwise there's no point in building a display list.
-  int num_geoms = node->get_num_geoms();
-  bool all_dynamic = true;
-  int i;
-
-  for (i = 0; (i < num_geoms) && all_dynamic; i++) {
-    dDrawable *geom = node->get_geom(i);
-    all_dynamic = geom->is_dynamic();
-  }
-  if (all_dynamic) {
-    // Never mind.
-    return (GeomNodeContext *)NULL;
+//  Description: Creates a new retained-mode representation of the
+//               given geom, and returns a newly-allocated
+//               GeomContext pointer to reference it.  It is the
+//               responsibility of the calling function to later
+//               call release_geom() with this same pointer (which
+//               will also delete the pointer).
+//
+//               This function should not be called directly to
+//               prepare a geom.  Instead, call Geom::prepare().
+////////////////////////////////////////////////////////////////////
+GeomContext *CLP(GraphicsStateGuardian)::
+prepare_geom(Geom *geom) {
+  CLP(GeomContext) *ggc = new CLP(GeomContext)(geom);
+  ggc->_index = GLP(GenLists)(1);
+  if (GLCAT.is_debug()) {
+    GLCAT.debug()
+      << "preparing " << *geom << ", index " << ggc->_index << "\n";
   }
-
-  // Ok, we've got something; use it.
-  CLP(GeomNodeContext) *ggnc = new CLP(GeomNodeContext)(node);
-  ggnc->_index = GLP(GenLists)(1);
-  if (ggnc->_index == 0) {
+  if (ggc->_index == 0) {
     GLCAT.error()
       << "Ran out of display list indices.\n";
-    delete ggnc;
-    return (GeomNodeContext *)NULL;
+    delete ggc;
+    return NULL;
   }
 
+  /*
   // We need to temporarily force normals and UV's on, so the display
   // list will have them built in.
   bool old_normals_enabled = _normals_enabled;
@@ -1767,12 +1863,13 @@ prepare_geom_node(GeomNode *node) {
   _normals_enabled = true;
   _texturing_enabled = true;
   _vertex_colors_enabled = true;
+  */
 
 #ifdef DO_PSTATS
   // Count up the number of vertices we're about to render, by
   // checking the PStats vertex counters now, and at the end.  This is
   // kind of hacky, but this is debug code.
-  float num_verts_before = 
+  float num_verts_before =
     _vertices_tristrip_pcollector.get_level() +
     _vertices_trifan_pcollector.get_level() +
     _vertices_tri_pcollector.get_level() +
@@ -1780,109 +1877,51 @@ prepare_geom_node(GeomNode *node) {
 #endif
 
   // Now define the display list.
-  GLP(NewList)(ggnc->_index, GL_COMPILE);
-  for (i = 0; i < num_geoms; i++) {
-    dDrawable *geom = node->get_geom(i);
-    if (geom->is_dynamic()) {
-      // Wait, this is a dynamic Geom.  We can't safely put it in the
-      // display list, because it may change from one frame to the
-      // next; instead, we'll keep it out.
-      ggnc->_dynamic_geoms.push_back(geom);
-    } else {
-      // A static Geom becomes part of the display list.
-      geom->draw(this);
-    }
-  }
+  GLP(NewList)(ggc->_index, GL_COMPILE);
+  geom->draw_immediate(this, NULL);
   GLP(EndList)();
 
 #ifdef DO_PSTATS
-  float num_verts_after = 
+  float num_verts_after =
     _vertices_tristrip_pcollector.get_level() +
     _vertices_trifan_pcollector.get_level() +
     _vertices_tri_pcollector.get_level() +
     _vertices_other_pcollector.get_level();
   float num_verts = num_verts_after - num_verts_before;
-  ggnc->_num_verts = (int)(num_verts + 0.5);
+  ggc->_num_verts = (int)(num_verts + 0.5);
 #endif
 
+  /*
   _normals_enabled = old_normals_enabled;
   _texturing_enabled = old_texturing_enabled;
   _vertex_colors_enabled = old_vertex_colors_enabled;
+  */
 
-  bool inserted = _prepared_objects->mark_prepared_geom_node(ggnc);
-
-  // If this assertion fails, the same GeomNode was prepared twice,
-  // which shouldn't be possible, since the GeomNode itself should
-  // detect this.
-  nassertr(inserted, NULL);
-
-  return ggnc;
-#endif  // temporarily disabled until we bring to new scene graph
-  return NULL;
+  report_my_gl_errors();
+  return ggc;
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: CLP(GraphicsStateGuardian)::draw_geom_node
+//     Function: CLP(GraphicsStateGuardian)::release_geom
 //       Access: Public, Virtual
-//  Description: Draws a GeomNode previously indicated by a call to
-//               prepare_geom_node().
+//  Description: Frees the GL resources previously allocated for the
+//               geom.  This function should never be called
+//               directly; instead, call Geom::release() (or simply
+//               let the Geom destruct).
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
-draw_geom_node(GeomNode *node, const RenderState *state,
-               GeomNodeContext *gnc) {
-#if 0  // temporarily disabled until we bring to new scene graph
-  if (gnc == (GeomNodeContext *)NULL) {
-    // We don't have a saved context; just draw the GeomNode in
-    // immediate mode.
-    int num_geoms = node->get_num_geoms();
-    for (int i = 0; i < num_geoms; i++) {
-      node->get_geom(i)->draw(this);
-    }
-
-  } else {
-    // We do have a saved context; use it.
-    add_to_geom_node_record(gnc);
-    CLP(GeomNodeContext) *ggnc = DCAST(CLP(GeomNodeContext), gnc);
-    GLP(CallList)(ggnc->_index);
-
-#ifdef DO_PSTATS 
-    PStatTimer timer(_draw_primitive_pcollector);
-    _vertices_display_list_pcollector.add_level(ggnc->_num_verts);
-#endif
-
-    // Also draw all the dynamic Geoms.
-    int num_geoms = ggnc->_dynamic_geoms.size();
-    for (int i = 0; i < num_geoms; i++) {
-      ggnc->_dynamic_geoms[i]->draw(this);
-    }
+release_geom(GeomContext *gc) {
+  CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
+  if (GLCAT.is_debug()) {
+    GLCAT.debug()
+      << "releasing index " << ggc->_index << "\n";
   }
-#endif  // temporarily disabled until we bring to new scene graph
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: CLP(GraphicsStateGuardian)::release_geom_node
-//       Access: Public, Virtual
-//  Description: Frees the resources previously allocated via a call
-//               to prepare_geom_node(), including deleting the
-//               GeomNodeContext itself, if necessary.
-////////////////////////////////////////////////////////////////////
-void CLP(GraphicsStateGuardian)::
-release_geom_node(GeomNodeContext *gnc) {
-#if 0  // temporarily disabled until we bring to new scene graph
-  if (gnc != (GeomNodeContext *)NULL) {
-    CLP(GeomNodeContext) *ggnc = DCAST(CLP(GeomNodeContext), gnc);
-    GLP(DeleteLists)(ggnc->_index, 1);
 
-    bool erased = _prepared_objects->unmark_prepared_geom_node(ggnc);
+  GLP(DeleteLists)(ggc->_index, 1);
+  report_my_gl_errors();
 
-    // If this assertion fails, a GeomNode was released that hadn't
-    // been prepared (or a GeomNode was released twice).
-    nassertv(erased);
-    
-    ggnc->_node->clear_gsg(this);
-    delete ggnc;
-  }
-#endif  // temporarily disabled until we bring to new scene graph
+  ggc->_index = 0;
+  delete ggc;
 }
 
 #if 0

+ 2 - 4
panda/src/glstuff/glGraphicsStateGuardian_src.h

@@ -70,10 +70,8 @@ public:
   virtual void apply_texture(TextureContext *tc);
   virtual void release_texture(TextureContext *tc);
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc);
-  virtual void release_geom_node(GeomNodeContext *gnc);
+  virtual GeomContext *prepare_geom(Geom *geom);
+  virtual void release_geom(GeomContext *gc);
 
   virtual void copy_texture(Texture *tex, const DisplayRegion *dr);
   virtual void copy_texture(Texture *tex, const DisplayRegion *dr,

+ 0 - 1
panda/src/glstuff/glSavedFrameBuffer_src.h

@@ -20,7 +20,6 @@
 
 #include "savedFrameBuffer.h"
 #include "texture.h"
-#include "textureContext.h"
 #include "pixelBuffer.h"
 
 

+ 1 - 1
panda/src/glstuff/glmisc_src.cxx

@@ -71,6 +71,6 @@ void CLP(init_classes)() {
   CLP(GraphicsStateGuardian)::init_type();
   CLP(SavedFrameBuffer)::init_type();
   CLP(TextureContext)::init_type();
-  CLP(GeomNodeContext)::init_type();
+  CLP(GeomContext)::init_type();
 }
 

+ 1 - 1
panda/src/glstuff/glstuff_src.cxx

@@ -22,8 +22,8 @@
 // order to include this file.
 
 #include "glmisc_src.cxx"
-#include "glGeomNodeContext_src.cxx"
 #include "glTextureContext_src.cxx"
+#include "glGeomContext_src.cxx"
 #include "glSavedFrameBuffer_src.cxx"
 #include "glGraphicsStateGuardian_src.cxx"
 

+ 1 - 1
panda/src/glstuff/glstuff_src.h

@@ -40,8 +40,8 @@
 #include "glext.h"
 
 #include "glmisc_src.h"
-#include "glGeomNodeContext_src.h"
 #include "glTextureContext_src.h"
+#include "glGeomContext_src.h"
 #include "glSavedFrameBuffer_src.h"
 #include "glGraphicsStateGuardian_src.h"
 

+ 10 - 5
panda/src/gobj/Sources.pp

@@ -11,19 +11,21 @@
   #define SOURCES \
     LOD.I LOD.h \
     boundedObject.I boundedObject.h \
-    config_gobj.h drawable.h geom.I geom.N  \
-    geom.h geomLine.h geomLinestrip.h geomPoint.h geomPolygon.h  \
+    config_gobj.h drawable.h \
+    geom.I geom.h \
+    geomContext.I geomContext.h \
+    geomLine.h geomLinestrip.h geomPoint.h geomPolygon.h  \
     geomQuad.h geomSphere.h geomSprite.I geomSprite.h geomTri.h  \
     geomTrifan.h geomTristrip.h imageBuffer.I imageBuffer.h  \
     material.I material.h materialPool.I materialPool.h  \
     matrixLens.I matrixLens.h \
     orthographicLens.I orthographicLens.h perspectiveLens.I  \
-    perspectiveLens.h pixelBuffer.I pixelBuffer.N  \
+    perspectiveLens.h pixelBuffer.I  \
     pixelBuffer.h \
     preparedGraphicsObjects.I preparedGraphicsObjects.h \
     lens.h lens.I \
     savedContext.I savedContext.h \
-    texture.I texture.N texture.h \
+    texture.I texture.h \
     textureContext.I textureContext.h \
     texturePool.I texturePool.h
     
@@ -31,6 +33,7 @@
     LOD.cxx \
     boundedObject.cxx \
     config_gobj.cxx drawable.cxx geom.cxx  \
+    geomContext.cxx \
     geomLine.cxx geomLinestrip.cxx geomPoint.cxx geomPolygon.cxx  \
     geomQuad.cxx geomSphere.cxx geomSprite.cxx geomTri.cxx  \
     geomTrifan.cxx geomTristrip.cxx imageBuffer.cxx material.cxx  \
@@ -44,7 +47,9 @@
     LOD.I LOD.h \
     boundedObject.I boundedObject.h \
     config_gobj.h \
-    drawable.h geom.I geom.h geomLine.h \
+    drawable.h geom.I geom.h \
+    textureContext.I textureContext.h \
+    geomLine.h \
     geomLinestrip.h geomPoint.h geomPolygon.h geomQuad.h geomSphere.h \
     geomSprite.I geomSprite.h geomTri.h geomTrifan.h geomTristrip.h \
     geomprimitives.h imageBuffer.I imageBuffer.h material.I material.h \

+ 0 - 12
panda/src/gobj/geom.N

@@ -1,12 +0,0 @@
-ignoremember GetNextVertex
-ignoremember GetNextNormal
-ignoremember GetNextTexCoord
-ignoremember GetNextColor
-ignoremember get_coords
-ignoremember get_normals
-ignoremember get_colors
-ignoremember get_texcoords
-ignoreinvolved VertexIterator
-ignoreinvolved NormalIterator
-ignoreinvolved TexCoordIterator
-ignoreinvolved ColorIterator

+ 118 - 71
panda/src/gobj/geom.cxx

@@ -28,6 +28,7 @@
 #include "ioPtaDatagramShort.h"
 #include "ioPtaDatagramInt.h"
 #include "ioPtaDatagramLinMath.h"
+#include "preparedGraphicsObjects.h"
 #include "indent.h"
 
 ////////////////////////////////////////////////////////////////////
@@ -137,11 +138,8 @@ ostream &operator << (ostream &out, GeomAttrType t) {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 Geom::
-Geom(void) : dDrawable() {
-  /*
-  _prepared_gsg = (GraphicsStateGuardianBase *)NULL;
-  _prepared_context = (GeomContext *)NULL;
-  */
+Geom() {
+  _all_dirty_flags = 0;
   init();
 }
 
@@ -152,10 +150,7 @@ Geom(void) : dDrawable() {
 ////////////////////////////////////////////////////////////////////
 Geom::
 Geom(const Geom& copy) : dDrawable() {
-  /*
-  _prepared_gsg = (GraphicsStateGuardianBase *)NULL;
-  _prepared_context = (GeomContext *)NULL;
-  */
+  _all_dirty_flags = 0;
   *this = copy;
 }
 
@@ -166,7 +161,7 @@ Geom(const Geom& copy) : dDrawable() {
 ////////////////////////////////////////////////////////////////////
 Geom::
 ~Geom() {
-  //  unprepare();
+  release_all();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -420,6 +415,23 @@ is_dynamic() const {
   return (_vindex != (ushort*)0L);
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: Geom::prepare
+//       Access: Published
+//  Description: Indicates that the geom should be enqueued to be
+//               prepared in the indicated prepared_objects at the
+//               beginning of the next frame.  This will ensure the
+//               geom is already loaded into the GSG if it is expected
+//               to be rendered soon.
+//
+//               Use this function instead of prepare_now() to preload
+//               geoms from a user interface standpoint.
+////////////////////////////////////////////////////////////////////
+void Geom::
+prepare(PreparedGraphicsObjects *prepared_objects) {
+  prepared_objects->enqueue_geom(this);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: Geom::explode
 //       Access: Public, Virtual
@@ -464,14 +476,17 @@ get_tris() const {
 ////////////////////////////////////////////////////////////////////
 void Geom::
 draw(GraphicsStateGuardianBase *gsg) {
+  PreparedGraphicsObjects *prepared_objects = gsg->get_prepared_objects();
   if (is_dirty()) {
     config(); 
+    release(prepared_objects);
   }
-  /*
-  if (_prepared_gsg == gsg) {
-    draw_immediate(gsg, _prepared_context);
-    } else */ {
-    draw_immediate(gsg, (GeomContext *)NULL);
+
+  if (retained_mode) {
+    GeomContext *gc = prepare_now(gsg->get_prepared_objects(), gsg);
+    draw_immediate(gsg, gc);
+  } else {
+    draw_immediate(gsg, NULL);
   }
 }
 
@@ -516,9 +531,6 @@ config() {
   } else {
     _get_color = get_color_noop;
   }
-
-  // Mark the Geom as needing to be prepared again.
-  //  unprepare();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -552,81 +564,94 @@ output(ostream &out) const {
   */
 }
 
-/*
 ////////////////////////////////////////////////////////////////////
-//     Function: Geom::prepare
+//     Function: Geom::prepare_now
 //       Access: Public
-//  Description: Creates a context for the Geom on the particular
+//  Description: Creates a context for the geom on the particular
 //               GSG, if it does not already exist.  Returns the new
-//               (or old) GeomContext.
+//               (or old) GeomContext.  This assumes that the
+//               GraphicsStateGuardian is the currently active
+//               rendering context and that it is ready to accept new
+//               geoms.  If this is not necessarily the case, you
+//               should use prepare() instead.
 //
-//               If the given GeomContext pointer is non-NULL, it will
-//               be passed to the GSG, which may or may not choose to
-//               extend the existing GeomContext, or create a totally
-//               new one.
+//               Normally, this is not called directly except by the
+//               GraphicsStateGuardian; a geom does not need to be
+//               explicitly prepared by the user before it may be
+//               rendered.
 ////////////////////////////////////////////////////////////////////
 GeomContext *Geom::
-prepare(GraphicsStateGuardianBase *gsg) {
-  if (gsg != _prepared_gsg) {
-    GeomContext *gc = gsg->prepare_geom(this);
-    if (gc != (GeomContext *)NULL) {
-      unprepare();
-      _prepared_context = gc;
-      _prepared_gsg = gsg;
-    }
-    return gc;
+prepare_now(PreparedGraphicsObjects *prepared_objects, 
+            GraphicsStateGuardianBase *gsg) {
+  Contexts::const_iterator ci;
+  ci = _contexts.find(prepared_objects);
+  if (ci != _contexts.end()) {
+    return (*ci).second;
   }
 
-  return _prepared_context;
-}
+  GeomContext *gc = prepared_objects->prepare_geom_now(this, gsg);
+  if (gc != (GeomContext *)NULL) {
+    _contexts[prepared_objects] = gc;
 
-////////////////////////////////////////////////////////////////////
-//     Function: Geom::unprepare
-//       Access: Public
-//  Description: Frees the context allocated on all GSG's for which
-//               the geom has been declared.
-////////////////////////////////////////////////////////////////////
-void Geom::
-unprepare() {
-  if (_prepared_gsg != (GraphicsStateGuardianBase *)NULL) {
-    _prepared_gsg->release_geom(_prepared_context);
-    _prepared_gsg = (GraphicsStateGuardianBase *)NULL;
-    _prepared_context = (GeomContext *)NULL;
+    // Now that we have a new GeomContext with zero dirty flags, our
+    // intersection of all dirty flags must be zero.  This doesn't mean
+    // that some other contexts aren't still dirty, but at least one
+    // context isn't.
+    _all_dirty_flags = 0;
   }
+  return gc;
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: Geom::unprepare
+//     Function: Geom::release
 //       Access: Public
-//  Description: Frees the geom context only on the indicated GSG,
-//               if it exists there.
+//  Description: Frees the geom context only on the indicated object,
+//               if it exists there.  Returns true if it was released,
+//               false if it had not been prepared.
 ////////////////////////////////////////////////////////////////////
-void Geom::
-unprepare(GraphicsStateGuardianBase *gsg) {
-  if (_prepared_gsg == gsg) {
-    _prepared_gsg->release_geom(_prepared_context);
-    _prepared_gsg = (GraphicsStateGuardianBase *)NULL;
-    _prepared_context = (GeomContext *)NULL;
+bool Geom::
+release(PreparedGraphicsObjects *prepared_objects) {
+  Contexts::iterator ci;
+  ci = _contexts.find(prepared_objects);
+  if (ci != _contexts.end()) {
+    GeomContext *gc = (*ci).second;
+    prepared_objects->release_geom(gc);
+    return true;
   }
+
+  // Maybe it wasn't prepared yet, but it's about to be.
+  return prepared_objects->dequeue_geom(this);
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: Geom::clear_gsg
+//     Function: Geom::release_all
 //       Access: Public
-//  Description: Removes the indicated GSG from the Geom's known
-//               GSG's, without actually releasing the geom on that
-//               GSG.  This is intended to be called only from
-//               GSG::release_geom(); it should never be called by
-//               user code.
-////////////////////////////////////////////////////////////////////
-void Geom::
-clear_gsg(GraphicsStateGuardianBase *gsg) {
-  if (_prepared_gsg == gsg) {
-    _prepared_gsg = (GraphicsStateGuardianBase *)NULL;
-    _prepared_context = (GeomContext *)NULL;
+//  Description: Frees the context allocated on all objects for which
+//               the geom has been declared.  Returns the number of
+//               contexts which have been freed.
+////////////////////////////////////////////////////////////////////
+int Geom::
+release_all() {
+  // We have to traverse a copy of the _contexts list, because the
+  // PreparedGraphicsObjects object will call clear_prepared() in response
+  // to each release_geom(), and we don't want to be modifying the
+  // _contexts list while we're traversing it.
+  Contexts temp = _contexts;
+  int num_freed = (int)_contexts.size();
+
+  Contexts::const_iterator ci;
+  for (ci = temp.begin(); ci != temp.end(); ++ci) {
+    PreparedGraphicsObjects *prepared_objects = (*ci).first;
+    GeomContext *gc = (*ci).second;
+    prepared_objects->release_geom(gc);
   }
+
+  // Now that we've called release_geom() on every known context,
+  // the _contexts list should have completely emptied itself.
+  nassertr(_contexts.empty(), num_freed);
+
+  return num_freed;
 }
-*/
 
 ////////////////////////////////////////////////////////////////////
 //     Function: Geom::init
@@ -691,6 +716,28 @@ recompute_bound() {
   return bound;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: Geom::clear_prepared
+//       Access: Private
+//  Description: Removes the indicated PreparedGraphicsObjects table
+//               from the Geom's table, without actually releasing
+//               the geom.  This is intended to be called only from
+//               PreparedGraphicsObjects::release_geom(); it should
+//               never be called by user code.
+////////////////////////////////////////////////////////////////////
+void Geom::
+clear_prepared(PreparedGraphicsObjects *prepared_objects) {
+  Contexts::iterator ci;
+  ci = _contexts.find(prepared_objects);
+  if (ci != _contexts.end()) {
+    _contexts.erase(ci);
+  } else {
+    // If this assertion fails, clear_prepared() was given a
+    // prepared_objects which the geom didn't know about.
+    nassertv(false);
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: Geom::write_datagram
 //       Access: Public

+ 23 - 16
panda/src/gobj/geom.h

@@ -189,6 +189,8 @@ PUBLISHED:
   INLINE const PTA_ushort &get_colors_index() const;
   INLINE const PTA_ushort &get_texcoords_index() const;
 
+  void prepare(PreparedGraphicsObjects *prepared_objects);
+
 public:
   INLINE void set_num_prims(int num);
   INLINE int get_num_prims() const;
@@ -224,12 +226,10 @@ public:
   INLINE ColorIterator make_color_iterator() const;
   INLINE const Colorf &get_next_color(ColorIterator &citerator) const;
 
-  /*
-  GeomContext *prepare(GraphicsStateGuardianBase *gsg);
-  void unprepare();
-  void unprepare(GraphicsStateGuardianBase *gsg);
-  void clear_gsg(GraphicsStateGuardianBase *gsg);
-  */
+  GeomContext *prepare_now(PreparedGraphicsObjects *prepared_objects, 
+                           GraphicsStateGuardianBase *gsg);
+  bool release(PreparedGraphicsObjects *prepared_objects);
+  int release_all();
 
 protected:
   void init();
@@ -257,16 +257,21 @@ protected:
   GetNextTexCoord *_get_texcoord;
   GetNextColor *_get_color;
 
-  // Unlike a Texture, a Geom only stores the pointer to one GSG that
-  // it has been prepared into.  If it is prepared into another GSG,
-  // it automatically unprepares itself from the first one.  This is
-  // intended to reduce memory overhead that would otherwise be
-  // required to support a little-used feature (having two
-  // simultaneous GSG's).
-  /*
-  GraphicsStateGuardianBase *_prepared_gsg;
-  GeomContext *_prepared_context;
-  */
+private:
+  void clear_prepared(PreparedGraphicsObjects *prepared_objects);
+
+  // A Geom keeps a list (actually, a map) of all the
+  // PreparedGraphicsObjects tables that it has been prepared into.
+  // Each PGO conversely keeps a list (a set) of all the Geoms that
+  // have been prepared there.  When either destructs, it removes
+  // itself from the other's list.
+  typedef pmap<PreparedGraphicsObjects *, GeomContext *> Contexts;
+  Contexts _contexts;
+
+  // This value represents the intersection of all the dirty flags of
+  // the various GeomContexts that might be associated with this
+  // geom.
+  int _all_dirty_flags;
 
 public:
   //static void register_with_read_factory(void);
@@ -294,6 +299,8 @@ public:
 private:
   static TypeHandle _type_handle;
 
+  friend class GeomContext;
+  friend class PreparedGraphicsObjects;
 };
 
 INLINE ostream &operator <<(ostream &out, const Geom &geom) {

+ 91 - 0
panda/src/gobj/geomContext.I

@@ -0,0 +1,91 @@
+// Filename: geomContext.I
+// Created by:  drose (19Mar04)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomContext::Constructor
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE GeomContext::
+GeomContext(Geom *geom) :
+  _geom(geom)
+{
+  _dirty_flags = 0;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomContext::mark_dirty
+//       Access: Public
+//  Description: Marks the context "dirty", i.e. its properties are
+//               different from the last time the GSG has seen them.
+//               Presumably, the GSG will respond by updating the
+//               properties and clearing the dirty bits the next time
+//               it renders the geom.
+//
+//               The value is the union of all the bits that are to be
+//               set dirty; bits that are not set in this parameter
+//               are left unchanged.  See Geom::DirtyFlags for a
+//               list of available bits.
+//
+//               Usually this function is not called directly, but
+//               rather is called by Geom::mark_dirty() as a result
+//               of changing properties directly on the geom.
+////////////////////////////////////////////////////////////////////
+INLINE void GeomContext::
+mark_dirty(int flags_to_set) {
+  _dirty_flags |= flags_to_set;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomContext::clear_dirty_flags
+//       Access: Public
+//  Description: Removes the indicated flags from the "dirty" bits.
+//               See mark_dirty().
+//
+//               The value is the union of all the bits that are to be
+//               cleared; if a bit is set in the parameter, it will be
+//               removed from the dirty set.  Bits that are not set in
+//               this parameter are left unchanged.
+//
+//               This function is intended to be called by the GSG
+//               after it has updated the geom parameters.
+////////////////////////////////////////////////////////////////////
+INLINE void GeomContext::
+clear_dirty_flags(int flags_to_clear) {
+  _dirty_flags &= ~flags_to_clear;
+  _geom->_all_dirty_flags &= ~flags_to_clear;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomContext::get_dirty_flags
+//       Access: Public
+//  Description: Returns the current state of the dirty flags.  If
+//               this is non-zero, it represents the union of all
+//               properties that have been changed since the last call
+//               to clear_dirty_flags().
+//
+//               This function is intended to be called by the GSG to
+//               determine what properties need to be updated.  See
+//               Geom::DirtyFlags for a list of possible bits.
+////////////////////////////////////////////////////////////////////
+INLINE int GeomContext::
+get_dirty_flags() const {
+  return _dirty_flags;
+}
+

+ 1 - 1
panda/src/display/geomContext.cxx → panda/src/gobj/geomContext.cxx

@@ -1,5 +1,5 @@
 // Filename: geomContext.cxx
-// Created by:  drose (11Jun01)
+// Created by:  drose (19Mar04)
 //
 ////////////////////////////////////////////////////////////////////
 //

+ 22 - 16
panda/src/display/geomContext.h → panda/src/gobj/geomContext.h

@@ -1,5 +1,5 @@
 // Filename: geomContext.h
-// Created by:  drose (11Jun01)
+// Created by:  drose (19Mar04)
 //
 ////////////////////////////////////////////////////////////////////
 //
@@ -22,25 +22,23 @@
 #include "pandabase.h"
 
 #include "savedContext.h"
-
-class Geom;
+#include "geom.h"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : GeomContext
-// Description : This is a special class object, similar to a
-//               TextureContext, that holds all the information
-//               returned by a particular GSG to cache the rendering
-//               information associated with one or more Geoms.  This
-//               is similar to, but different from, a GeomNode
-//               context, which is associated with the containing
-//               GeomNode class; a GSG might prefer to associate data
-//               with either the Geom or the GeomNode or both.
+// Description : This is a special class object that holds all the
+//               information returned by a particular GSG to indicate
+//               the geom's internal context identifier.
+//
+//               Geoms typically have an immediate-mode and a
+//               retained-mode operation.  When using geoms in
+//               retained-mode (in response to Geom::prepare()),
+//               the GSG will create some internal handle for the
+//               geom and store it here.  The geom stores all of
+//               these handles internally.
 //
-//               This allows the GSG to precompute some information
-//               necessary for drawing the Geoms as quickly as
-//               possible and reuse that information across multiple
-//               frames.  Typically, only static Geoms
-//               (e.g. nonindexed) will be assigned GeomContexts.
+//               In the case of OpenGL, for example, a GeomContext
+//               corresponds to a display list identifier.
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA GeomContext : public SavedContext {
 public:
@@ -51,6 +49,14 @@ public:
   // reference count.
   Geom *_geom;
 
+  INLINE void mark_dirty(int flags_to_set);
+  INLINE void clear_dirty_flags(int flags_to_clear = ~0);
+  INLINE int get_dirty_flags() const;
+
+private:
+  int _dirty_flags;
+
+
 public:
   static TypeHandle get_class_type() {
     return _type_handle;

+ 2 - 1
panda/src/gobj/gobj_composite2.cxx

@@ -1,8 +1,9 @@
 
 #include "config_gobj.cxx"
-#include "LOD.cxx"
 #include "drawable.cxx"
+#include "geomContext.cxx"
 #include "imageBuffer.cxx"
+#include "LOD.cxx"
 #include "material.cxx"
 #include "materialPool.cxx"
 #include "orthographicLens.cxx"

+ 0 - 3
panda/src/gobj/pixelBuffer.N

@@ -1,3 +0,0 @@
-ignoreinvolved Type
-ignoreinvolved Format
-

+ 184 - 9
panda/src/gobj/preparedGraphicsObjects.cxx

@@ -40,10 +40,10 @@ PreparedGraphicsObjects() {
 ////////////////////////////////////////////////////////////////////
 PreparedGraphicsObjects::
 ~PreparedGraphicsObjects() {
-  // There may be texture objects that are still prepared when we
-  // destruct.  If this is so, then all of the GSG's that own them
-  // have already destructed, so we can assume their resources were
-  // internally cleaned up.  Quietly erase these remaining textures.
+  // There may be objects that are still prepared when we destruct.
+  // If this is so, then all of the GSG's that own them have already
+  // destructed, so we can assume their resources were internally
+  // cleaned up.  Quietly erase these remaining objects.
 
   MutexHolder holder(_lock);
 
@@ -59,6 +59,18 @@ PreparedGraphicsObjects::
   _prepared_textures.clear();
   _released_textures.clear();
   _enqueued_textures.clear();
+
+  Geoms::iterator gci;
+  for (gci = _prepared_geoms.begin();
+       gci != _prepared_geoms.end();
+       ++gci) {
+    GeomContext *gc = (*gci);
+    gc->_geom->clear_prepared(this);
+  }
+
+  _prepared_geoms.clear();
+  _released_geoms.clear();
+  _enqueued_geoms.clear();
 }
 
 
@@ -206,6 +218,147 @@ prepare_texture_now(Texture *tex, GraphicsStateGuardianBase *gsg) {
   return tc;
 }
 
+
+////////////////////////////////////////////////////////////////////
+//     Function: PreparedGraphicsObjects::enqueue_geom
+//       Access: Public
+//  Description: Indicates that a geom would like to be put on the
+//               list to be prepared when the GSG is next ready to
+//               do this (presumably at the next frame).
+////////////////////////////////////////////////////////////////////
+void PreparedGraphicsObjects::
+enqueue_geom(Geom *geom) {
+  MutexHolder holder(_lock);
+
+  _enqueued_geoms.insert(geom);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PreparedGraphicsObjects::dequeue_geom
+//       Access: Public
+//  Description: Removes a geom from the queued list of geoms to
+//               be prepared.  Normally it is not necessary to call
+//               this, unless you change your mind about preparing it
+//               at the last minute, since the geom will
+//               automatically be dequeued and prepared at the next
+//               frame.
+//
+//               The return value is true if the geom is
+//               successfully dequeued, false if it had not been
+//               queued.
+////////////////////////////////////////////////////////////////////
+bool PreparedGraphicsObjects::
+dequeue_geom(Geom *geom) {
+  MutexHolder holder(_lock);
+
+  EnqueuedGeoms::iterator qi = _enqueued_geoms.find(geom);
+  if (qi != _enqueued_geoms.end()) {
+    _enqueued_geoms.erase(qi);
+    return true;
+  }
+  return false;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PreparedGraphicsObjects::release_geom
+//       Access: Public
+//  Description: Indicates that a geom context, created by a
+//               previous call to prepare_geom(), is no longer
+//               needed.  The driver resources will not be freed until
+//               some GSG calls update(), indicating it is at a
+//               stage where it is ready to release geoms--this
+//               prevents conflicts from threading or multiple GSG's
+//               sharing geoms (we have no way of knowing which
+//               graphics context is currently active, or what state
+//               it's in, at the time release_geom is called).
+////////////////////////////////////////////////////////////////////
+void PreparedGraphicsObjects::
+release_geom(GeomContext *gc) {
+  MutexHolder holder(_lock);
+
+  gc->_geom->clear_prepared(this);
+
+  // We have to set the Geom pointer to NULL at this point, since
+  // the Geom itself might destruct at any time after it has been
+  // released.
+  gc->_geom = (Geom *)NULL;
+
+  bool removed = (_prepared_geoms.erase(gc) != 0);
+  nassertv(removed);
+
+  _released_geoms.insert(gc);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PreparedGraphicsObjects::release_all_geoms
+//       Access: Public
+//  Description: Releases all geoms at once.  This will force them
+//               to be reloaded into geom memory for all GSG's that
+//               share this object.  Returns the number of geoms
+//               released.
+////////////////////////////////////////////////////////////////////
+int PreparedGraphicsObjects::
+release_all_geoms() {
+  MutexHolder holder(_lock);
+
+  int num_geoms = (int)_prepared_geoms.size();
+
+  Geoms::iterator gci;
+  for (gci = _prepared_geoms.begin();
+       gci != _prepared_geoms.end();
+       ++gci) {
+    GeomContext *gc = (*gci);
+    gc->_geom->clear_prepared(this);
+    gc->_geom = (Geom *)NULL;
+
+    _released_geoms.insert(gc);
+  }
+
+  _prepared_geoms.clear();
+
+  return num_geoms;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PreparedGraphicsObjects::prepare_geom_now
+//       Access: Public
+//  Description: Immediately creates a new GeomContext for the
+//               indicated geom and returns it.  This assumes that
+//               the GraphicsStateGuardian is the currently active
+//               rendering context and that it is ready to accept new
+//               geoms.  If this is not necessarily the case, you
+//               should use enqueue_geom() instead.
+//
+//               Normally, this function is not called directly.  Call
+//               Geom::prepare_now() instead.
+//
+//               The GeomContext contains all of the pertinent
+//               information needed by the GSG to keep track of this
+//               one particular geom, and will exist as long as the
+//               geom is ready to be rendered.
+//
+//               When either the Geom or the
+//               PreparedGraphicsObjects object destructs, the
+//               GeomContext will be deleted.
+////////////////////////////////////////////////////////////////////
+GeomContext *PreparedGraphicsObjects::
+prepare_geom_now(Geom *geom, GraphicsStateGuardianBase *gsg) {
+  MutexHolder holder(_lock);
+
+  // Ask the GSG to create a brand new GeomContext.  There might
+  // be several GSG's sharing the same set of geoms; if so, it
+  // doesn't matter which of them creates the context (since they're
+  // all shared anyway).
+  GeomContext *gc = gsg->prepare_geom(geom);
+
+  if (gc != (GeomContext *)NULL) {
+    bool prepared = _prepared_geoms.insert(gc).second;
+    nassertr(prepared, gc);
+  }
+
+  return gc;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: PreparedGraphicsObjects::update
 //       Access: Public
@@ -233,14 +386,36 @@ update(GraphicsStateGuardianBase *gsg) {
 
   _released_textures.clear();
 
+  // Next, release all the geoms awaiting release.
+  Geoms::iterator gci;
+  for (gci = _released_geoms.begin();
+       gci != _released_geoms.end();
+       ++gci) {
+    GeomContext *gc = (*gci);
+    gsg->release_geom(gc);
+  }
+
+  _released_geoms.clear();
+
   // Now prepare all the textures awaiting preparation.
-  EnqueuedTextures::iterator qi;
-  for (qi = _enqueued_textures.begin();
-       qi != _enqueued_textures.end();
-       ++qi) {
-    Texture *tex = (*qi);
+  EnqueuedTextures::iterator qti;
+  for (qti = _enqueued_textures.begin();
+       qti != _enqueued_textures.end();
+       ++qti) {
+    Texture *tex = (*qti);
     tex->prepare_now(this, gsg);
   }
 
   _enqueued_textures.clear();
+
+  // And finally prepare all the geoms awaiting preparation.
+  EnqueuedGeoms::iterator qgi;
+  for (qgi = _enqueued_geoms.begin();
+       qgi != _enqueued_geoms.end();
+       ++qgi) {
+    Geom *geom = (*qgi);
+    geom->prepare_now(this, gsg);
+  }
+
+  _enqueued_geoms.clear();
 }

+ 12 - 1
panda/src/gobj/preparedGraphicsObjects.h

@@ -28,7 +28,6 @@
 
 class TextureContext;
 class GeomContext;
-class GeomNodeContext;
 class GraphicsStateGuardianBase;
 
 ////////////////////////////////////////////////////////////////////
@@ -61,15 +60,27 @@ public:
   int release_all_textures();
 
   TextureContext *prepare_texture_now(Texture *tex, GraphicsStateGuardianBase *gsg);
+
+  void enqueue_geom(Geom *geom);
+  bool dequeue_geom(Geom *geom);
+  void release_geom(GeomContext *gc);
+  int release_all_geoms();
+
+  GeomContext *prepare_geom_now(Geom *geom, GraphicsStateGuardianBase *gsg);
+
   void update(GraphicsStateGuardianBase *gsg);
 
 private:
   typedef pset<TextureContext *> Textures;
   typedef pset< PT(Texture) > EnqueuedTextures;
+  typedef pset<GeomContext *> Geoms;
+  typedef pset< PT(Geom) > EnqueuedGeoms;
 
   Mutex _lock;
   Textures _prepared_textures, _released_textures;  
   EnqueuedTextures _enqueued_textures;
+  Geoms _prepared_geoms, _released_geoms;  
+  EnqueuedGeoms _enqueued_geoms;
 
   static PStatCollector _total_texusage_pcollector;
 

+ 1 - 1
panda/src/gobj/texture.cxx

@@ -485,7 +485,7 @@ is_mipmap(FilterType type) {
 //               GraphicsStateGuardian is the currently active
 //               rendering context and that it is ready to accept new
 //               textures.  If this is not necessarily the case, you
-//               should use prepare_later() instead.
+//               should use prepare() instead.
 //
 //               Normally, this is not called directly except by the
 //               GraphicsStateGuardian; a texture does not need to be

+ 4 - 4
panda/src/gobj/textureContext.h

@@ -32,10 +32,10 @@
 //
 //               Textures typically have an immediate-mode and a
 //               retained-mode operation.  When using textures in
-//               retained-mode (in response to
-//               Texture::prepare_texture()), the GSG will create some
-//               internal handle for the texture and store it here.
-//               The texture stores all of these handles internally.
+//               retained-mode (in response to Texture::prepare()),
+//               the GSG will create some internal handle for the
+//               texture and store it here.  The texture stores all of
+//               these handles internally.
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA TextureContext : public SavedContext {
 public:

+ 0 - 6
panda/src/gsgbase/graphicsStateGuardianBase.h

@@ -30,7 +30,6 @@ class RenderBuffer;
 class GraphicsWindow;
 
 class GeomContext;
-class GeomNodeContext;
 class GeomNode;
 class Geom;
 class GeomPoint;
@@ -118,11 +117,6 @@ public:
   virtual void apply_texture(TextureContext *tc)=0;
   virtual void release_texture(TextureContext *tc)=0;
 
-  virtual GeomNodeContext *prepare_geom_node(GeomNode *node)=0;
-  virtual void draw_geom_node(GeomNode *node, const RenderState *state,
-                              GeomNodeContext *gnc)=0;
-  virtual void release_geom_node(GeomNodeContext *gnc)=0;
-
   virtual GeomContext *prepare_geom(Geom *geom)=0;
   virtual void release_geom(GeomContext *gc)=0;