mirror of https://github.com/kivy/kivy.git
doc: revisions to graphics/opengl_utils.pyx
This commit is contained in:
parent
0c1c2f4cd1
commit
c175a06273
|
@ -33,7 +33,7 @@ cdef str _platform = str(platform)
|
|||
|
||||
cpdef list gl_get_extensions():
|
||||
'''Return a list of OpenGL extensions available. All the names in the list
|
||||
have the `GL_` stripped at the start if exist, and are in lowercase.
|
||||
have the `GL_` stripped at the start (if it exists) and are in lowercase.
|
||||
|
||||
>>> print(gl_get_extensions())
|
||||
['arb_blend_func_extended', 'arb_color_buffer_float', 'arb_compatibility',
|
||||
|
@ -50,8 +50,8 @@ cpdef list gl_get_extensions():
|
|||
|
||||
|
||||
cpdef int gl_has_extension(name):
|
||||
'''Check if an OpenGL extension is available. If the name start with `GL_`,
|
||||
it will be stripped for the test, and converted to lowercase.
|
||||
'''Check if an OpenGL extension is available. If the name starts with `GL_`,
|
||||
it will be stripped for the test and converted to lowercase.
|
||||
|
||||
>>> gl_has_extension('NV_get_tex_image')
|
||||
False
|
||||
|
@ -66,11 +66,11 @@ cpdef int gl_has_extension(name):
|
|||
|
||||
|
||||
cpdef gl_register_get_size(int constid, int size):
|
||||
'''Register an association between a OpenGL Const used in glGet* to a number
|
||||
'''Register an association between an OpenGL Const used in glGet* to a number
|
||||
of elements.
|
||||
|
||||
By example, the GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX is a special pname that
|
||||
will return 1 integer (nvidia only).
|
||||
will return the integer 1 (nvidia only).
|
||||
|
||||
>>> GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047
|
||||
>>> gl_register_get_size(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, 1)
|
||||
|
@ -82,9 +82,9 @@ cpdef gl_register_get_size(int constid, int size):
|
|||
|
||||
|
||||
cpdef int gl_has_capability(int cap):
|
||||
'''Return the status of a OpenGL Capability. This is a wrapper that auto
|
||||
discover all the capabilities that Kivy might need. The current capabilites
|
||||
test are:
|
||||
'''Return the status of a OpenGL Capability. This is a wrapper that
|
||||
auto-discovers all the capabilities that Kivy might need. The current
|
||||
capabilites tested are:
|
||||
|
||||
- GLCAP_BGRA: Test the support of BGRA texture format
|
||||
- GLCAP_NPOT: Test the support of Non Power of Two texture
|
||||
|
@ -161,10 +161,10 @@ cpdef int gl_has_capability(int cap):
|
|||
|
||||
|
||||
cpdef tuple gl_get_texture_formats():
|
||||
'''Return a list of texture format recognized by kivy.
|
||||
The texture list is informative, but might not been supported by your
|
||||
'''Return a list of texture formats recognized by kivy.
|
||||
The texture list is informative but might not been supported by your
|
||||
hardware. If you want a list of supported textures, you must filter that
|
||||
list like that::
|
||||
list as follows::
|
||||
|
||||
supported_fmts = [gl_has_texture_format(x) for x in gl_get_texture_formats()]
|
||||
|
||||
|
@ -203,15 +203,15 @@ cpdef int gl_has_texture_native_format(fmt):
|
|||
|
||||
|
||||
cpdef int gl_has_texture_conversion(fmt):
|
||||
'''Return 1 if the texture can be converted to a native format
|
||||
'''Return 1 if the texture can be converted to a native format.
|
||||
'''
|
||||
return fmt in ('bgr', 'bgra')
|
||||
|
||||
|
||||
cpdef int gl_has_texture_format(fmt):
|
||||
'''Return if a texture format is supported by your system, natively or by
|
||||
conversion. For example, if your card doesn't support 'bgra', we are able to
|
||||
convert to 'rgba', but in software mode.
|
||||
'''Return whether a texture format is supported by your system, natively or
|
||||
by conversion. For example, if your card doesn't support 'bgra', we are able
|
||||
to convert to 'rgba' but only in software mode.
|
||||
'''
|
||||
# check if the support of a format can be done natively
|
||||
if gl_has_texture_native_format(fmt):
|
||||
|
|
Loading…
Reference in New Issue