| 1 |
'''OpenGL extension AMD.vertex_shader_viewport_index |
| 2 |
|
| 3 |
This module customises the behaviour of the |
| 4 |
OpenGL.raw.GL.AMD.vertex_shader_viewport_index to provide a more |
| 5 |
Python-friendly API |
| 6 |
|
| 7 |
Overview (from the spec) |
| 8 |
|
| 9 |
The gl_ViewportIndex built-in variable was introduced by the |
| 10 |
ARB_viewport_array extension and OpenGL 4.1. This variable is available |
| 11 |
in un-extended OpenGL only to the geometry shader. When written in the |
| 12 |
geometry shader, it causes geometry to be directed to one of an array |
| 13 |
of several independent viewport rectangles. |
| 14 |
|
| 15 |
In order to use any viewport other than zero, a geometry shader must be |
| 16 |
present. Geometry shaders introduce processing overhead and potential |
| 17 |
performance issues. This extension exposes the gl_ViewportIndex built-in |
| 18 |
variable to the vertex shader, allowing the functionality introduced by |
| 19 |
ARB_viewport_array to be accessed without requiring a geometry shader to |
| 20 |
be present. |
| 21 |
|
| 22 |
The official definition of this extension is available here: |
| 23 |
http://www.opengl.org/registry/specs/AMD/vertex_shader_viewport_index.txt |
| 24 |
''' |
| 25 |
from OpenGL import platform, constant, arrays |
| 26 |
from OpenGL import extensions, wrapper |
| 27 |
import ctypes |
| 28 |
from OpenGL.raw.GL import _types, _glgets |
| 29 |
from OpenGL.raw.GL.AMD.vertex_shader_viewport_index import * |
| 30 |
from OpenGL.raw.GL.AMD.vertex_shader_viewport_index import _EXTENSION_NAME |
| 31 |
|
| 32 |
def glInitVertexShaderViewportIndexAMD(): |
| 33 |
'''Return boolean indicating whether this extension is available''' |
| 34 |
from OpenGL import extensions |
| 35 |
return extensions.hasGLExtension( _EXTENSION_NAME ) |
| 36 |
|
| 37 |
|
| 38 |
|