Package VisionEgg :: Module GL |
[frames] | no frames]

# Source Code for Module VisionEgg.GL

     1  # The Vision Egg: GL
     2  #
     3  # Copyright (C) 2001-2003 Andrew Straw.
     4  # Author: Andrew Straw <astraw@users.sourceforge.net>
     5  # URL: <http://www.visionegg.org/>
     6  #
     7  # Distributed under the terms of the GNU Lesser General Public License
     8  # (LGPL). See LICENSE.TXT that came with this file.
     9  #
    10  # $Id$
    11
    12  """
    13  Vision Egg GL module -- lump all OpenGL names in one namespace.
    14
    15  """
    16
    17  from OpenGL.GL import * # get everything from OpenGL.GL
    18  import OpenGL
    19  import numpy
    20  __version__ = OpenGL.__version__
    21
    22  # tell py2exe we want these modules
    23  try:
    24      import OpenGL.GL.GL__init___
    25  except:
    26      pass
    27  try:
    28      import OpenGL.GL.ARB.multitexture
    29  except:
    30      pass
    31  try:
    32      import OpenGL.GL.EXT.bgra
    33  except:
    34      pass
    35  try:
    36      import SGIS.texture_edge_clamp
    37  except:
    38      pass
    39
    40  # why doesn't PyOpenGL define this?!
    41  try:
    42      GL_UNSIGNED_INT_8_8_8_8_REV
    43  except NameError:
    44      GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367
    45
    46  if OpenGL.__version__[0] == '3':
    47      if (OpenGL.__version__.startswith('3.0.0a')) or (OpenGL.__version__ == '3.0.0b1'):
    48
    49          # A bug in early PyOpenGL 3.x had problems with some arrays
    50          _orig_glLoadMatrixf = glLoadMatrixf
    51 -        def glLoadMatrixf(M):
    52              M = numpy.array([ Mi for Mi in M ])
    53              return _orig_glLoadMatrixf(M)
    54