home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / lib / site-packages / OpenGL / raw / GL / NV / texture_rectangle.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.6 KB  |  55 lines

  1. '''OpenGL extension NV.texture_rectangle
  2.  
  3. Overview (from the spec)
  4.     
  5.     OpenGL texturing is limited to images with power-of-two dimensions
  6.     and an optional 1-texel border.  NV_texture_rectangle extension
  7.     adds a new texture target that supports 2D textures without requiring
  8.     power-of-two dimensions.
  9.     
  10.     Non-power-of-two dimensioned textures are useful for storing
  11.     video images that do not have power-of-two dimensions.  Re-sampling
  12.     artifacts are avoided and less texture memory may be required by using
  13.     non-power-of-two dimensioned textures.  Non-power-of-two dimensioned
  14.     textures are also useful for shadow maps and window-space texturing.
  15.     
  16.     However, non-power-of-two dimensioned (NPOTD) textures have
  17.     limitations that do not apply to power-of-two dimensioned (POT)
  18.     textures.  NPOTD textures may not use mipmap filtering; POTD
  19.     textures support both mipmapped and non-mipmapped filtering.
  20.     NPOTD textures support only the GL_CLAMP, GL_CLAMP_TO_EDGE,
  21.     and GL_CLAMP_TO_BORDER_ARB wrap modes; POTD textures support
  22.     GL_CLAMP_TO_EDGE, GL_REPEAT, GL_CLAMP, GL_MIRRORED_REPEAT_IBM,
  23.     and GL_CLAMP_TO_BORDER.  NPOTD textures do not support an optional
  24.     1-texel border; POTD textures do support an optional 1-texel border.
  25.     
  26.     NPOTD textures are accessed by non-normalized texture coordinates.
  27.     So instead of thinking of the texture image lying in a [0..1]x[0..1]
  28.     range, the NPOTD texture image lies in a [0..w]x[0..h] range.
  29.     
  30.     This extension adds a new texture target and related state (proxy,
  31.     binding, max texture size).
  32.  
  33. The official definition of this extension is available here:
  34.     http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_rectangle.txt
  35.  
  36. Automatically generated by the get_gl_extensions script, do not edit!
  37. '''
  38. from OpenGL import platform, constants, constant, arrays
  39. from OpenGL import extensions
  40. from OpenGL.GL import glget
  41. import ctypes
  42. EXTENSION_NAME = 'GL_NV_texture_rectangle'
  43. GL_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_TEXTURE_RECTANGLE_NV', 0x84F5 )
  44. glget.addGLGetConstant( GL_TEXTURE_RECTANGLE_NV, (1,) )
  45. GL_TEXTURE_BINDING_RECTANGLE_NV = constant.Constant( 'GL_TEXTURE_BINDING_RECTANGLE_NV', 0x84F6 )
  46. glget.addGLGetConstant( GL_TEXTURE_BINDING_RECTANGLE_NV, (1,) )
  47. GL_PROXY_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_PROXY_TEXTURE_RECTANGLE_NV', 0x84F7 )
  48. GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = constant.Constant( 'GL_MAX_RECTANGLE_TEXTURE_SIZE_NV', 0x84F8 )
  49. glget.addGLGetConstant( GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, (1,) )
  50.  
  51.  
  52. def glInitTextureRectangleNV():
  53.     '''Return boolean indicating whether this extension is available'''
  54.     return extensions.hasGLExtension( EXTENSION_NAME )
  55.