1 ##########################################################################
3 # Copyright 2011 LunarG, Inc.
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 ##########################################################################/
27 """GLES API description.
34 GLfixed = Alias("GLfixed", Int32)
35 GLclampx = Alias("GLclampx", Int32)
38 def GlFunction(*args, **kwargs):
39 kwargs.setdefault('call', 'GL_APIENTRY')
40 return Function(*args, **kwargs)
46 # OpenGL ES specific functions
47 glesapi.add_functions([
48 # GL_VERSION_ES_CM_1_1: GL_OES_single_precision
49 GlFunction(Void, "glFrustumf", [(GLfloat, "left"), (GLfloat, "right"), (GLfloat, "bottom"), (GLfloat, "top"), (GLfloat, "zNear"), (GLfloat, "zFar")]),
50 GlFunction(Void, "glOrthof", [(GLfloat, "left"), (GLfloat, "right"), (GLfloat, "bottom"), (GLfloat, "top"), (GLfloat, "zNear"), (GLfloat, "zFar")]),
52 GlFunction(Void, "glClipPlanef", [(GLenum, "plane"), (Array(Const(GLfloat), 4), "equation")]),
53 GlFunction(Void, "glGetClipPlanef", [(GLenum, "plane"), Out(Array(GLfloat, 4), "equation")], sideeffects=False),
55 # GL_VERSION_ES_CM_1_1: GL_OES_fixed_point
56 GlFunction(Void, "glAlphaFuncx", [(GLenum, "func"), (GLclampx, "ref")]),
57 GlFunction(Void, "glClearColorx", [(GLclampx, "red"), (GLclampx, "green"), (GLclampx, "blue"), (GLclampx, "alpha")]),
58 GlFunction(Void, "glClearDepthx", [(GLclampx, "depth")]),
59 GlFunction(Void, "glColor4x", [(GLfixed, "red"), (GLfixed, "green"), (GLfixed, "blue"), (GLfixed, "alpha")]),
60 GlFunction(Void, "glDepthRangex", [(GLclampx, "zNear"), (GLclampx, "zFar")]),
61 GlFunction(Void, "glFogx", [(GLenum, "pname"), (GLfixed, "param")]),
62 GlFunction(Void, "glFogxv", [(GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
63 GlFunction(Void, "glFrustumx", [(GLfixed, "left"), (GLfixed, "right"), (GLfixed, "bottom"), (GLfixed, "top"), (GLfixed, "zNear"), (GLfixed, "zFar")]),
64 GlFunction(Void, "glLightModelx", [(GLenum, "pname"), (GLfixed, "param")]),
65 GlFunction(Void, "glLightModelxv", [(GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
66 GlFunction(Void, "glLightx", [(GLenum, "light"), (GLenum, "pname"), (GLfixed, "param")]),
67 GlFunction(Void, "glLightxv", [(GLenum, "light"), (GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
68 GlFunction(Void, "glLineWidthx", [(GLfixed, "width")]),
69 GlFunction(Void, "glLoadMatrixx", [(Array(Const(GLfixed), 16), "m")]),
70 GlFunction(Void, "glMaterialx", [(GLenum, "face"), (GLenum, "pname"), (GLfixed, "param")]),
71 GlFunction(Void, "glMaterialxv", [(GLenum, "face"), (GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
72 GlFunction(Void, "glMultMatrixx", [(Array(Const(GLfixed), 16), "m")]),
73 GlFunction(Void, "glMultiTexCoord4x", [(GLenum, "target"), (GLfixed, "s"), (GLfixed, "t"), (GLfixed, "r"), (GLfixed, "q")]),
74 GlFunction(Void, "glNormal3x", [(GLfixed, "nx"), (GLfixed, "ny"), (GLfixed, "nz")]),
75 GlFunction(Void, "glOrthox", [(GLfixed, "left"), (GLfixed, "right"), (GLfixed, "bottom"), (GLfixed, "top"), (GLfixed, "zNear"), (GLfixed, "zFar")]),
76 GlFunction(Void, "glPointSizex", [(GLfixed, "size")]),
77 GlFunction(Void, "glPolygonOffsetx", [(GLfixed, "factor"), (GLfixed, "units")]),
78 GlFunction(Void, "glRotatex", [(GLfixed, "angle"), (GLfixed, "x"), (GLfixed, "y"), (GLfixed, "z")]),
79 GlFunction(Void, "glSampleCoveragex", [(GLclampx, "value"), (GLboolean, "invert")]),
80 GlFunction(Void, "glScalex", [(GLfixed, "x"), (GLfixed, "y"), (GLfixed, "z")]),
81 GlFunction(Void, "glTexEnvx", [(GLenum, "target"), (GLenum, "pname"), (GLfixed, "param")]),
82 GlFunction(Void, "glTexEnvxv", [(GLenum, "target"), (GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
83 GlFunction(Void, "glTexParameterx", [(GLenum, "target"), (GLenum, "pname"), (GLfixed, "param")]),
84 GlFunction(Void, "glTranslatex", [(GLfixed, "x"), (GLfixed, "y"), (GLfixed, "z")]),
86 GlFunction(Void, "glClipPlanex", [(GLenum, "plane"), (Array(Const(GLfixed), 4), "equation")]),
87 GlFunction(Void, "glGetClipPlanex", [(GLenum, "plane"), Out(Array(GLfixed, 4), "equation")], sideeffects=False),
88 GlFunction(Void, "glGetFixedv", [(GLenum, "pname"), Out(Array(GLfixed, "__gl_param_size(pname)"), "params")], sideeffects=False),
89 GlFunction(Void, "glGetLightxv", [(GLenum, "light"), (GLenum, "pname"), Out(Array(GLfixed, "__gl_param_size(pname)"), "params")], sideeffects=False),
90 GlFunction(Void, "glGetMaterialxv", [(GLenum, "face"), (GLenum, "pname"), Out(Array(GLfixed, "__gl_param_size(pname)"), "params")], sideeffects=False),
91 GlFunction(Void, "glGetTexEnvxv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfixed, "__gl_param_size(pname)"), "params")], sideeffects=False),
92 GlFunction(Void, "glGetTexParameterxv", [(GLenum, "target"), (GLenum, "pname"), Out(Array(GLfixed, "__gl_param_size(pname)"), "params")], sideeffects=False),
93 GlFunction(Void, "glPointParameterx", [(GLenum, "pname"), (GLfixed, "param")]),
94 GlFunction(Void, "glPointParameterxv", [(GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
95 GlFunction(Void, "glTexParameterxv", [(GLenum, "target"), (GLenum, "pname"), (Array(Const(GLfixed), "__gl_param_size(pname)"), "params")]),
99 # all functions are already defined in OpenGL thanks to
100 # GL_ARB_ES2_compatibility