1'''OpenGL extension NV.vertex_program4 2 3This module customises the behaviour of the 4OpenGL.raw.GL.NV.vertex_program4 to provide a more 5Python-friendly API 6 7Overview (from the spec) 8 9 This extension builds on the common assembly instruction set 10 infrastructure provided by NV_gpu_program4, adding vertex program-specific 11 features. 12 13 This extension provides the ability to specify integer vertex attributes 14 that are passed to vertex programs using integer data types, rather than 15 being converted to floating-point values as in existing vertex attribute 16 functions. The set of input and output bindings provided includes all 17 bindings supported by ARB_vertex_program. This extension provides 18 additional input bindings identifying the index of the vertex when vertex 19 arrays are used ("vertex.id") and the instance number when instanced 20 arrays are used ("vertex.instance", requires EXT_draw_instanced). It 21 also provides output bindings allowing vertex programs to directly specify 22 clip distances (for user clipping) plus a set of generic attributes that 23 allow programs to pass a greater number of attributes to subsequent 24 pipeline stages than is possible using only the pre-defined fixed-function 25 vertex outputs. 26 27 By and large, programs written to ARB_vertex_program can be ported 28 directly by simply changing the program header from "!!ARBvp1.0" to 29 "!!NVvp4.0", and then modifying instructions to take advantage of the 30 expanded feature set. There are a small number of areas where this 31 extension is not a functional superset of previous vertex program 32 extensions, which are documented in the NV_gpu_program4 specification. 33 34The official definition of this extension is available here: 35http://www.opengl.org/registry/specs/NV/vertex_program4.txt 36''' 37from OpenGL import platform, constant, arrays 38from OpenGL import extensions, wrapper 39import ctypes 40from OpenGL.raw.GL import _types, _glgets 41from OpenGL.raw.GL.NV.vertex_program4 import * 42from OpenGL.raw.GL.NV.vertex_program4 import _EXTENSION_NAME 43 44def glInitVertexProgram4NV(): 45 '''Return boolean indicating whether this extension is available''' 46 from OpenGL import extensions 47 return extensions.hasGLExtension( _EXTENSION_NAME ) 48 49glVertexAttribI1ivEXT=wrapper.wrapper(glVertexAttribI1ivEXT).setInputArraySize( 50 'v', 1 51) 52glVertexAttribI2ivEXT=wrapper.wrapper(glVertexAttribI2ivEXT).setInputArraySize( 53 'v', 2 54) 55glVertexAttribI3ivEXT=wrapper.wrapper(glVertexAttribI3ivEXT).setInputArraySize( 56 'v', 3 57) 58glVertexAttribI4ivEXT=wrapper.wrapper(glVertexAttribI4ivEXT).setInputArraySize( 59 'v', 4 60) 61glVertexAttribI1uivEXT=wrapper.wrapper(glVertexAttribI1uivEXT).setInputArraySize( 62 'v', 1 63) 64glVertexAttribI2uivEXT=wrapper.wrapper(glVertexAttribI2uivEXT).setInputArraySize( 65 'v', 2 66) 67glVertexAttribI3uivEXT=wrapper.wrapper(glVertexAttribI3uivEXT).setInputArraySize( 68 'v', 3 69) 70glVertexAttribI4uivEXT=wrapper.wrapper(glVertexAttribI4uivEXT).setInputArraySize( 71 'v', 4 72) 73glVertexAttribI4bvEXT=wrapper.wrapper(glVertexAttribI4bvEXT).setInputArraySize( 74 'v', 4 75) 76glVertexAttribI4svEXT=wrapper.wrapper(glVertexAttribI4svEXT).setInputArraySize( 77 'v', 4 78) 79glVertexAttribI4ubvEXT=wrapper.wrapper(glVertexAttribI4ubvEXT).setInputArraySize( 80 'v', 4 81) 82glVertexAttribI4usvEXT=wrapper.wrapper(glVertexAttribI4usvEXT).setInputArraySize( 83 'v', 4 84) 85# INPUT glVertexAttribIPointerEXT.pointer size not checked against 'size,type,stride' 86glVertexAttribIPointerEXT=wrapper.wrapper(glVertexAttribIPointerEXT).setInputArraySize( 87 'pointer', None 88) 89glGetVertexAttribIivEXT=wrapper.wrapper(glGetVertexAttribIivEXT).setOutput( 90 'params',size=(1,),orPassIn=True 91) 92glGetVertexAttribIuivEXT=wrapper.wrapper(glGetVertexAttribIuivEXT).setOutput( 93 'params',size=(1,),orPassIn=True 94) 95### END AUTOGENERATED SECTION