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
|
'''OpenGL extension EXT.buffer_storage
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.buffer_storage to provide a more
Python-friendly API
Overview (from the spec)
OpenGL ES has long supported buffer objects as a means of storing data
that may be used to source vertex attributes, pixel data for textures,
uniforms and other elements. In un-extended ES, buffer data stores
are mutable - that is, they may be de-allocated or resized while they
are in use. The GL_EXT_texture_storage extension added immutable storage
for texture objects (and was subsequently incorporated into OpenGL ES 3.0).
This extension further applies the concept of immutable storage to
buffer objects. If an implementation is aware of a buffer's immutability,
it may be able to make certain assumptions or apply particular
optimizations in order to increase performance or reliability.
Furthermore, this extension allows applications to pass additional
information about a requested allocation to the implementation which it
may use to select memory heaps, caching behavior or allocation strategies.
Finally, this extension introduces the concept of persistent client
mappings of buffer objects, which allow clients to retain pointers to a
buffer's data store returned as the result of a mapping, and to issue
drawing commands while those mappings are in place.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/buffer_storage.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.EXT.buffer_storage import *
from OpenGL.raw.GLES2.EXT.buffer_storage import _EXTENSION_NAME
def glInitBufferStorageEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
# INPUT glBufferStorageEXT.data size not checked against size
glBufferStorageEXT=wrapper.wrapper(glBufferStorageEXT).setInputArraySize(
'data', None
)
### END AUTOGENERATED SECTION
|