firestryker's picture
download
raw
2.07 kB
'''OpenGL extension EXT.provoking_vertex
This module customises the behaviour of the
OpenGL.raw.GL.EXT.provoking_vertex to provide a more
Python-friendly API
Overview (from the spec)
This extension provides an alternative provoking vertex convention
for rendering lines, triangles, and (optionally depending on the
implementation) quads.
The provoking vertex of a primitive is the vertex that determines the
constant primary and secondary colors when flat shading is enabled.
In OpenGL, the provoking vertex for triangle, quad, line, and
(trivially) point primitives is the last vertex used to assemble
the primitive. The polygon primitive is an exception in OpenGL where
the first vertex of a polygon primitive determines the color of the
polygon, even if actually broken into triangles and/or quads.
See section 2.14.7 (Flatshading) of the OpenGL 2.1 specification,
particularly Table 2.12 for more details.
Alternatively the provoking vertex could be the first vertex of
the primitive. Other APIs with flat-shading functionality such
as Reality Lab and Direct3D have adopted the "first vertex of the
primitive" convention to determine the provoking vertex. However,
these APIs lack quads so do not have a defined provoking vertex
convention for quads.
The motivation for this extension is to allow applications developed
for APIs with a "first vertex of the primitive" provoking vertex to
be easily converted to OpenGL.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/provoking_vertex.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.EXT.provoking_vertex import *
from OpenGL.raw.GL.EXT.provoking_vertex import _EXTENSION_NAME
def glInitProvokingVertexEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION

Xet Storage Details

Size:
2.07 kB
·
Xet hash:
908ad471d5926f854e5e8d319123965daf190d81f5a78d8f667d6f54d882c619

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.