File: shading_language_include.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,184 kB
  • ctags: 21,473
  • sloc: python: 80,468; makefile: 4
file content (66 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download | duplicates (12)
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 ARB.shading_language_include

This module customises the behaviour of the 
OpenGL.raw.GL.ARB.shading_language_include to provide a more 
Python-friendly API

Overview (from the spec)
	
	This extension introduces a #include GLSL directive to allow reusing
	the same shader text in multiple shaders and defines the semantics
	and syntax of the names allowed in #include directives. It also
	defines API mechanisms to define the named string backing a
	#include.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/shading_language_include.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.ARB.shading_language_include import *
from OpenGL.raw.GL.ARB.shading_language_include import _EXTENSION_NAME

def glInitShadingLanguageIncludeARB():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )

# INPUT glNamedStringARB.name size not checked against namelen
# INPUT glNamedStringARB.string size not checked against stringlen
glNamedStringARB=wrapper.wrapper(glNamedStringARB).setInputArraySize(
    'name', None
).setInputArraySize(
    'string', None
)
# INPUT glDeleteNamedStringARB.name size not checked against namelen
glDeleteNamedStringARB=wrapper.wrapper(glDeleteNamedStringARB).setInputArraySize(
    'name', None
)
# INPUT glCompileShaderIncludeARB.path size not checked against count
# INPUT glCompileShaderIncludeARB.length size not checked against count
glCompileShaderIncludeARB=wrapper.wrapper(glCompileShaderIncludeARB).setInputArraySize(
    'path', None
).setInputArraySize(
    'length', None
)
# INPUT glIsNamedStringARB.name size not checked against namelen
glIsNamedStringARB=wrapper.wrapper(glIsNamedStringARB).setInputArraySize(
    'name', None
)
# INPUT glGetNamedStringARB.name size not checked against namelen
glGetNamedStringARB=wrapper.wrapper(glGetNamedStringARB).setOutput(
    'stringlen',size=(1,),orPassIn=True
).setOutput(
    'string',size=lambda x:(x,),pnameArg='bufSize',orPassIn=True
).setInputArraySize(
    'name', None
)
# INPUT glGetNamedStringivARB.name size not checked against namelen
glGetNamedStringivARB=wrapper.wrapper(glGetNamedStringivARB).setOutput(
    'params',size=_glgets._glget_size_mapping,pnameArg='pname',orPassIn=True
).setInputArraySize(
    'name', None
)
### END AUTOGENERATED SECTION