1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
9 // OpenGL ES interface.
10 #ifndef PPAPI_C_PPB_OPENGLES2_H_
11 #define PPAPI_C_PPB_OPENGLES2_H_
13 #include "ppapi/c/pp_resource.h"
18 typedef unsigned short GLushort
;
19 typedef short GLshort
;
20 typedef unsigned char GLubyte
;
21 typedef unsigned int GLenum
;
23 typedef unsigned char GLboolean
;
24 typedef unsigned int GLbitfield
;
25 typedef float GLfloat
;
26 typedef float GLclampf
;
27 typedef signed char GLbyte
;
28 typedef unsigned int GLuint
;
32 typedef long long int GLintptr
;
33 typedef long long int GLsizeiptr
;
35 typedef long int GLintptr
;
36 typedef long int GLsizeiptr
;
40 #define PPB_OPENGLES2_INTERFACE_1_0 "PPB_OpenGLES2;1.0"
41 #define PPB_OPENGLES2_INTERFACE PPB_OPENGLES2_INTERFACE_1_0
43 struct PPB_OpenGLES2
{
44 void (*ActiveTexture
)(PP_Resource context
, GLenum texture
);
45 void (*AttachShader
)(PP_Resource context
, GLuint program
, GLuint shader
);
46 void (*BindAttribLocation
)(
47 PP_Resource context
, GLuint program
, GLuint index
, const char* name
);
48 void (*BindBuffer
)(PP_Resource context
, GLenum target
, GLuint buffer
);
49 void (*BindFramebuffer
)(
50 PP_Resource context
, GLenum target
, GLuint framebuffer
);
51 void (*BindRenderbuffer
)(
52 PP_Resource context
, GLenum target
, GLuint renderbuffer
);
53 void (*BindTexture
)(PP_Resource context
, GLenum target
, GLuint texture
);
55 PP_Resource context
, GLclampf red
, GLclampf green
, GLclampf blue
,
57 void (*BlendEquation
)(PP_Resource context
, GLenum mode
);
58 void (*BlendEquationSeparate
)(
59 PP_Resource context
, GLenum modeRGB
, GLenum modeAlpha
);
60 void (*BlendFunc
)(PP_Resource context
, GLenum sfactor
, GLenum dfactor
);
61 void (*BlendFuncSeparate
)(
62 PP_Resource context
, GLenum srcRGB
, GLenum dstRGB
, GLenum srcAlpha
,
65 PP_Resource context
, GLenum target
, GLsizeiptr size
, const void* data
,
67 void (*BufferSubData
)(
68 PP_Resource context
, GLenum target
, GLintptr offset
, GLsizeiptr size
,
70 GLenum (*CheckFramebufferStatus
)(PP_Resource context
, GLenum target
);
71 void (*Clear
)(PP_Resource context
, GLbitfield mask
);
73 PP_Resource context
, GLclampf red
, GLclampf green
, GLclampf blue
,
75 void (*ClearDepthf
)(PP_Resource context
, GLclampf depth
);
76 void (*ClearStencil
)(PP_Resource context
, GLint s
);
78 PP_Resource context
, GLboolean red
, GLboolean green
, GLboolean blue
,
80 void (*CompileShader
)(PP_Resource context
, GLuint shader
);
81 void (*CompressedTexImage2D
)(
82 PP_Resource context
, GLenum target
, GLint level
, GLenum internalformat
,
83 GLsizei width
, GLsizei height
, GLint border
, GLsizei imageSize
,
85 void (*CompressedTexSubImage2D
)(
86 PP_Resource context
, GLenum target
, GLint level
, GLint xoffset
,
87 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
,
88 GLsizei imageSize
, const void* data
);
89 void (*CopyTexImage2D
)(
90 PP_Resource context
, GLenum target
, GLint level
, GLenum internalformat
,
91 GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLint border
);
92 void (*CopyTexSubImage2D
)(
93 PP_Resource context
, GLenum target
, GLint level
, GLint xoffset
,
94 GLint yoffset
, GLint x
, GLint y
, GLsizei width
, GLsizei height
);
95 GLuint (*CreateProgram
)(PP_Resource context
);
96 GLuint (*CreateShader
)(PP_Resource context
, GLenum type
);
97 void (*CullFace
)(PP_Resource context
, GLenum mode
);
98 void (*DeleteBuffers
)(PP_Resource context
, GLsizei n
, const GLuint
* buffers
);
99 void (*DeleteFramebuffers
)(
100 PP_Resource context
, GLsizei n
, const GLuint
* framebuffers
);
101 void (*DeleteProgram
)(PP_Resource context
, GLuint program
);
102 void (*DeleteRenderbuffers
)(
103 PP_Resource context
, GLsizei n
, const GLuint
* renderbuffers
);
104 void (*DeleteShader
)(PP_Resource context
, GLuint shader
);
105 void (*DeleteTextures
)(
106 PP_Resource context
, GLsizei n
, const GLuint
* textures
);
107 void (*DepthFunc
)(PP_Resource context
, GLenum func
);
108 void (*DepthMask
)(PP_Resource context
, GLboolean flag
);
109 void (*DepthRangef
)(PP_Resource context
, GLclampf zNear
, GLclampf zFar
);
110 void (*DetachShader
)(PP_Resource context
, GLuint program
, GLuint shader
);
111 void (*Disable
)(PP_Resource context
, GLenum cap
);
112 void (*DisableVertexAttribArray
)(PP_Resource context
, GLuint index
);
114 PP_Resource context
, GLenum mode
, GLint first
, GLsizei count
);
115 void (*DrawElements
)(
116 PP_Resource context
, GLenum mode
, GLsizei count
, GLenum type
,
117 const void* indices
);
118 void (*Enable
)(PP_Resource context
, GLenum cap
);
119 void (*EnableVertexAttribArray
)(PP_Resource context
, GLuint index
);
120 void (*Finish
)(PP_Resource context
);
121 void (*Flush
)(PP_Resource context
);
122 void (*FramebufferRenderbuffer
)(
123 PP_Resource context
, GLenum target
, GLenum attachment
,
124 GLenum renderbuffertarget
, GLuint renderbuffer
);
125 void (*FramebufferTexture2D
)(
126 PP_Resource context
, GLenum target
, GLenum attachment
, GLenum textarget
,
127 GLuint texture
, GLint level
);
128 void (*FrontFace
)(PP_Resource context
, GLenum mode
);
129 void (*GenBuffers
)(PP_Resource context
, GLsizei n
, GLuint
* buffers
);
130 void (*GenerateMipmap
)(PP_Resource context
, GLenum target
);
131 void (*GenFramebuffers
)(
132 PP_Resource context
, GLsizei n
, GLuint
* framebuffers
);
133 void (*GenRenderbuffers
)(
134 PP_Resource context
, GLsizei n
, GLuint
* renderbuffers
);
135 void (*GenTextures
)(PP_Resource context
, GLsizei n
, GLuint
* textures
);
136 void (*GetActiveAttrib
)(
137 PP_Resource context
, GLuint program
, GLuint index
, GLsizei bufsize
,
138 GLsizei
* length
, GLint
* size
, GLenum
* type
, char* name
);
139 void (*GetActiveUniform
)(
140 PP_Resource context
, GLuint program
, GLuint index
, GLsizei bufsize
,
141 GLsizei
* length
, GLint
* size
, GLenum
* type
, char* name
);
142 void (*GetAttachedShaders
)(
143 PP_Resource context
, GLuint program
, GLsizei maxcount
, GLsizei
* count
,
145 GLint (*GetAttribLocation
)(
146 PP_Resource context
, GLuint program
, const char* name
);
147 void (*GetBooleanv
)(PP_Resource context
, GLenum pname
, GLboolean
* params
);
148 void (*GetBufferParameteriv
)(
149 PP_Resource context
, GLenum target
, GLenum pname
, GLint
* params
);
150 GLenum (*GetError
)(PP_Resource context
);
151 void (*GetFloatv
)(PP_Resource context
, GLenum pname
, GLfloat
* params
);
152 void (*GetFramebufferAttachmentParameteriv
)(
153 PP_Resource context
, GLenum target
, GLenum attachment
, GLenum pname
,
155 void (*GetIntegerv
)(PP_Resource context
, GLenum pname
, GLint
* params
);
156 void (*GetProgramiv
)(
157 PP_Resource context
, GLuint program
, GLenum pname
, GLint
* params
);
158 void (*GetProgramInfoLog
)(
159 PP_Resource context
, GLuint program
, GLsizei bufsize
, GLsizei
* length
,
161 void (*GetRenderbufferParameteriv
)(
162 PP_Resource context
, GLenum target
, GLenum pname
, GLint
* params
);
164 PP_Resource context
, GLuint shader
, GLenum pname
, GLint
* params
);
165 void (*GetShaderInfoLog
)(
166 PP_Resource context
, GLuint shader
, GLsizei bufsize
, GLsizei
* length
,
168 void (*GetShaderPrecisionFormat
)(
169 PP_Resource context
, GLenum shadertype
, GLenum precisiontype
,
170 GLint
* range
, GLint
* precision
);
171 void (*GetShaderSource
)(
172 PP_Resource context
, GLuint shader
, GLsizei bufsize
, GLsizei
* length
,
174 const GLubyte
* (*GetString
)(PP_Resource context
, GLenum name
);
175 void (*GetTexParameterfv
)(
176 PP_Resource context
, GLenum target
, GLenum pname
, GLfloat
* params
);
177 void (*GetTexParameteriv
)(
178 PP_Resource context
, GLenum target
, GLenum pname
, GLint
* params
);
179 void (*GetUniformfv
)(
180 PP_Resource context
, GLuint program
, GLint location
, GLfloat
* params
);
181 void (*GetUniformiv
)(
182 PP_Resource context
, GLuint program
, GLint location
, GLint
* params
);
183 GLint (*GetUniformLocation
)(
184 PP_Resource context
, GLuint program
, const char* name
);
185 void (*GetVertexAttribfv
)(
186 PP_Resource context
, GLuint index
, GLenum pname
, GLfloat
* params
);
187 void (*GetVertexAttribiv
)(
188 PP_Resource context
, GLuint index
, GLenum pname
, GLint
* params
);
189 void (*GetVertexAttribPointerv
)(
190 PP_Resource context
, GLuint index
, GLenum pname
, void** pointer
);
191 void (*Hint
)(PP_Resource context
, GLenum target
, GLenum mode
);
192 GLboolean (*IsBuffer
)(PP_Resource context
, GLuint buffer
);
193 GLboolean (*IsEnabled
)(PP_Resource context
, GLenum cap
);
194 GLboolean (*IsFramebuffer
)(PP_Resource context
, GLuint framebuffer
);
195 GLboolean (*IsProgram
)(PP_Resource context
, GLuint program
);
196 GLboolean (*IsRenderbuffer
)(PP_Resource context
, GLuint renderbuffer
);
197 GLboolean (*IsShader
)(PP_Resource context
, GLuint shader
);
198 GLboolean (*IsTexture
)(PP_Resource context
, GLuint texture
);
199 void (*LineWidth
)(PP_Resource context
, GLfloat width
);
200 void (*LinkProgram
)(PP_Resource context
, GLuint program
);
201 void (*PixelStorei
)(PP_Resource context
, GLenum pname
, GLint param
);
202 void (*PolygonOffset
)(PP_Resource context
, GLfloat factor
, GLfloat units
);
204 PP_Resource context
, GLint x
, GLint y
, GLsizei width
, GLsizei height
,
205 GLenum format
, GLenum type
, void* pixels
);
206 void (*ReleaseShaderCompiler
)(PP_Resource context
);
207 void (*RenderbufferStorage
)(
208 PP_Resource context
, GLenum target
, GLenum internalformat
, GLsizei width
,
210 void (*SampleCoverage
)(
211 PP_Resource context
, GLclampf value
, GLboolean invert
);
213 PP_Resource context
, GLint x
, GLint y
, GLsizei width
, GLsizei height
);
214 void (*ShaderBinary
)(
215 PP_Resource context
, GLsizei n
, const GLuint
* shaders
,
216 GLenum binaryformat
, const void* binary
, GLsizei length
);
217 void (*ShaderSource
)(
218 PP_Resource context
, GLuint shader
, GLsizei count
, const char** str
,
219 const GLint
* length
);
221 PP_Resource context
, GLenum func
, GLint ref
, GLuint mask
);
222 void (*StencilFuncSeparate
)(
223 PP_Resource context
, GLenum face
, GLenum func
, GLint ref
, GLuint mask
);
224 void (*StencilMask
)(PP_Resource context
, GLuint mask
);
225 void (*StencilMaskSeparate
)(PP_Resource context
, GLenum face
, GLuint mask
);
227 PP_Resource context
, GLenum fail
, GLenum zfail
, GLenum zpass
);
228 void (*StencilOpSeparate
)(
229 PP_Resource context
, GLenum face
, GLenum fail
, GLenum zfail
,
232 PP_Resource context
, GLenum target
, GLint level
, GLint internalformat
,
233 GLsizei width
, GLsizei height
, GLint border
, GLenum format
, GLenum type
,
235 void (*TexParameterf
)(
236 PP_Resource context
, GLenum target
, GLenum pname
, GLfloat param
);
237 void (*TexParameterfv
)(
238 PP_Resource context
, GLenum target
, GLenum pname
, const GLfloat
* params
);
239 void (*TexParameteri
)(
240 PP_Resource context
, GLenum target
, GLenum pname
, GLint param
);
241 void (*TexParameteriv
)(
242 PP_Resource context
, GLenum target
, GLenum pname
, const GLint
* params
);
243 void (*TexSubImage2D
)(
244 PP_Resource context
, GLenum target
, GLint level
, GLint xoffset
,
245 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
,
247 void (*Uniform1f
)(PP_Resource context
, GLint location
, GLfloat x
);
249 PP_Resource context
, GLint location
, GLsizei count
, const GLfloat
* v
);
250 void (*Uniform1i
)(PP_Resource context
, GLint location
, GLint x
);
252 PP_Resource context
, GLint location
, GLsizei count
, const GLint
* v
);
253 void (*Uniform2f
)(PP_Resource context
, GLint location
, GLfloat x
, GLfloat y
);
255 PP_Resource context
, GLint location
, GLsizei count
, const GLfloat
* v
);
256 void (*Uniform2i
)(PP_Resource context
, GLint location
, GLint x
, GLint y
);
258 PP_Resource context
, GLint location
, GLsizei count
, const GLint
* v
);
260 PP_Resource context
, GLint location
, GLfloat x
, GLfloat y
, GLfloat z
);
262 PP_Resource context
, GLint location
, GLsizei count
, const GLfloat
* v
);
264 PP_Resource context
, GLint location
, GLint x
, GLint y
, GLint z
);
266 PP_Resource context
, GLint location
, GLsizei count
, const GLint
* v
);
268 PP_Resource context
, GLint location
, GLfloat x
, GLfloat y
, GLfloat z
,
271 PP_Resource context
, GLint location
, GLsizei count
, const GLfloat
* v
);
273 PP_Resource context
, GLint location
, GLint x
, GLint y
, GLint z
, GLint w
);
275 PP_Resource context
, GLint location
, GLsizei count
, const GLint
* v
);
276 void (*UniformMatrix2fv
)(
277 PP_Resource context
, GLint location
, GLsizei count
, GLboolean transpose
,
278 const GLfloat
* value
);
279 void (*UniformMatrix3fv
)(
280 PP_Resource context
, GLint location
, GLsizei count
, GLboolean transpose
,
281 const GLfloat
* value
);
282 void (*UniformMatrix4fv
)(
283 PP_Resource context
, GLint location
, GLsizei count
, GLboolean transpose
,
284 const GLfloat
* value
);
285 void (*UseProgram
)(PP_Resource context
, GLuint program
);
286 void (*ValidateProgram
)(PP_Resource context
, GLuint program
);
287 void (*VertexAttrib1f
)(PP_Resource context
, GLuint indx
, GLfloat x
);
288 void (*VertexAttrib1fv
)(
289 PP_Resource context
, GLuint indx
, const GLfloat
* values
);
290 void (*VertexAttrib2f
)(
291 PP_Resource context
, GLuint indx
, GLfloat x
, GLfloat y
);
292 void (*VertexAttrib2fv
)(
293 PP_Resource context
, GLuint indx
, const GLfloat
* values
);
294 void (*VertexAttrib3f
)(
295 PP_Resource context
, GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
);
296 void (*VertexAttrib3fv
)(
297 PP_Resource context
, GLuint indx
, const GLfloat
* values
);
298 void (*VertexAttrib4f
)(
299 PP_Resource context
, GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
,
301 void (*VertexAttrib4fv
)(
302 PP_Resource context
, GLuint indx
, const GLfloat
* values
);
303 void (*VertexAttribPointer
)(
304 PP_Resource context
, GLuint indx
, GLint size
, GLenum type
,
305 GLboolean normalized
, GLsizei stride
, const void* ptr
);
307 PP_Resource context
, GLint x
, GLint y
, GLsizei width
, GLsizei height
);
310 #define PPB_OPENGLES2_INSTANCEDARRAYS_INTERFACE_1_0 "PPB_OpenGLES2InstancedArrays;1.0" // NOLINT
311 #define PPB_OPENGLES2_INSTANCEDARRAYS_INTERFACE PPB_OPENGLES2_INSTANCEDARRAYS_INTERFACE_1_0 // NOLINT
313 struct PPB_OpenGLES2InstancedArrays
{
314 void (*DrawArraysInstancedANGLE
)(
315 PP_Resource context
, GLenum mode
, GLint first
, GLsizei count
,
317 void (*DrawElementsInstancedANGLE
)(
318 PP_Resource context
, GLenum mode
, GLsizei count
, GLenum type
,
319 const void* indices
, GLsizei primcount
);
320 void (*VertexAttribDivisorANGLE
)(
321 PP_Resource context
, GLuint index
, GLuint divisor
);
324 #define PPB_OPENGLES2_FRAMEBUFFERBLIT_INTERFACE_1_0 "PPB_OpenGLES2FramebufferBlit;1.0" // NOLINT
325 #define PPB_OPENGLES2_FRAMEBUFFERBLIT_INTERFACE PPB_OPENGLES2_FRAMEBUFFERBLIT_INTERFACE_1_0 // NOLINT
327 struct PPB_OpenGLES2FramebufferBlit
{
328 void (*BlitFramebufferEXT
)(
329 PP_Resource context
, GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
330 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
, GLbitfield mask
,
334 #define PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_INTERFACE_1_0 "PPB_OpenGLES2FramebufferMultisample;1.0" // NOLINT
335 #define PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_INTERFACE PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_INTERFACE_1_0 // NOLINT
337 struct PPB_OpenGLES2FramebufferMultisample
{
338 void (*RenderbufferStorageMultisampleEXT
)(
339 PP_Resource context
, GLenum target
, GLsizei samples
,
340 GLenum internalformat
, GLsizei width
, GLsizei height
);
343 #define PPB_OPENGLES2_CHROMIUMENABLEFEATURE_INTERFACE_1_0 "PPB_OpenGLES2ChromiumEnableFeature;1.0" // NOLINT
344 #define PPB_OPENGLES2_CHROMIUMENABLEFEATURE_INTERFACE PPB_OPENGLES2_CHROMIUMENABLEFEATURE_INTERFACE_1_0 // NOLINT
346 struct PPB_OpenGLES2ChromiumEnableFeature
{
347 GLboolean (*EnableFeatureCHROMIUM
)(PP_Resource context
, const char* feature
);
350 #define PPB_OPENGLES2_CHROMIUMMAPSUB_INTERFACE_1_0 "PPB_OpenGLES2ChromiumMapSub;1.0" // NOLINT
351 #define PPB_OPENGLES2_CHROMIUMMAPSUB_INTERFACE PPB_OPENGLES2_CHROMIUMMAPSUB_INTERFACE_1_0 // NOLINT
353 struct PPB_OpenGLES2ChromiumMapSub
{
354 void* (*MapBufferSubDataCHROMIUM
)(
355 PP_Resource context
, GLuint target
, GLintptr offset
, GLsizeiptr size
,
357 void (*UnmapBufferSubDataCHROMIUM
)(PP_Resource context
, const void* mem
);
358 void* (*MapTexSubImage2DCHROMIUM
)(
359 PP_Resource context
, GLenum target
, GLint level
, GLint xoffset
,
360 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
,
362 void (*UnmapTexSubImage2DCHROMIUM
)(PP_Resource context
, const void* mem
);
365 #define PPB_OPENGLES2_QUERY_INTERFACE_1_0 "PPB_OpenGLES2Query;1.0"
366 #define PPB_OPENGLES2_QUERY_INTERFACE PPB_OPENGLES2_QUERY_INTERFACE_1_0
368 struct PPB_OpenGLES2Query
{
369 void (*GenQueriesEXT
)(PP_Resource context
, GLsizei n
, GLuint
* queries
);
370 void (*DeleteQueriesEXT
)(
371 PP_Resource context
, GLsizei n
, const GLuint
* queries
);
372 GLboolean (*IsQueryEXT
)(PP_Resource context
, GLuint id
);
373 void (*BeginQueryEXT
)(PP_Resource context
, GLenum target
, GLuint id
);
374 void (*EndQueryEXT
)(PP_Resource context
, GLenum target
);
375 void (*GetQueryivEXT
)(
376 PP_Resource context
, GLenum target
, GLenum pname
, GLint
* params
);
377 void (*GetQueryObjectuivEXT
)(
378 PP_Resource context
, GLuint id
, GLenum pname
, GLuint
* params
);
381 #endif // PPAPI_C_PPB_OPENGLES2_H_