CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrGL2Extensions.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// GLES2 extensions
24
25#ifndef ODTRGL2EXTENSIONS
26#define ODTRGL2EXTENSIONS
27
29
30// BGR/BGRA textures (kExtensionBGR/kExtensionBGRA)
31#ifndef GL_BGR_EXT
32#define GL_BGR_EXT 0x80E0
33#endif // GL_BGR_EXT
34#ifndef GL_BGRA_EXT
35#define GL_BGRA_EXT 0x80E1
36#endif // GL_BGRA_EXT
37
38// ClampToEdge wrap mode (kExtensionTextureEdgeClamp)
39#ifndef GL_CLAMP
40#define GL_CLAMP 0x2900
41#endif // GL_CLAMP
42
43// ClampToBorder wrap mode (kExtensionTextureBorderClamp)
44#ifndef GL_CLAMP_TO_BORDER
45#define GL_CLAMP_TO_BORDER 0x812D
46#endif // GL_CLAMP_TO_BORDER
47#ifndef GL_TEXTURE_BORDER_COLOR
48#define GL_TEXTURE_BORDER_COLOR 0x1004
49#endif // GL_TEXTURE_BORDER_COLOR
50
51// Depth textures (kExtensionDepthTexture)
52#ifndef GL_DEPTH_COMPONENT
53#define GL_DEPTH_COMPONENT 0x1902
54#endif // GL_DEPTH_COMPONENT
55#ifndef GL_DEPTH_COMPONENT32
56#define GL_DEPTH_COMPONENT32 0x81A7
57#endif // GL_DEPTH_COMPONENT32
58
59// 24-bit depth buffer format (kExtensionDepth24)
60#ifndef GL_DEPTH_COMPONENT24
61#define GL_DEPTH_COMPONENT24 0x81A6
62#endif // GL_DEPTH_COMPONENT24
63
64// Packed depth-stencil format (kExtensionPackedDepthStencil)
65#ifndef GL_DEPTH_STENCIL
66#define GL_DEPTH_STENCIL 0x84F9
67#endif // GL_DEPTH_STENCIL
68#ifndef GL_UNSIGNED_INT_24_8
69#define GL_UNSIGNED_INT_24_8 0x84FA
70#endif // GL_UNSIGNED_INT_24_8
71#ifndef GL_DEPTH24_STENCIL8
72#define GL_DEPTH24_STENCIL8 0x88F0
73#endif // GL_DEPTH24_STENCIL8
74// WebGL case
75#ifndef GL_DEPTH_STENCIL_ATTACHMENT
76#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
77#endif // GL_DEPTH_STENCIL_ATTACHMENT
78
79// GL_STENCIL_INDEX8 render buffer storage (kExtensionStencil8)
80#ifndef GL_STENCIL_INDEX
81#define GL_STENCIL_INDEX 0x1901
82#endif // GL_STENCIL_INDEX
83#ifndef GL_STENCIL_INDEX8
84#define GL_STENCIL_INDEX8 0x8D48
85#endif // GL_STENCIL_INDEX8
86
87// Half-float textures support (kExtensionTextureHalfFloat)
88#ifndef GL_RGBA16F
89#define GL_RGBA16F 0x881A
90#endif // GL_RGBA16F
91//#ifndef GL_ALPHA16F
92//#define GL_ALPHA16F 0x881C
93//#endif // GL_ALPHA16F
94// This definitions is only for desktop OpenGL. Native OpenGL ES should use GL_RGBA instead and GL_HALF_FLOAT will be accepted as texture type.
95#ifndef GL_HALF_FLOAT
96#define GL_HALF_FLOAT 0x8D61
97#endif // GL_HALF_FLOAT
98
99// Floating point textures support (kExtensionTextureFloat)
100#ifndef GL_RGBA32F
101#define GL_RGBA32F 0x8814
102#endif // GL_RGBA32F
103//#ifndef GL_ALPHA32F
104//#define GL_ALPHA32F 0x8816
105//#endif // GL_ALPHA32F
106// This definitions is only for desktop OpenGL. Native OpenGL ES should use GL_RGBA instead and GL_FLOAT will be accepted as texture type.
107
108// R/RG half-float textures support (kExtensionTextureHalfFloat + kExtensionTextureRG)
109#ifndef GL_R16F
110#define GL_R16F 0x822D
111#endif // GL_R16F
112#ifndef GL_RG16F
113#define GL_RG16F 0x822F
114#endif // GL_RG16F
115
116// R/RG floating point textures support (kExtensionTextureFloat + kExtensionTextureRG)
117#ifndef GL_R32F
118#define GL_R32F 0x822E
119#endif // GL_R32F
120#ifndef GL_RG32F
121#define GL_RG32F 0x8230
122#endif // GL_RG32F
123
124// R and RG normalized texture and render buffer formats support (kExtensionTextureRG)
125#ifndef GL_RED
126#define GL_RED 0x1903
127#endif // GL_RED
128#ifndef GL_RG
129#define GL_RG 0x8227
130#endif // GL_RG
131#ifndef GL_R8
132#define GL_R8 0x8229
133#endif // GL_R8
134#ifndef GL_RG8
135#define GL_RG8 0x822B
136#endif // GL_RG8
137#ifndef GL_RGB8
138#define GL_RGB8 0x8051
139#endif // GL_RGB8
140#ifndef GL_ALPHA8
141#define GL_ALPHA8 0x803C
142#endif // GL_ALPHA8
143#ifndef GL_LUMINANCE8
144#define GL_LUMINANCE8 0x8040
145#endif // GL_LUMINANCE8
146
147// R and RG normalized texture and render buffer formats support (kExtensionTextureNorm16)
148#ifndef GL_R16
149#define GL_R16 0x822A
150#endif // GL_R16
151#ifndef GL_RG16
152#define GL_RG16 0x822C
153#endif // GL_RG16
154#ifndef GL_RGBA16
155#define GL_RGBA16 0x805B
156#endif // GL_RGBA16
157#ifndef GL_ALPHA16
158#define GL_ALPHA16 0x803E
159#endif // GL_ALPHA16
160
161// R and RG signed normalized texture and render buffer formats support (kExtensionTextureSNorm)
162#ifndef GL_RED_SNORM
163#define GL_RED_SNORM 0x8F90
164#endif // GL_RED_SNORM
165#ifndef GL_RG_SNORM
166#define GL_RG_SNORM 0x8F91
167#endif // GL_RG_SNORM
168#ifndef GL_RGBA_SNORM
169#define GL_RGBA_SNORM 0x8F93
170#endif // GL_RGBA_SNORM
171#ifndef GL_ALPHA_SNORM
172#define GL_ALPHA_SNORM 0x9010
173#endif // GL_ALPHA_SNORM
174#ifndef GL_R8_SNORM
175#define GL_R8_SNORM 0x8F94
176#endif // GL_R8_SNORM
177#ifndef GL_RG8_SNORM
178#define GL_RG8_SNORM 0x8F95
179#endif // GL_RG8_SNORM
180#ifndef GL_RGBA8_SNORM
181#define GL_RGBA8_SNORM 0x8F97
182#endif // GL_RGBA8_SNORM
183#ifndef GL_ALPHA8_SNORM
184#define GL_ALPHA8_SNORM 0x9014
185#endif // GL_ALPHA8_SNORM
186
187// R and RG signed normalized texture and render buffer formats support (kExtensionTextureSNorm16)
188#ifndef GL_R16_SNORM
189#define GL_R16_SNORM 0x8F98
190#endif // GL_R16_SNORM
191#ifndef GL_RG16_SNORM
192#define GL_RG16_SNORM 0x8F99
193#endif // GL_RG16_SNORM
194#ifndef GL_RGBA16_SNORM
195#define GL_RGBA16_SNORM 0x8F9B
196#endif // GL_RGBA16_SNORM
197#ifndef GL_ALPHA16_SNORM
198#define GL_ALPHA16_SNORM 0x9018
199#endif // GL_ALPHA16_SNORM
200
201// Clamping color buffer output control (kExtensionFloatBufferClamp)
202#ifndef GL_RGBA_FLOAT_MODE
203#define GL_RGBA_FLOAT_MODE 0x8820
204#endif // GL_RGBA_FLOAT_MODE
205#ifndef GL_CLAMP_VERTEX_COLOR
206#define GL_CLAMP_VERTEX_COLOR 0x891A
207#endif // GL_CLAMP_VERTEX_COLOR
208#ifndef GL_CLAMP_FRAGMENT_COLOR
209#define GL_CLAMP_FRAGMENT_COLOR 0x891B
210#endif // GL_CLAMP_FRAGMENT_COLOR
211#ifndef GL_CLAMP_READ_COLOR
212#define GL_CLAMP_READ_COLOR 0x891C
213#endif // GL_CLAMP_READ_COLOR
214#ifndef GL_FIXED_ONLY
215#define GL_FIXED_ONLY 0x891D
216#endif // GL_FIXED_ONLY
217
218// Multiple Render Targets support (kExtensionDrawBuffers)
219#ifndef GL_DRAW_BUFFER0
220#define GL_DRAW_BUFFER0 0x8825
221#endif // GL_DRAW_BUFFER0
222#ifndef GL_MAX_DRAW_BUFFERS
223#define GL_MAX_DRAW_BUFFERS 0x8824
224#endif // GL_MAX_DRAW_BUFFERS
225
226// Copy buffers data support (kExtensionCopyBuffer)
227#ifndef GL_COPY_READ_BUFFER
228#define GL_COPY_READ_BUFFER 0x8F36
229#endif // GL_COPY_READ_BUFFER
230#ifndef GL_COPY_WRITE_BUFFER
231#define GL_COPY_WRITE_BUFFER 0x8F37
232#endif // GL_COPY_WRITE_BUFFER
233
234// Cube maps support (kExtensionCubeMap)
235#ifndef GL_TEXTURE_CUBE_MAP
236#define GL_TEXTURE_CUBE_MAP 0x8513
237#endif // GL_TEXTURE_CUBE_MAP
238#ifndef GL_TEXTURE_BINDING_CUBE_MAP
239#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
240#endif // GL_TEXTURE_BINDING_CUBE_MAP
241#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X
242#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
243#endif // GL_TEXTURE_CUBE_MAP_POSITIVE_X
244#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_X
245#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
246#endif // GL_TEXTURE_CUBE_MAP_NEGATIVE_X
247#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Y
248#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
249#endif // GL_TEXTURE_CUBE_MAP_POSITIVE_Y
250#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
251#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
252#endif // GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
253#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Z
254#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
255#endif // GL_TEXTURE_CUBE_MAP_POSITIVE_Z
256#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
257#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
258#endif // GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
259#ifndef GL_MAX_CUBE_MAP_TEXTURE_SIZE
260#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
261#endif // GL_MAX_CUBE_MAP_TEXTURE_SIZE
262
263// Seampless cube maps filtration support (kExtensionCubeMapSeamless)
264#ifndef GL_TEXTURE_CUBE_MAP_SEAMLESS
265#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
266#endif // GL_TEXTURE_CUBE_MAP_SEAMLESS
267
268// Unpack subimage support (kExtensionUnpackSubimage)
269#ifndef GL_UNPACK_ROW_LENGTH
270#define GL_UNPACK_ROW_LENGTH 0x0CF2
271#endif // GL_UNPACK_ROW_LENGTH
272#ifndef GL_UNPACK_SKIP_ROWS
273#define GL_UNPACK_SKIP_ROWS 0x0CF3
274#endif // GL_UNPACK_SKIP_ROWS
275#ifndef GL_UNPACK_SKIP_PIXELS
276#define GL_UNPACK_SKIP_PIXELS 0x0CF4
277#endif // GL_UNPACK_SKIP_PIXELS
278
279// Pixel buffer object (kExtensionPBO)
280#ifndef GL_PIXEL_PACK_BUFFER
281#define GL_PIXEL_PACK_BUFFER 0x88EB
282#endif // GL_PIXEL_PACK_BUFFER
283#ifndef GL_PIXEL_UNPACK_BUFFER
284#define GL_PIXEL_UNPACK_BUFFER 0x88EC
285#endif // GL_PIXEL_UNPACK_BUFFER
286
287// Instanced arrays (kExtensionInstancedArrays)
288#ifndef GL_VERTEX_ATTRIB_ARRAY_DIVISOR
289#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
290#endif // GL_VERTEX_ATTRIB_ARRAY_DIVISOR
291
292// Lines anti-aliasing
293#ifndef GL_LINE_SMOOTH
294#define GL_LINE_SMOOTH 0x0B20
295#endif // GL_LINE_SMOOTH
296#ifndef GL_LINE_SMOOTH_HINT
297#define GL_LINE_SMOOTH_HINT 0x0C52
298#endif // GL_LINE_SMOOTH_HINT
299#ifndef GL_SMOOTH_LINE_WIDTH_RANGE
300#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
301#endif // GL_SMOOTH_LINE_WIDTH_RANGE
302
303// Shading language version
304#ifndef GL_SHADING_LANGUAGE_VERSION
305#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
306#endif // GL_SHADING_LANGUAGE_VERSION
307
308// Required for some desktop GPU's which invoke compatible OpenGL profiles (not required since OpenGL 3.2)
309#ifndef GL_POINT_SPRITE
310#define GL_POINT_SPRITE 0x8861
311#endif // GL_POINT_SPRITE
312// OpenGL ES 2 GLSL point size (not required by native, but necessary for PC and WebGL)
313#ifndef GL_VERTEX_PROGRAM_POINT_SIZE
314#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
315#endif // GL_VERTEX_PROGRAM_POINT_SIZE
316
317// RGBA framebuffers
318// Note: don't think that we must check availability for this format. It is defined with GL_EXT_texture extension for desktop OpenGL, but
319// this format will be available anyway if frame buffers supported. It is defined with GL_OES_rgb8_rgba8 extension for OpemGL ES, but
320// it is in any case is one of the native OpenGL formats, so don't think that it will be unavailable anywhere.
321#ifndef GL_RGBA8
322#define GL_RGBA8 0x8058
323#endif // GL_RGBA8
324//
325
326// Geometry shader extension
327#ifndef GL_GEOMETRY_SHADER
328#define GL_GEOMETRY_SHADER 0x8DD9
329#endif // GL_GEOMETRY_SHADER
330#ifndef GL_GEOMETRY_VERTICES_OUT
331#define GL_GEOMETRY_VERTICES_OUT 0x8DDA
332#endif // GL_GEOMETRY_VERTICES_OUT
333#ifndef GL_GEOMETRY_INPUT_TYPE
334#define GL_GEOMETRY_INPUT_TYPE 0x8DDB
335#endif // GL_GEOMETRY_INPUT_TYPE
336#ifndef GL_GEOMETRY_OUTPUT_TYPE
337#define GL_GEOMETRY_OUTPUT_TYPE 0x8DDC
338#endif // GL_GEOMETRY_OUTPUT_TYPE
339#ifndef GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
340#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
341#endif // GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
342#ifndef GL_LINES_ADJACENCY
343#define GL_LINES_ADJACENCY 0xA
344#endif // GL_LINES_ADJACENCY
345#ifndef GL_LINE_STRIP_ADJACENCY
346#define GL_LINE_STRIP_ADJACENCY 0xB
347#endif // GL_LINE_STRIP_ADJACENCY
348#ifndef GL_TRIANGLES_ADJACENCY
349#define GL_TRIANGLES_ADJACENCY 0xC
350#endif // GL_TRIANGLES_ADJACENCY
351#ifndef GL_TRIANGLE_STRIP_ADJACENCY
352#define GL_TRIANGLE_STRIP_ADJACENCY 0xD
353#endif // GL_TRIANGLE_STRIP_ADJACENCY
354
355// OpenGL ES2 Compatibility (this definitions must be invoked on desktop if ES2 compatibility doesn't supported)
356#ifndef GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
357#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
358#endif // GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
359#ifndef GL_MAX_VERTEX_UNIFORM_COMPONENTS
360#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
361#endif // GL_MAX_VERTEX_UNIFORM_COMPONENTS
362#ifndef GL_POINT_SIZE_RANGE
363#define GL_POINT_SIZE_RANGE 0x0B12
364#endif // GL_POINT_SIZE_RANGE
365#ifndef GL_DOUBLE
366#define GL_DOUBLE 0x140A
367#endif // GL_DOUBLE
368
370
372{
373 protected:
375 protected:
377 public:
379
381
382 // Extension function callers
383 // kExtensionDrawBuffers
384 void glDrawBuffers(GLsizei n, const GLenum *bufs);
385 // kExtensionGeometryShader
388 // kExtensionFloatBufferClamp
389 void glClampColor(GLenum target, GLenum clamp);
390 // kExtensionCopyBuffer
391 void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
392 // kExtensionMapBuffer
393 void *glMapBuffer(GLenum target, GLenum access);
395 // kExtensionDrawInstanced
396 void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
397 void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
398 // kExtensionInstancedArrays
400};
401
402#endif // ODTRGL2EXTENSIONS
void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
void glClampColor(GLenum target, GLenum clamp)
OdTrGL2ExtensionsRegistry(OdTrRndLocalContext *pLocalContext)
void glDrawBuffers(GLsizei n, const GLenum *bufs)
void glVertexAttribDivisor(GLuint index, GLuint divisor)
GLboolean glUnmapBuffer(GLenum target)
bool isExtensionSupportedImpl(ExtensionName nExt)
bool isFunctionAvailable(FunctionName nFunc)
void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
void glProgramParameteri(GLuint program, GLenum pname, GLint value)
void glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
void * m_pFunctionPtr[kNumFunctions]
void * glMapBuffer(GLenum target, GLenum access)
OdTrRndNoGLExtensionsRegistry(OdTrRndLocalContext *pLocalContext)
GLint level
Definition gles2_ext.h:110
GLsizeiptr size
Definition gles2_ext.h:182
GLuint index
Definition gles2_ext.h:265
GLsizei GLsizei * count
Definition gles2_ext.h:276
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274
GLenum GLenum GLuint texture
Definition gles2_ext.h:501
GLenum pname
Definition gles2_ext.h:184
GLenum attachment
Definition gles2_ext.h:501
GLsizei const GLfloat * value
Definition gles2_ext.h:302
void GLvoid
Definition NoGL.h:45
ptrdiff_t GLintptr
Definition NoGL.h:47
int GLsizei
Definition NoGL.h:37
ptrdiff_t GLsizeiptr
Definition NoGL.h:46
unsigned int GLenum
Definition NoGL.h:31
unsigned char GLboolean
Definition NoGL.h:32
int GLint
Definition NoGL.h:36
unsigned int GLuint
Definition NoGL.h:40