CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrGL2Extensions.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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
28#include "../nogl/TrRndNoGLExtensionsRegistry.h"
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
223// Copy buffers data support (kExtensionCopyBuffer)
224#ifndef GL_COPY_READ_BUFFER
225#define GL_COPY_READ_BUFFER 0x8F36
226#endif // GL_COPY_READ_BUFFER
227#ifndef GL_COPY_WRITE_BUFFER
228#define GL_COPY_WRITE_BUFFER 0x8F37
229#endif // GL_COPY_WRITE_BUFFER
230
231// Lines anti-aliasing
232#ifndef GL_LINE_SMOOTH
233#define GL_LINE_SMOOTH 0x0B20
234#endif // GL_LINE_SMOOTH
235#ifndef GL_LINE_SMOOTH_HINT
236#define GL_LINE_SMOOTH_HINT 0x0C52
237#endif // GL_LINE_SMOOTH_HINT
238#ifndef GL_SMOOTH_LINE_WIDTH_RANGE
239#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
240#endif // GL_SMOOTH_LINE_WIDTH_RANGE
241
242// Shading language version
243#ifndef GL_SHADING_LANGUAGE_VERSION
244#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
245#endif // GL_SHADING_LANGUAGE_VERSION
246
247// Required for some desktop GPU's which invoke compatible OpenGL profiles (not required since OpenGL 3.2)
248#ifndef GL_POINT_SPRITE
249#define GL_POINT_SPRITE 0x8861
250#endif // GL_POINT_SPRITE
251// OpenGL ES 2 GLSL point size (not required by native, but necessary for PC and WebGL)
252#ifndef GL_VERTEX_PROGRAM_POINT_SIZE
253#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
254#endif // GL_VERTEX_PROGRAM_POINT_SIZE
255
256// RGBA framebuffers
257// Note: don't think that we must check availability for this format. It is defined with GL_EXT_texture extension for desktop OpenGL, but
258// this format will be available anyway if frame buffers supported. It is defined with GL_OES_rgb8_rgba8 extension for OpemGL ES, but
259// it is in any case is one of the native OpenGL formats, so don't think that it will be unavailable anywhere.
260#ifndef GL_RGBA8
261#define GL_RGBA8 0x8058
262#endif // GL_RGBA8
263//
264
265// Geometry shader extension
266#ifndef GL_GEOMETRY_SHADER
267#define GL_GEOMETRY_SHADER 0x8DD9
268#endif // GL_GEOMETRY_SHADER
269#ifndef GL_GEOMETRY_VERTICES_OUT
270#define GL_GEOMETRY_VERTICES_OUT 0x8DDA
271#endif // GL_GEOMETRY_VERTICES_OUT
272#ifndef GL_GEOMETRY_INPUT_TYPE
273#define GL_GEOMETRY_INPUT_TYPE 0x8DDB
274#endif // GL_GEOMETRY_INPUT_TYPE
275#ifndef GL_GEOMETRY_OUTPUT_TYPE
276#define GL_GEOMETRY_OUTPUT_TYPE 0x8DDC
277#endif // GL_GEOMETRY_OUTPUT_TYPE
278#ifndef GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
279#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
280#endif // GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
281#ifndef GL_LINES_ADJACENCY
282#define GL_LINES_ADJACENCY 0xA
283#endif // GL_LINES_ADJACENCY
284#ifndef GL_LINE_STRIP_ADJACENCY
285#define GL_LINE_STRIP_ADJACENCY 0xB
286#endif // GL_LINE_STRIP_ADJACENCY
287#ifndef GL_TRIANGLES_ADJACENCY
288#define GL_TRIANGLES_ADJACENCY 0xC
289#endif // GL_TRIANGLES_ADJACENCY
290#ifndef GL_TRIANGLE_STRIP_ADJACENCY
291#define GL_TRIANGLE_STRIP_ADJACENCY 0xD
292#endif // GL_TRIANGLE_STRIP_ADJACENCY
293
294// OpenGL ES2 Compatibility (this definitions must be invoked on desktop if ES2 compatibility doesn't supported)
295#ifndef GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
296#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
297#endif // GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
298#ifndef GL_MAX_VERTEX_UNIFORM_COMPONENTS
299#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
300#endif // GL_MAX_VERTEX_UNIFORM_COMPONENTS
301#ifndef GL_POINT_SIZE_RANGE
302#define GL_POINT_SIZE_RANGE 0x0B12
303#endif // GL_POINT_SIZE_RANGE
304#ifndef GL_DOUBLE
305#define GL_DOUBLE 0x140A
306#endif // GL_DOUBLE
307
309
311{
312 public:
314
316
318
319 // Extension function callers
320 // kExtensionDrawBuffers
321 void glDrawBuffers(GLsizei n, const GLenum *bufs);
322 // kExtensionGeometryShader
325 // kExtensionFloatBufferClamp
326 void glClampColor(GLenum target, GLenum clamp);
327 // kExtensionCopyBuffer
328 void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
329};
330
331#endif // ODTRGL2EXTENSIONS
void glClampColor(GLenum target, GLenum clamp)
OdTrGL2ExtensionsRegistry(OdTrRndLocalContext *pLocalContext)
bool isExtensionSupported(ExtensionName nExt)
void glDrawBuffers(GLsizei n, const GLenum *bufs)
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)
GLint level
Definition: gles2_ext.h:110
GLsizeiptr size
Definition: gles2_ext.h:182
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
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
int GLint
Definition: NoGL.h:36
unsigned int GLuint
Definition: NoGL.h:40