Skip to content

Commit 3bd934e

Browse files
authored
Add glClampColor() and GL_DEPTH24_STENCIL8 (scp-fs2open#7478)
1 parent 20c8417 commit 3bd934e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

code/graphics/opengl/es_compatibility.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
2828
#define GL_BGR 0x80E0
2929
#define GL_MULTISAMPLE 0x809D
30+
#define GL_CLAMP_READ_COLOR 0x891C
31+
#define GL_CLAMP_VERTEX_COLOR 0x891A
32+
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
33+
#define GL_FIXED_ONLY 0x891D
3034

3135
//Enums Redefinitions
3236
#define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT // GL_EXT_clip_cull_distance
@@ -268,6 +272,8 @@ static inline void glTexImage2D(GLenum target, GLint level, GLint internalformat
268272
glad_glTexImage2D(target, level, internalformat, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, data);
269273
} else if (internalformat == GL_DEPTH_COMPONENT24) {
270274
glad_glTexImage2D(target, level, internalformat, width, height, border, format, GL_UNSIGNED_INT, data);
275+
} else if (internalformat == GL_DEPTH24_STENCIL8) {
276+
glad_glTexImage2D(target, level, internalformat, width, height, border, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, data);
271277
} else {
272278
glad_glTexImage2D(target, level, internalformat, width, height, border, format, type, data);
273279
}
@@ -307,6 +313,9 @@ static inline void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
307313
Missing functions for ES 3.2 compatibility
308314
*/
309315

316+
// Used during screenshots, that dont work anyway.
317+
#define glClampColor(target, clamp) ((void)0)
318+
310319
// Not present on ES, emulating with glDrawBuffers
311320
// Positional mapping: element i must be COLOR_ATTACHMENTi o NONE.
312321
// ONLY for blits/clears. For draw calls the location of frag shader

0 commit comments

Comments
 (0)