1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
'''OpenGL extension NV.viewport_array
This module customises the behaviour of the
OpenGL.raw.GLES2.NV.viewport_array to provide a more
Python-friendly API
Overview (from the spec)
OpenGL ES is modeled on a pipeline of operations. The final stage in this
pipeline before rasterization is the viewport transformation. This stage
transforms vertices from view space into window coordinates and allows the
application to specify a rectangular region of screen space into which
OpenGL should draw primitives. Unextended OpenGL implementations provide a
single viewport per context. In order to draw primitives into multiple
viewports, the OpenGL viewport may be changed between several draw calls.
With the advent of Geometry Shaders, it has become possible for an
application to amplify geometry and produce multiple output primitives for
each primitive input to the Geometry Shader. It is possible to direct these
primitives to render into a selected render target. However, all render
targets share the same, global OpenGL viewport.
This extension enhances OpenGL by providing a mechanism to expose multiple
viewports. Each viewport is specified as a rectangle. The destination
viewport may be selected per-primitive by the geometry shader. This allows
the Geometry Shader to produce different versions of primitives destined
for separate viewport rectangles on the same surface. Additionally, when
combined with multiple framebuffer attachments, it allows a different
viewport rectangle to be selected for each. This extension also exposes a
separate scissor rectangle for each viewport. Finally, the viewport bounds
are now floating point quantities allowing fractional pixel offsets to be
applied during the viewport transform.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/viewport_array.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLES2 import _types, _glgets
from OpenGL.raw.GLES2.NV.viewport_array import *
from OpenGL.raw.GLES2.NV.viewport_array import _EXTENSION_NAME
def glInitViewportArrayNV():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
# INPUT glViewportArrayvNV.v size not checked against 'count'
glViewportArrayvNV=wrapper.wrapper(glViewportArrayvNV).setInputArraySize(
'v', None
)
glViewportIndexedfvNV=wrapper.wrapper(glViewportIndexedfvNV).setInputArraySize(
'v', 4
)
# INPUT glScissorArrayvNV.v size not checked against 'count'
glScissorArrayvNV=wrapper.wrapper(glScissorArrayvNV).setInputArraySize(
'v', None
)
glScissorIndexedvNV=wrapper.wrapper(glScissorIndexedvNV).setInputArraySize(
'v', 4
)
# INPUT glGetFloati_vNV.data size not checked against 'target'
glGetFloati_vNV=wrapper.wrapper(glGetFloati_vNV).setInputArraySize(
'data', None
)
### END AUTOGENERATED SECTION
|