this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added support for runtime linking of GLES 3. Thanks Vitaly!

+1101 -2
+7 -1
CMakeLists.txt
··· 57 57 option(SDL_gpu_DISABLE_GLES_3 "Disable OpenGLES 3.X renderer" OFF) 58 58 59 59 option(SDL_gpu_USE_SYSTEM_GLEW "Attempt to use the system GLEW library (may not support GL 3+)" OFF) 60 + option(SDL_gpu_DYNAMIC_GLES_3 "Attempt to run-time link to GLES 3" OFF) 60 61 61 62 option(SDL_gpu_USE_BUFFER_RESET "Upload VBOs by requesting a new one each time (default). This is often the best for driver optimization)" ON) 62 63 option(SDL_gpu_USE_BUFFER_UPDATE "Upload VBOs by updating only the needed portion" OFF) ··· 218 219 if (SDL_gpu_DISABLE_GLES_3) 219 220 add_definitions("-DSDL_GPU_DISABLE_GLES_3") 220 221 endif (SDL_gpu_DISABLE_GLES_3) 221 - 222 + 223 + include_directories(src/externals/gl3stub) 224 + if (SDL_gpu_DYNAMIC_GLES_3) 225 + SET(SDL_gpu_HDRS ${SDL_gpu_HDRS} externals/gl3stub/gl3stub.c externals/gl3stub/gl3stub.h) 226 + add_definitions("-DSDL_GPU_DYNAMIC_GLES_3") 227 + endif(SDL_gpu_DYNAMIC_GLES_3) 222 228 endif (SDL_gpu_DISABLE_GLES) 223 229 224 230 # If stb-image is not found here, we’ll use the bundled version
+2
include/SDL_gpu_GLES_3.h
··· 9 9 #ifdef __IPHONEOS__ 10 10 #include <OpenGLES/ES3/gl.h> 11 11 #include <OpenGLES/ES3/glext.h> 12 + #elif defined(SDL_GPU_DYNAMIC_GLES_3) 13 + #include "gl3stub.h" 12 14 #else 13 15 #include "GLES3/gl3.h" 14 16 #include "GLES2/gl2ext.h"
+421
src/externals/gl3stub/gl3stub.c
··· 1 + /* 2 + * Copyright 2013 The Android Open Source Project 3 + * 4 + * Licensed under the Apache License, Version 2.0 (the "License"); 5 + * you may not use this file except in compliance with the License. 6 + * You may obtain a copy of the License at 7 + * 8 + * http://www.apache.org/licenses/LICENSE-2.0 9 + * 10 + * Unless required by applicable law or agreed to in writing, software 11 + * distributed under the License is distributed on an "AS IS" BASIS, 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 + * See the License for the specific language governing permissions and 14 + * limitations under the License. 15 + */ 16 + 17 + #include <EGL/egl.h> 18 + #include "gl3stub.h" 19 + 20 + GLboolean gl3stubInit() { 21 + #define FIND_PROC(s) s = (void*)eglGetProcAddress(#s); 22 + FIND_PROC(glReadBuffer); 23 + FIND_PROC(glDrawRangeElements); 24 + FIND_PROC(glTexImage3D); 25 + FIND_PROC(glTexSubImage3D); 26 + FIND_PROC(glCopyTexSubImage3D); 27 + FIND_PROC(glCompressedTexImage3D); 28 + FIND_PROC(glCompressedTexSubImage3D); 29 + FIND_PROC(glGenQueries); 30 + FIND_PROC(glDeleteQueries); 31 + FIND_PROC(glIsQuery); 32 + FIND_PROC(glBeginQuery); 33 + FIND_PROC(glEndQuery); 34 + FIND_PROC(glGetQueryiv); 35 + FIND_PROC(glGetQueryObjectuiv); 36 + FIND_PROC(glUnmapBuffer); 37 + FIND_PROC(glGetBufferPointerv); 38 + FIND_PROC(glDrawBuffers); 39 + FIND_PROC(glUniformMatrix2x3fv); 40 + FIND_PROC(glUniformMatrix3x2fv); 41 + FIND_PROC(glUniformMatrix2x4fv); 42 + FIND_PROC(glUniformMatrix4x2fv); 43 + FIND_PROC(glUniformMatrix3x4fv); 44 + FIND_PROC(glUniformMatrix4x3fv); 45 + FIND_PROC(glBlitFramebuffer); 46 + FIND_PROC(glRenderbufferStorageMultisample); 47 + FIND_PROC(glFramebufferTextureLayer); 48 + FIND_PROC(glMapBufferRange); 49 + FIND_PROC(glFlushMappedBufferRange); 50 + FIND_PROC(glBindVertexArray); 51 + FIND_PROC(glDeleteVertexArrays); 52 + FIND_PROC(glGenVertexArrays); 53 + FIND_PROC(glIsVertexArray); 54 + FIND_PROC(glGetIntegeri_v); 55 + FIND_PROC(glBeginTransformFeedback); 56 + FIND_PROC(glEndTransformFeedback); 57 + FIND_PROC(glBindBufferRange); 58 + FIND_PROC(glBindBufferBase); 59 + FIND_PROC(glTransformFeedbackVaryings); 60 + FIND_PROC(glGetTransformFeedbackVarying); 61 + FIND_PROC(glVertexAttribIPointer); 62 + FIND_PROC(glGetVertexAttribIiv); 63 + FIND_PROC(glGetVertexAttribIuiv); 64 + FIND_PROC(glVertexAttribI4i); 65 + FIND_PROC(glVertexAttribI4ui); 66 + FIND_PROC(glVertexAttribI4iv); 67 + FIND_PROC(glVertexAttribI4uiv); 68 + FIND_PROC(glGetUniformuiv); 69 + FIND_PROC(glGetFragDataLocation); 70 + FIND_PROC(glUniform1ui); 71 + FIND_PROC(glUniform2ui); 72 + FIND_PROC(glUniform3ui); 73 + FIND_PROC(glUniform4ui); 74 + FIND_PROC(glUniform1uiv); 75 + FIND_PROC(glUniform2uiv); 76 + FIND_PROC(glUniform3uiv); 77 + FIND_PROC(glUniform4uiv); 78 + FIND_PROC(glClearBufferiv); 79 + FIND_PROC(glClearBufferuiv); 80 + FIND_PROC(glClearBufferfv); 81 + FIND_PROC(glClearBufferfi); 82 + FIND_PROC(glGetStringi); 83 + FIND_PROC(glCopyBufferSubData); 84 + FIND_PROC(glGetUniformIndices); 85 + FIND_PROC(glGetActiveUniformsiv); 86 + FIND_PROC(glGetUniformBlockIndex); 87 + FIND_PROC(glGetActiveUniformBlockiv); 88 + FIND_PROC(glGetActiveUniformBlockName); 89 + FIND_PROC(glUniformBlockBinding); 90 + FIND_PROC(glDrawArraysInstanced); 91 + FIND_PROC(glDrawElementsInstanced); 92 + FIND_PROC(glFenceSync); 93 + FIND_PROC(glIsSync); 94 + FIND_PROC(glDeleteSync); 95 + FIND_PROC(glClientWaitSync); 96 + FIND_PROC(glWaitSync); 97 + FIND_PROC(glGetInteger64v); 98 + FIND_PROC(glGetSynciv); 99 + FIND_PROC(glGetInteger64i_v); 100 + FIND_PROC(glGetBufferParameteri64v); 101 + FIND_PROC(glGenSamplers); 102 + FIND_PROC(glDeleteSamplers); 103 + FIND_PROC(glIsSampler); 104 + FIND_PROC(glBindSampler); 105 + FIND_PROC(glSamplerParameteri); 106 + FIND_PROC(glSamplerParameteriv); 107 + FIND_PROC(glSamplerParameterf); 108 + FIND_PROC(glSamplerParameterfv); 109 + FIND_PROC(glGetSamplerParameteriv); 110 + FIND_PROC(glGetSamplerParameterfv); 111 + FIND_PROC(glVertexAttribDivisor); 112 + FIND_PROC(glBindTransformFeedback); 113 + FIND_PROC(glDeleteTransformFeedbacks); 114 + FIND_PROC(glGenTransformFeedbacks); 115 + FIND_PROC(glIsTransformFeedback); 116 + FIND_PROC(glPauseTransformFeedback); 117 + FIND_PROC(glResumeTransformFeedback); 118 + FIND_PROC(glGetProgramBinary); 119 + FIND_PROC(glProgramBinary); 120 + FIND_PROC(glProgramParameteri); 121 + FIND_PROC(glInvalidateFramebuffer); 122 + FIND_PROC(glInvalidateSubFramebuffer); 123 + FIND_PROC(glTexStorage2D); 124 + FIND_PROC(glTexStorage3D); 125 + FIND_PROC(glGetInternalformativ); 126 + #undef FIND_PROC 127 + 128 + if (!glReadBuffer || !glDrawRangeElements || !glTexImage3D || 129 + !glTexSubImage3D || !glCopyTexSubImage3D || !glCompressedTexImage3D || 130 + !glCompressedTexSubImage3D || !glGenQueries || !glDeleteQueries || 131 + !glIsQuery || !glBeginQuery || !glEndQuery || !glGetQueryiv || 132 + !glGetQueryObjectuiv || !glUnmapBuffer || !glGetBufferPointerv || 133 + !glDrawBuffers || !glUniformMatrix2x3fv || !glUniformMatrix3x2fv || 134 + !glUniformMatrix2x4fv || !glUniformMatrix4x2fv || !glUniformMatrix3x4fv || 135 + !glUniformMatrix4x3fv || !glBlitFramebuffer || 136 + !glRenderbufferStorageMultisample || !glFramebufferTextureLayer || 137 + !glMapBufferRange || !glFlushMappedBufferRange || !glBindVertexArray || 138 + !glDeleteVertexArrays || !glGenVertexArrays || !glIsVertexArray || 139 + !glGetIntegeri_v || !glBeginTransformFeedback || 140 + !glEndTransformFeedback || !glBindBufferRange || !glBindBufferBase || 141 + !glTransformFeedbackVaryings || !glGetTransformFeedbackVarying || 142 + !glVertexAttribIPointer || !glGetVertexAttribIiv || 143 + !glGetVertexAttribIuiv || !glVertexAttribI4i || !glVertexAttribI4ui || 144 + !glVertexAttribI4iv || !glVertexAttribI4uiv || !glGetUniformuiv || 145 + !glGetFragDataLocation || !glUniform1ui || !glUniform2ui || 146 + !glUniform3ui || !glUniform4ui || !glUniform1uiv || !glUniform2uiv || 147 + !glUniform3uiv || !glUniform4uiv || !glClearBufferiv || 148 + !glClearBufferuiv || !glClearBufferfv || !glClearBufferfi || 149 + !glGetStringi || !glCopyBufferSubData || !glGetUniformIndices || 150 + !glGetActiveUniformsiv || !glGetUniformBlockIndex || 151 + !glGetActiveUniformBlockiv || !glGetActiveUniformBlockName || 152 + !glUniformBlockBinding || !glDrawArraysInstanced || 153 + !glDrawElementsInstanced || !glFenceSync || !glIsSync || !glDeleteSync || 154 + !glClientWaitSync || !glWaitSync || !glGetInteger64v || !glGetSynciv || 155 + !glGetInteger64i_v || !glGetBufferParameteri64v || !glGenSamplers || 156 + !glDeleteSamplers || !glIsSampler || !glBindSampler || 157 + !glSamplerParameteri || !glSamplerParameteriv || !glSamplerParameterf || 158 + !glSamplerParameterfv || !glGetSamplerParameteriv || 159 + !glGetSamplerParameterfv || !glVertexAttribDivisor || 160 + !glBindTransformFeedback || !glDeleteTransformFeedbacks || 161 + !glGenTransformFeedbacks || !glIsTransformFeedback || 162 + !glPauseTransformFeedback || !glResumeTransformFeedback || 163 + !glGetProgramBinary || !glProgramBinary || !glProgramParameteri || 164 + !glInvalidateFramebuffer || !glInvalidateSubFramebuffer || 165 + !glTexStorage2D || !glTexStorage3D || !glGetInternalformativ) { 166 + return GL_FALSE; 167 + } 168 + 169 + return GL_TRUE; 170 + } 171 + 172 + /* Function pointer definitions */ GL_APICALL void (*GL_APIENTRY glReadBuffer)( 173 + GLenum mode); 174 + GL_APICALL void (*GL_APIENTRY glDrawRangeElements)(GLenum mode, GLuint start, 175 + GLuint end, GLsizei count, 176 + GLenum type, 177 + const GLvoid* indices); 178 + GL_APICALL void (*GL_APIENTRY glTexImage3D)(GLenum target, GLint level, 179 + GLint internalformat, GLsizei width, 180 + GLsizei height, GLsizei depth, 181 + GLint border, GLenum format, 182 + GLenum type, const GLvoid* pixels); 183 + GL_APICALL void (*GL_APIENTRY glTexSubImage3D)(GLenum target, GLint level, 184 + GLint xoffset, GLint yoffset, 185 + GLint zoffset, GLsizei width, 186 + GLsizei height, GLsizei depth, 187 + GLenum format, GLenum type, 188 + const GLvoid* pixels); 189 + GL_APICALL void (*GL_APIENTRY glCopyTexSubImage3D)(GLenum target, GLint level, 190 + GLint xoffset, GLint yoffset, 191 + GLint zoffset, GLint x, 192 + GLint y, GLsizei width, 193 + GLsizei height); 194 + GL_APICALL void (*GL_APIENTRY glCompressedTexImage3D)( 195 + GLenum target, GLint level, GLenum internalformat, GLsizei width, 196 + GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, 197 + const GLvoid* data); 198 + GL_APICALL void (*GL_APIENTRY glCompressedTexSubImage3D)( 199 + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, 200 + GLsizei width, GLsizei height, GLsizei depth, GLenum format, 201 + GLsizei imageSize, const GLvoid* data); 202 + GL_APICALL void (*GL_APIENTRY glGenQueries)(GLsizei n, GLuint* ids); 203 + GL_APICALL void (*GL_APIENTRY glDeleteQueries)(GLsizei n, const GLuint* ids); 204 + GL_APICALL GLboolean (*GL_APIENTRY glIsQuery)(GLuint id); 205 + GL_APICALL void (*GL_APIENTRY glBeginQuery)(GLenum target, GLuint id); 206 + GL_APICALL void (*GL_APIENTRY glEndQuery)(GLenum target); 207 + GL_APICALL void (*GL_APIENTRY glGetQueryiv)(GLenum target, GLenum pname, 208 + GLint* params); 209 + GL_APICALL void (*GL_APIENTRY glGetQueryObjectuiv)(GLuint id, GLenum pname, 210 + GLuint* params); 211 + GL_APICALL GLboolean (*GL_APIENTRY glUnmapBuffer)(GLenum target); 212 + GL_APICALL void (*GL_APIENTRY glGetBufferPointerv)(GLenum target, GLenum pname, 213 + GLvoid** params); 214 + GL_APICALL void (*GL_APIENTRY glDrawBuffers)(GLsizei n, const GLenum* bufs); 215 + GL_APICALL void (*GL_APIENTRY glUniformMatrix2x3fv)(GLint location, 216 + GLsizei count, 217 + GLboolean transpose, 218 + const GLfloat* value); 219 + GL_APICALL void (*GL_APIENTRY glUniformMatrix3x2fv)(GLint location, 220 + GLsizei count, 221 + GLboolean transpose, 222 + const GLfloat* value); 223 + GL_APICALL void (*GL_APIENTRY glUniformMatrix2x4fv)(GLint location, 224 + GLsizei count, 225 + GLboolean transpose, 226 + const GLfloat* value); 227 + GL_APICALL void (*GL_APIENTRY glUniformMatrix4x2fv)(GLint location, 228 + GLsizei count, 229 + GLboolean transpose, 230 + const GLfloat* value); 231 + GL_APICALL void (*GL_APIENTRY glUniformMatrix3x4fv)(GLint location, 232 + GLsizei count, 233 + GLboolean transpose, 234 + const GLfloat* value); 235 + GL_APICALL void (*GL_APIENTRY glUniformMatrix4x3fv)(GLint location, 236 + GLsizei count, 237 + GLboolean transpose, 238 + const GLfloat* value); 239 + GL_APICALL void (*GL_APIENTRY glBlitFramebuffer)( 240 + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, 241 + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 242 + GL_APICALL void (*GL_APIENTRY glRenderbufferStorageMultisample)( 243 + GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, 244 + GLsizei height); 245 + GL_APICALL void (*GL_APIENTRY glFramebufferTextureLayer)( 246 + GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); 247 + GL_APICALL GLvoid* (*GL_APIENTRY glMapBufferRange)(GLenum target, 248 + GLintptr offset, 249 + GLsizeiptr length, 250 + GLbitfield access); 251 + GL_APICALL void (*GL_APIENTRY glFlushMappedBufferRange)(GLenum target, 252 + GLintptr offset, 253 + GLsizeiptr length); 254 + GL_APICALL void (*GL_APIENTRY glBindVertexArray)(GLuint array); 255 + GL_APICALL void (*GL_APIENTRY glDeleteVertexArrays)(GLsizei n, 256 + const GLuint* arrays); 257 + GL_APICALL void (*GL_APIENTRY glGenVertexArrays)(GLsizei n, GLuint* arrays); 258 + GL_APICALL GLboolean (*GL_APIENTRY glIsVertexArray)(GLuint array); 259 + GL_APICALL void (*GL_APIENTRY glGetIntegeri_v)(GLenum target, GLuint index, 260 + GLint* data); 261 + GL_APICALL void (*GL_APIENTRY glBeginTransformFeedback)(GLenum primitiveMode); 262 + GL_APICALL void (*GL_APIENTRY glEndTransformFeedback)(void); 263 + GL_APICALL void (*GL_APIENTRY glBindBufferRange)(GLenum target, GLuint index, 264 + GLuint buffer, GLintptr offset, 265 + GLsizeiptr size); 266 + GL_APICALL void (*GL_APIENTRY glBindBufferBase)(GLenum target, GLuint index, 267 + GLuint buffer); 268 + GL_APICALL void (*GL_APIENTRY glTransformFeedbackVaryings)( 269 + GLuint program, GLsizei count, const GLchar* const* varyings, 270 + GLenum bufferMode); 271 + GL_APICALL void (*GL_APIENTRY glGetTransformFeedbackVarying)( 272 + GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, 273 + GLsizei* size, GLenum* type, GLchar* name); 274 + GL_APICALL void (*GL_APIENTRY glVertexAttribIPointer)(GLuint index, GLint size, 275 + GLenum type, 276 + GLsizei stride, 277 + const GLvoid* pointer); 278 + GL_APICALL void (*GL_APIENTRY glGetVertexAttribIiv)(GLuint index, GLenum pname, 279 + GLint* params); 280 + GL_APICALL void (*GL_APIENTRY glGetVertexAttribIuiv)(GLuint index, GLenum pname, 281 + GLuint* params); 282 + GL_APICALL void (*GL_APIENTRY glVertexAttribI4i)(GLuint index, GLint x, GLint y, 283 + GLint z, GLint w); 284 + GL_APICALL void (*GL_APIENTRY glVertexAttribI4ui)(GLuint index, GLuint x, 285 + GLuint y, GLuint z, GLuint w); 286 + GL_APICALL void (*GL_APIENTRY glVertexAttribI4iv)(GLuint index, const GLint* v); 287 + GL_APICALL void (*GL_APIENTRY glVertexAttribI4uiv)(GLuint index, 288 + const GLuint* v); 289 + GL_APICALL void (*GL_APIENTRY glGetUniformuiv)(GLuint program, GLint location, 290 + GLuint* params); 291 + GL_APICALL GLint (*GL_APIENTRY glGetFragDataLocation)(GLuint program, 292 + const GLchar* name); 293 + GL_APICALL void (*GL_APIENTRY glUniform1ui)(GLint location, GLuint v0); 294 + GL_APICALL void (*GL_APIENTRY glUniform2ui)(GLint location, GLuint v0, 295 + GLuint v1); 296 + GL_APICALL void (*GL_APIENTRY glUniform3ui)(GLint location, GLuint v0, 297 + GLuint v1, GLuint v2); 298 + GL_APICALL void (*GL_APIENTRY glUniform4ui)(GLint location, GLuint v0, 299 + GLuint v1, GLuint v2, GLuint v3); 300 + GL_APICALL void (*GL_APIENTRY glUniform1uiv)(GLint location, GLsizei count, 301 + const GLuint* value); 302 + GL_APICALL void (*GL_APIENTRY glUniform2uiv)(GLint location, GLsizei count, 303 + const GLuint* value); 304 + GL_APICALL void (*GL_APIENTRY glUniform3uiv)(GLint location, GLsizei count, 305 + const GLuint* value); 306 + GL_APICALL void (*GL_APIENTRY glUniform4uiv)(GLint location, GLsizei count, 307 + const GLuint* value); 308 + GL_APICALL void (*GL_APIENTRY glClearBufferiv)(GLenum buffer, GLint drawbuffer, 309 + const GLint* value); 310 + GL_APICALL void (*GL_APIENTRY glClearBufferuiv)(GLenum buffer, GLint drawbuffer, 311 + const GLuint* value); 312 + GL_APICALL void (*GL_APIENTRY glClearBufferfv)(GLenum buffer, GLint drawbuffer, 313 + const GLfloat* value); 314 + GL_APICALL void (*GL_APIENTRY glClearBufferfi)(GLenum buffer, GLint drawbuffer, 315 + GLfloat depth, GLint stencil); 316 + GL_APICALL const GLubyte* (*GL_APIENTRY glGetStringi)(GLenum name, 317 + GLuint index); 318 + GL_APICALL void (*GL_APIENTRY glCopyBufferSubData)(GLenum readTarget, 319 + GLenum writeTarget, 320 + GLintptr readOffset, 321 + GLintptr writeOffset, 322 + GLsizeiptr size); 323 + GL_APICALL void (*GL_APIENTRY glGetUniformIndices)( 324 + GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, 325 + GLuint* uniformIndices); 326 + GL_APICALL void (*GL_APIENTRY glGetActiveUniformsiv)( 327 + GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, 328 + GLenum pname, GLint* params); 329 + GL_APICALL GLuint (*GL_APIENTRY glGetUniformBlockIndex)( 330 + GLuint program, const GLchar* uniformBlockName); 331 + GL_APICALL void (*GL_APIENTRY glGetActiveUniformBlockiv)( 332 + GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); 333 + GL_APICALL void (*GL_APIENTRY glGetActiveUniformBlockName)( 334 + GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, 335 + GLchar* uniformBlockName); 336 + GL_APICALL void (*GL_APIENTRY glUniformBlockBinding)( 337 + GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); 338 + GL_APICALL void (*GL_APIENTRY glDrawArraysInstanced)(GLenum mode, GLint first, 339 + GLsizei count, 340 + GLsizei instanceCount); 341 + GL_APICALL void (*GL_APIENTRY glDrawElementsInstanced)(GLenum mode, 342 + GLsizei count, 343 + GLenum type, 344 + const GLvoid* indices, 345 + GLsizei instanceCount); 346 + GL_APICALL GLsync (*GL_APIENTRY glFenceSync)(GLenum condition, 347 + GLbitfield flags); 348 + GL_APICALL GLboolean (*GL_APIENTRY glIsSync)(GLsync sync); 349 + GL_APICALL void (*GL_APIENTRY glDeleteSync)(GLsync sync); 350 + GL_APICALL GLenum (*GL_APIENTRY glClientWaitSync)(GLsync sync, GLbitfield flags, 351 + GLuint64 timeout); 352 + GL_APICALL void (*GL_APIENTRY glWaitSync)(GLsync sync, GLbitfield flags, 353 + GLuint64 timeout); 354 + GL_APICALL void (*GL_APIENTRY glGetInteger64v)(GLenum pname, GLint64* params); 355 + GL_APICALL void (*GL_APIENTRY glGetSynciv)(GLsync sync, GLenum pname, 356 + GLsizei bufSize, GLsizei* length, 357 + GLint* values); 358 + GL_APICALL void (*GL_APIENTRY glGetInteger64i_v)(GLenum target, GLuint index, 359 + GLint64* data); 360 + GL_APICALL void (*GL_APIENTRY glGetBufferParameteri64v)(GLenum target, 361 + GLenum pname, 362 + GLint64* params); 363 + GL_APICALL void (*GL_APIENTRY glGenSamplers)(GLsizei count, GLuint* samplers); 364 + GL_APICALL void (*GL_APIENTRY glDeleteSamplers)(GLsizei count, 365 + const GLuint* samplers); 366 + GL_APICALL GLboolean (*GL_APIENTRY glIsSampler)(GLuint sampler); 367 + GL_APICALL void (*GL_APIENTRY glBindSampler)(GLuint unit, GLuint sampler); 368 + GL_APICALL void (*GL_APIENTRY glSamplerParameteri)(GLuint sampler, GLenum pname, 369 + GLint param); 370 + GL_APICALL void (*GL_APIENTRY glSamplerParameteriv)(GLuint sampler, 371 + GLenum pname, 372 + const GLint* param); 373 + GL_APICALL void (*GL_APIENTRY glSamplerParameterf)(GLuint sampler, GLenum pname, 374 + GLfloat param); 375 + GL_APICALL void (*GL_APIENTRY glSamplerParameterfv)(GLuint sampler, 376 + GLenum pname, 377 + const GLfloat* param); 378 + GL_APICALL void (*GL_APIENTRY glGetSamplerParameteriv)(GLuint sampler, 379 + GLenum pname, 380 + GLint* params); 381 + GL_APICALL void (*GL_APIENTRY glGetSamplerParameterfv)(GLuint sampler, 382 + GLenum pname, 383 + GLfloat* params); 384 + GL_APICALL void (*GL_APIENTRY glVertexAttribDivisor)(GLuint index, 385 + GLuint divisor); 386 + GL_APICALL void (*GL_APIENTRY glBindTransformFeedback)(GLenum target, 387 + GLuint id); 388 + GL_APICALL void (*GL_APIENTRY glDeleteTransformFeedbacks)(GLsizei n, 389 + const GLuint* ids); 390 + GL_APICALL void (*GL_APIENTRY glGenTransformFeedbacks)(GLsizei n, GLuint* ids); 391 + GL_APICALL GLboolean (*GL_APIENTRY glIsTransformFeedback)(GLuint id); 392 + GL_APICALL void (*GL_APIENTRY glPauseTransformFeedback)(void); 393 + GL_APICALL void (*GL_APIENTRY glResumeTransformFeedback)(void); 394 + GL_APICALL void (*GL_APIENTRY glGetProgramBinary)(GLuint program, 395 + GLsizei bufSize, 396 + GLsizei* length, 397 + GLenum* binaryFormat, 398 + GLvoid* binary); 399 + GL_APICALL void (*GL_APIENTRY glProgramBinary)(GLuint program, 400 + GLenum binaryFormat, 401 + const GLvoid* binary, 402 + GLsizei length); 403 + GL_APICALL void (*GL_APIENTRY glProgramParameteri)(GLuint program, GLenum pname, 404 + GLint value); 405 + GL_APICALL void (*GL_APIENTRY glInvalidateFramebuffer)( 406 + GLenum target, GLsizei numAttachments, const GLenum* attachments); 407 + GL_APICALL void (*GL_APIENTRY glInvalidateSubFramebuffer)( 408 + GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, 409 + GLint y, GLsizei width, GLsizei height); 410 + GL_APICALL void (*GL_APIENTRY glTexStorage2D)(GLenum target, GLsizei levels, 411 + GLenum internalformat, 412 + GLsizei width, GLsizei height); 413 + GL_APICALL void (*GL_APIENTRY glTexStorage3D)(GLenum target, GLsizei levels, 414 + GLenum internalformat, 415 + GLsizei width, GLsizei height, 416 + GLsizei depth); 417 + GL_APICALL void (*GL_APIENTRY glGetInternalformativ)(GLenum target, 418 + GLenum internalformat, 419 + GLenum pname, 420 + GLsizei bufSize, 421 + GLint* params);
+661
src/externals/gl3stub/gl3stub.h
··· 1 + #ifndef __gl3_h_ 2 + #define __gl3_h_ 3 + 4 + /* 5 + * stub gl3.h for dynamic loading, based on: 6 + * gl3.h last updated on $Date: 2013-02-12 14:37:24 -0800 (Tue, 12 Feb 2013) $ 7 + * 8 + * Changes: 9 + * - Added #include <GLES2/gl2.h> 10 + * - Removed duplicate OpenGL ES 2.0 declarations 11 + * - Converted OpenGL ES 3.0 function prototypes to function pointer 12 + * declarations 13 + * - Added gl3stubInit() declaration 14 + */ 15 + 16 + #include <GLES2/gl2.h> 17 + #include <android/api-level.h> 18 + 19 + #ifdef __cplusplus 20 + extern "C" { 21 + #endif 22 + 23 + /* 24 + ** Copyright (c) 2007-2013 The Khronos Group Inc. 25 + ** 26 + ** Permission is hereby granted, free of charge, to any person obtaining a 27 + ** copy of this software and/or associated documentation files (the 28 + ** "Materials"), to deal in the Materials without restriction, including 29 + ** without limitation the rights to use, copy, modify, merge, publish, 30 + ** distribute, sublicense, and/or sell copies of the Materials, and to 31 + ** permit persons to whom the Materials are furnished to do so, subject to 32 + ** the following conditions: 33 + ** 34 + ** The above copyright notice and this permission notice shall be included 35 + ** in all copies or substantial portions of the Materials. 36 + ** 37 + ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 38 + ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 39 + ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 40 + ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 41 + ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 42 + ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 43 + ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 44 + */ 45 + 46 + /* 47 + * This files is for apps that want to use ES3 if present, 48 + * but continue to work on pre-API-18 devices. They can't just link to -lGLESv3 49 + *since 50 + * that library doesn't exist on pre-API-18 devices. 51 + * The function dynamically check if OpenGLES3.0 APIs are present and fill in if 52 + *there are. 53 + * Also the header defines some extra variables for OpenGLES3.0. 54 + * 55 + */ 56 + 57 + /* Call this function before calling any OpenGL ES 3.0 functions. It will 58 + * return GL_TRUE if the OpenGL ES 3.0 was successfully initialized, GL_FALSE 59 + * otherwise. */ 60 + GLboolean gl3stubInit(); 61 + 62 + /*------------------------------------------------------------------------- 63 + * Data type definitions 64 + *-----------------------------------------------------------------------*/ 65 + 66 + /* OpenGL ES 3.0 */ 67 + 68 + typedef unsigned short GLhalf; 69 + #if __ANDROID_API__ <= 19 70 + typedef khronos_int64_t GLint64; 71 + typedef khronos_uint64_t GLuint64; 72 + typedef struct __GLsync* GLsync; 73 + #endif 74 + 75 + /*------------------------------------------------------------------------- 76 + * Token definitions 77 + *-----------------------------------------------------------------------*/ 78 + 79 + /* OpenGL ES core versions */ 80 + #define GL_ES_VERSION_3_0 1 81 + 82 + /* OpenGL ES 3.0 */ 83 + 84 + #define GL_READ_BUFFER 0x0C02 85 + #define GL_UNPACK_ROW_LENGTH 0x0CF2 86 + #define GL_UNPACK_SKIP_ROWS 0x0CF3 87 + #define GL_UNPACK_SKIP_PIXELS 0x0CF4 88 + #define GL_PACK_ROW_LENGTH 0x0D02 89 + #define GL_PACK_SKIP_ROWS 0x0D03 90 + #define GL_PACK_SKIP_PIXELS 0x0D04 91 + #define GL_COLOR 0x1800 92 + #define GL_DEPTH 0x1801 93 + #define GL_STENCIL 0x1802 94 + #define GL_RED 0x1903 95 + #define GL_RGB8 0x8051 96 + #define GL_RGBA8 0x8058 97 + #define GL_RGB10_A2 0x8059 98 + #define GL_TEXTURE_BINDING_3D 0x806A 99 + #define GL_UNPACK_SKIP_IMAGES 0x806D 100 + #define GL_UNPACK_IMAGE_HEIGHT 0x806E 101 + #define GL_TEXTURE_3D 0x806F 102 + #define GL_TEXTURE_WRAP_R 0x8072 103 + #define GL_MAX_3D_TEXTURE_SIZE 0x8073 104 + #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 105 + #define GL_MAX_ELEMENTS_VERTICES 0x80E8 106 + #define GL_MAX_ELEMENTS_INDICES 0x80E9 107 + #define GL_TEXTURE_MIN_LOD 0x813A 108 + #define GL_TEXTURE_MAX_LOD 0x813B 109 + #define GL_TEXTURE_BASE_LEVEL 0x813C 110 + #define GL_TEXTURE_MAX_LEVEL 0x813D 111 + #define GL_MIN 0x8007 112 + #define GL_MAX 0x8008 113 + #define GL_DEPTH_COMPONENT24 0x81A6 114 + #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD 115 + #define GL_TEXTURE_COMPARE_MODE 0x884C 116 + #define GL_TEXTURE_COMPARE_FUNC 0x884D 117 + #define GL_CURRENT_QUERY 0x8865 118 + #define GL_QUERY_RESULT 0x8866 119 + #define GL_QUERY_RESULT_AVAILABLE 0x8867 120 + #define GL_BUFFER_MAPPED 0x88BC 121 + #define GL_BUFFER_MAP_POINTER 0x88BD 122 + #define GL_STREAM_READ 0x88E1 123 + #define GL_STREAM_COPY 0x88E2 124 + #define GL_STATIC_READ 0x88E5 125 + #define GL_STATIC_COPY 0x88E6 126 + #define GL_DYNAMIC_READ 0x88E9 127 + #define GL_DYNAMIC_COPY 0x88EA 128 + #define GL_MAX_DRAW_BUFFERS 0x8824 129 + #define GL_DRAW_BUFFER0 0x8825 130 + #define GL_DRAW_BUFFER1 0x8826 131 + #define GL_DRAW_BUFFER2 0x8827 132 + #define GL_DRAW_BUFFER3 0x8828 133 + #define GL_DRAW_BUFFER4 0x8829 134 + #define GL_DRAW_BUFFER5 0x882A 135 + #define GL_DRAW_BUFFER6 0x882B 136 + #define GL_DRAW_BUFFER7 0x882C 137 + #define GL_DRAW_BUFFER8 0x882D 138 + #define GL_DRAW_BUFFER9 0x882E 139 + #define GL_DRAW_BUFFER10 0x882F 140 + #define GL_DRAW_BUFFER11 0x8830 141 + #define GL_DRAW_BUFFER12 0x8831 142 + #define GL_DRAW_BUFFER13 0x8832 143 + #define GL_DRAW_BUFFER14 0x8833 144 + #define GL_DRAW_BUFFER15 0x8834 145 + #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 146 + #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A 147 + #define GL_SAMPLER_3D 0x8B5F 148 + #define GL_SAMPLER_2D_SHADOW 0x8B62 149 + #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B 150 + #define GL_PIXEL_PACK_BUFFER 0x88EB 151 + #define GL_PIXEL_UNPACK_BUFFER 0x88EC 152 + #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED 153 + #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF 154 + #define GL_FLOAT_MAT2x3 0x8B65 155 + #define GL_FLOAT_MAT2x4 0x8B66 156 + #define GL_FLOAT_MAT3x2 0x8B67 157 + #define GL_FLOAT_MAT3x4 0x8B68 158 + #define GL_FLOAT_MAT4x2 0x8B69 159 + #define GL_FLOAT_MAT4x3 0x8B6A 160 + #define GL_SRGB 0x8C40 161 + #define GL_SRGB8 0x8C41 162 + #define GL_SRGB8_ALPHA8 0x8C43 163 + #define GL_COMPARE_REF_TO_TEXTURE 0x884E 164 + #define GL_MAJOR_VERSION 0x821B 165 + #define GL_MINOR_VERSION 0x821C 166 + #define GL_NUM_EXTENSIONS 0x821D 167 + #define GL_RGBA32F 0x8814 168 + #define GL_RGB32F 0x8815 169 + #define GL_RGBA16F 0x881A 170 + #define GL_RGB16F 0x881B 171 + #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD 172 + #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF 173 + #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 174 + #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 175 + #define GL_MAX_VARYING_COMPONENTS 0x8B4B 176 + #define GL_TEXTURE_2D_ARRAY 0x8C1A 177 + #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D 178 + #define GL_R11F_G11F_B10F 0x8C3A 179 + #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B 180 + #define GL_RGB9_E5 0x8C3D 181 + #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E 182 + #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 183 + #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F 184 + #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 185 + #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 186 + #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 187 + #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 188 + #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 189 + #define GL_RASTERIZER_DISCARD 0x8C89 190 + #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A 191 + #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B 192 + #define GL_INTERLEAVED_ATTRIBS 0x8C8C 193 + #define GL_SEPARATE_ATTRIBS 0x8C8D 194 + #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E 195 + #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F 196 + #define GL_RGBA32UI 0x8D70 197 + #define GL_RGB32UI 0x8D71 198 + #define GL_RGBA16UI 0x8D76 199 + #define GL_RGB16UI 0x8D77 200 + #define GL_RGBA8UI 0x8D7C 201 + #define GL_RGB8UI 0x8D7D 202 + #define GL_RGBA32I 0x8D82 203 + #define GL_RGB32I 0x8D83 204 + #define GL_RGBA16I 0x8D88 205 + #define GL_RGB16I 0x8D89 206 + #define GL_RGBA8I 0x8D8E 207 + #define GL_RGB8I 0x8D8F 208 + #define GL_RED_INTEGER 0x8D94 209 + #define GL_RGB_INTEGER 0x8D98 210 + #define GL_RGBA_INTEGER 0x8D99 211 + #define GL_SAMPLER_2D_ARRAY 0x8DC1 212 + #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 213 + #define GL_SAMPLER_CUBE_SHADOW 0x8DC5 214 + #define GL_UNSIGNED_INT_VEC2 0x8DC6 215 + #define GL_UNSIGNED_INT_VEC3 0x8DC7 216 + #define GL_UNSIGNED_INT_VEC4 0x8DC8 217 + #define GL_INT_SAMPLER_2D 0x8DCA 218 + #define GL_INT_SAMPLER_3D 0x8DCB 219 + #define GL_INT_SAMPLER_CUBE 0x8DCC 220 + #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF 221 + #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 222 + #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 223 + #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 224 + #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 225 + #define GL_BUFFER_ACCESS_FLAGS 0x911F 226 + #define GL_BUFFER_MAP_LENGTH 0x9120 227 + #define GL_BUFFER_MAP_OFFSET 0x9121 228 + #define GL_DEPTH_COMPONENT32F 0x8CAC 229 + #define GL_DEPTH32F_STENCIL8 0x8CAD 230 + #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD 231 + #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 232 + #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 233 + #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 234 + #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 235 + #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 236 + #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 237 + #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 238 + #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 239 + #define GL_FRAMEBUFFER_DEFAULT 0x8218 240 + #define GL_FRAMEBUFFER_UNDEFINED 0x8219 241 + #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A 242 + #define GL_DEPTH_STENCIL 0x84F9 243 + #define GL_UNSIGNED_INT_24_8 0x84FA 244 + #define GL_DEPTH24_STENCIL8 0x88F0 245 + #define GL_UNSIGNED_NORMALIZED 0x8C17 246 + #define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING 247 + #define GL_READ_FRAMEBUFFER 0x8CA8 248 + #define GL_DRAW_FRAMEBUFFER 0x8CA9 249 + #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA 250 + #define GL_RENDERBUFFER_SAMPLES 0x8CAB 251 + #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 252 + #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF 253 + #define GL_COLOR_ATTACHMENT1 0x8CE1 254 + #define GL_COLOR_ATTACHMENT2 0x8CE2 255 + #define GL_COLOR_ATTACHMENT3 0x8CE3 256 + #define GL_COLOR_ATTACHMENT4 0x8CE4 257 + #define GL_COLOR_ATTACHMENT5 0x8CE5 258 + #define GL_COLOR_ATTACHMENT6 0x8CE6 259 + #define GL_COLOR_ATTACHMENT7 0x8CE7 260 + #define GL_COLOR_ATTACHMENT8 0x8CE8 261 + #define GL_COLOR_ATTACHMENT9 0x8CE9 262 + #define GL_COLOR_ATTACHMENT10 0x8CEA 263 + #define GL_COLOR_ATTACHMENT11 0x8CEB 264 + #define GL_COLOR_ATTACHMENT12 0x8CEC 265 + #define GL_COLOR_ATTACHMENT13 0x8CED 266 + #define GL_COLOR_ATTACHMENT14 0x8CEE 267 + #define GL_COLOR_ATTACHMENT15 0x8CEF 268 + #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 269 + #define GL_MAX_SAMPLES 0x8D57 270 + #define GL_HALF_FLOAT 0x140B 271 + #define GL_MAP_READ_BIT 0x0001 272 + #define GL_MAP_WRITE_BIT 0x0002 273 + #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 274 + #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 275 + #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 276 + #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 277 + #define GL_RG 0x8227 278 + #define GL_RG_INTEGER 0x8228 279 + #define GL_R8 0x8229 280 + #define GL_RG8 0x822B 281 + #define GL_R16F 0x822D 282 + #define GL_R32F 0x822E 283 + #define GL_RG16F 0x822F 284 + #define GL_RG32F 0x8230 285 + #define GL_R8I 0x8231 286 + #define GL_R8UI 0x8232 287 + #define GL_R16I 0x8233 288 + #define GL_R16UI 0x8234 289 + #define GL_R32I 0x8235 290 + #define GL_R32UI 0x8236 291 + #define GL_RG8I 0x8237 292 + #define GL_RG8UI 0x8238 293 + #define GL_RG16I 0x8239 294 + #define GL_RG16UI 0x823A 295 + #define GL_RG32I 0x823B 296 + #define GL_RG32UI 0x823C 297 + #define GL_VERTEX_ARRAY_BINDING 0x85B5 298 + #define GL_R8_SNORM 0x8F94 299 + #define GL_RG8_SNORM 0x8F95 300 + #define GL_RGB8_SNORM 0x8F96 301 + #define GL_RGBA8_SNORM 0x8F97 302 + #define GL_SIGNED_NORMALIZED 0x8F9C 303 + #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 304 + #define GL_COPY_READ_BUFFER 0x8F36 305 + #define GL_COPY_WRITE_BUFFER 0x8F37 306 + #define GL_COPY_READ_BUFFER_BINDING GL_COPY_READ_BUFFER 307 + #define GL_COPY_WRITE_BUFFER_BINDING GL_COPY_WRITE_BUFFER 308 + #define GL_UNIFORM_BUFFER 0x8A11 309 + #define GL_UNIFORM_BUFFER_BINDING 0x8A28 310 + #define GL_UNIFORM_BUFFER_START 0x8A29 311 + #define GL_UNIFORM_BUFFER_SIZE 0x8A2A 312 + #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B 313 + #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D 314 + #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E 315 + #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F 316 + #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 317 + #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 318 + #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 319 + #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 320 + #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 321 + #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 322 + #define GL_UNIFORM_TYPE 0x8A37 323 + #define GL_UNIFORM_SIZE 0x8A38 324 + #define GL_UNIFORM_NAME_LENGTH 0x8A39 325 + #define GL_UNIFORM_BLOCK_INDEX 0x8A3A 326 + #define GL_UNIFORM_OFFSET 0x8A3B 327 + #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C 328 + #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D 329 + #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E 330 + #define GL_UNIFORM_BLOCK_BINDING 0x8A3F 331 + #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 332 + #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 333 + #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 334 + #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 335 + #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 336 + #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 337 + #define GL_INVALID_INDEX 0xFFFFFFFFu 338 + #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 339 + #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 340 + #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 341 + #define GL_OBJECT_TYPE 0x9112 342 + #define GL_SYNC_CONDITION 0x9113 343 + #define GL_SYNC_STATUS 0x9114 344 + #define GL_SYNC_FLAGS 0x9115 345 + #define GL_SYNC_FENCE 0x9116 346 + #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 347 + #define GL_UNSIGNALED 0x9118 348 + #define GL_SIGNALED 0x9119 349 + #define GL_ALREADY_SIGNALED 0x911A 350 + #define GL_TIMEOUT_EXPIRED 0x911B 351 + #define GL_CONDITION_SATISFIED 0x911C 352 + #define GL_WAIT_FAILED 0x911D 353 + #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 354 + #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull 355 + #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE 356 + #define GL_ANY_SAMPLES_PASSED 0x8C2F 357 + #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A 358 + #define GL_SAMPLER_BINDING 0x8919 359 + #define GL_RGB10_A2UI 0x906F 360 + #define GL_TEXTURE_SWIZZLE_R 0x8E42 361 + #define GL_TEXTURE_SWIZZLE_G 0x8E43 362 + #define GL_TEXTURE_SWIZZLE_B 0x8E44 363 + #define GL_TEXTURE_SWIZZLE_A 0x8E45 364 + #define GL_GREEN 0x1904 365 + #define GL_BLUE 0x1905 366 + #define GL_INT_2_10_10_10_REV 0x8D9F 367 + #define GL_TRANSFORM_FEEDBACK 0x8E22 368 + #define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 369 + #define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 370 + #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 371 + #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 372 + #define GL_PROGRAM_BINARY_LENGTH 0x8741 373 + #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE 374 + #define GL_PROGRAM_BINARY_FORMATS 0x87FF 375 + #define GL_COMPRESSED_R11_EAC 0x9270 376 + #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 377 + #define GL_COMPRESSED_RG11_EAC 0x9272 378 + #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 379 + #define GL_COMPRESSED_RGB8_ETC2 0x9274 380 + #define GL_COMPRESSED_SRGB8_ETC2 0x9275 381 + #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 382 + #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 383 + #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 384 + #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 385 + #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F 386 + #define GL_MAX_ELEMENT_INDEX 0x8D6B 387 + #define GL_NUM_SAMPLE_COUNTS 0x9380 388 + #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF 389 + 390 + /*------------------------------------------------------------------------- 391 + * Entrypoint definitions 392 + *-----------------------------------------------------------------------*/ 393 + 394 + /* OpenGL ES 3.0 */ 395 + 396 + extern GL_APICALL void (*GL_APIENTRY glReadBuffer)(GLenum mode); 397 + extern GL_APICALL void (*GL_APIENTRY glDrawRangeElements)( 398 + GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, 399 + const GLvoid* indices); 400 + extern GL_APICALL void (*GL_APIENTRY glTexImage3D)( 401 + GLenum target, GLint level, GLint internalformat, GLsizei width, 402 + GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, 403 + const GLvoid* pixels); 404 + extern GL_APICALL void (*GL_APIENTRY glTexSubImage3D)( 405 + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, 406 + GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, 407 + const GLvoid* pixels); 408 + extern GL_APICALL void (*GL_APIENTRY glCopyTexSubImage3D)( 409 + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, 410 + GLint x, GLint y, GLsizei width, GLsizei height); 411 + extern GL_APICALL void (*GL_APIENTRY glCompressedTexImage3D)( 412 + GLenum target, GLint level, GLenum internalformat, GLsizei width, 413 + GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, 414 + const GLvoid* data); 415 + extern GL_APICALL void (*GL_APIENTRY glCompressedTexSubImage3D)( 416 + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, 417 + GLsizei width, GLsizei height, GLsizei depth, GLenum format, 418 + GLsizei imageSize, const GLvoid* data); 419 + extern GL_APICALL void (*GL_APIENTRY glGenQueries)(GLsizei n, GLuint* ids); 420 + extern GL_APICALL void (*GL_APIENTRY glDeleteQueries)(GLsizei n, 421 + const GLuint* ids); 422 + extern GL_APICALL GLboolean (*GL_APIENTRY glIsQuery)(GLuint id); 423 + extern GL_APICALL void (*GL_APIENTRY glBeginQuery)(GLenum target, GLuint id); 424 + extern GL_APICALL void (*GL_APIENTRY glEndQuery)(GLenum target); 425 + extern GL_APICALL void (*GL_APIENTRY glGetQueryiv)(GLenum target, GLenum pname, 426 + GLint* params); 427 + extern GL_APICALL void (*GL_APIENTRY glGetQueryObjectuiv)(GLuint id, 428 + GLenum pname, 429 + GLuint* params); 430 + extern GL_APICALL GLboolean (*GL_APIENTRY glUnmapBuffer)(GLenum target); 431 + extern GL_APICALL void (*GL_APIENTRY glGetBufferPointerv)(GLenum target, 432 + GLenum pname, 433 + GLvoid** params); 434 + extern GL_APICALL void (*GL_APIENTRY glDrawBuffers)(GLsizei n, 435 + const GLenum* bufs); 436 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix2x3fv)( 437 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 438 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix3x2fv)( 439 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 440 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix2x4fv)( 441 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 442 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix4x2fv)( 443 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 444 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix3x4fv)( 445 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 446 + extern GL_APICALL void (*GL_APIENTRY glUniformMatrix4x3fv)( 447 + GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 448 + extern GL_APICALL void (*GL_APIENTRY glBlitFramebuffer)( 449 + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, 450 + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 451 + extern GL_APICALL void (*GL_APIENTRY glRenderbufferStorageMultisample)( 452 + GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, 453 + GLsizei height); 454 + extern GL_APICALL void (*GL_APIENTRY glFramebufferTextureLayer)( 455 + GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); 456 + extern GL_APICALL GLvoid* (*GL_APIENTRY glMapBufferRange)(GLenum target, 457 + GLintptr offset, 458 + GLsizeiptr length, 459 + GLbitfield access); 460 + extern GL_APICALL void (*GL_APIENTRY glFlushMappedBufferRange)( 461 + GLenum target, GLintptr offset, GLsizeiptr length); 462 + extern GL_APICALL void (*GL_APIENTRY glBindVertexArray)(GLuint array); 463 + extern GL_APICALL void (*GL_APIENTRY glDeleteVertexArrays)( 464 + GLsizei n, const GLuint* arrays); 465 + extern GL_APICALL void (*GL_APIENTRY glGenVertexArrays)(GLsizei n, 466 + GLuint* arrays); 467 + extern GL_APICALL GLboolean (*GL_APIENTRY glIsVertexArray)(GLuint array); 468 + extern GL_APICALL void (*GL_APIENTRY glGetIntegeri_v)(GLenum target, 469 + GLuint index, 470 + GLint* data); 471 + extern GL_APICALL void (*GL_APIENTRY glBeginTransformFeedback)( 472 + GLenum primitiveMode); 473 + extern GL_APICALL void (*GL_APIENTRY glEndTransformFeedback)(void); 474 + extern GL_APICALL void (*GL_APIENTRY glBindBufferRange)(GLenum target, 475 + GLuint index, 476 + GLuint buffer, 477 + GLintptr offset, 478 + GLsizeiptr size); 479 + extern GL_APICALL void (*GL_APIENTRY glBindBufferBase)(GLenum target, 480 + GLuint index, 481 + GLuint buffer); 482 + extern GL_APICALL void (*GL_APIENTRY glTransformFeedbackVaryings)( 483 + GLuint program, GLsizei count, const GLchar* const* varyings, 484 + GLenum bufferMode); 485 + extern GL_APICALL void (*GL_APIENTRY glGetTransformFeedbackVarying)( 486 + GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, 487 + GLsizei* size, GLenum* type, GLchar* name); 488 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribIPointer)( 489 + GLuint index, GLint size, GLenum type, GLsizei stride, 490 + const GLvoid* pointer); 491 + extern GL_APICALL void (*GL_APIENTRY glGetVertexAttribIiv)(GLuint index, 492 + GLenum pname, 493 + GLint* params); 494 + extern GL_APICALL void (*GL_APIENTRY glGetVertexAttribIuiv)(GLuint index, 495 + GLenum pname, 496 + GLuint* params); 497 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribI4i)(GLuint index, GLint x, 498 + GLint y, GLint z, 499 + GLint w); 500 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribI4ui)(GLuint index, GLuint x, 501 + GLuint y, GLuint z, 502 + GLuint w); 503 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribI4iv)(GLuint index, 504 + const GLint* v); 505 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribI4uiv)(GLuint index, 506 + const GLuint* v); 507 + extern GL_APICALL void (*GL_APIENTRY glGetUniformuiv)(GLuint program, 508 + GLint location, 509 + GLuint* params); 510 + extern GL_APICALL GLint (*GL_APIENTRY glGetFragDataLocation)( 511 + GLuint program, const GLchar* name); 512 + extern GL_APICALL void (*GL_APIENTRY glUniform1ui)(GLint location, GLuint v0); 513 + extern GL_APICALL void (*GL_APIENTRY glUniform2ui)(GLint location, GLuint v0, 514 + GLuint v1); 515 + extern GL_APICALL void (*GL_APIENTRY glUniform3ui)(GLint location, GLuint v0, 516 + GLuint v1, GLuint v2); 517 + extern GL_APICALL void (*GL_APIENTRY glUniform4ui)(GLint location, GLuint v0, 518 + GLuint v1, GLuint v2, 519 + GLuint v3); 520 + extern GL_APICALL void (*GL_APIENTRY glUniform1uiv)(GLint location, 521 + GLsizei count, 522 + const GLuint* value); 523 + extern GL_APICALL void (*GL_APIENTRY glUniform2uiv)(GLint location, 524 + GLsizei count, 525 + const GLuint* value); 526 + extern GL_APICALL void (*GL_APIENTRY glUniform3uiv)(GLint location, 527 + GLsizei count, 528 + const GLuint* value); 529 + extern GL_APICALL void (*GL_APIENTRY glUniform4uiv)(GLint location, 530 + GLsizei count, 531 + const GLuint* value); 532 + extern GL_APICALL void (*GL_APIENTRY glClearBufferiv)(GLenum buffer, 533 + GLint drawbuffer, 534 + const GLint* value); 535 + extern GL_APICALL void (*GL_APIENTRY glClearBufferuiv)(GLenum buffer, 536 + GLint drawbuffer, 537 + const GLuint* value); 538 + extern GL_APICALL void (*GL_APIENTRY glClearBufferfv)(GLenum buffer, 539 + GLint drawbuffer, 540 + const GLfloat* value); 541 + extern GL_APICALL void (*GL_APIENTRY glClearBufferfi)(GLenum buffer, 542 + GLint drawbuffer, 543 + GLfloat depth, 544 + GLint stencil); 545 + extern GL_APICALL const GLubyte* (*GL_APIENTRY glGetStringi)(GLenum name, 546 + GLuint index); 547 + extern GL_APICALL void (*GL_APIENTRY glCopyBufferSubData)(GLenum readTarget, 548 + GLenum writeTarget, 549 + GLintptr readOffset, 550 + GLintptr writeOffset, 551 + GLsizeiptr size); 552 + extern GL_APICALL void (*GL_APIENTRY glGetUniformIndices)( 553 + GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, 554 + GLuint* uniformIndices); 555 + extern GL_APICALL void (*GL_APIENTRY glGetActiveUniformsiv)( 556 + GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, 557 + GLenum pname, GLint* params); 558 + extern GL_APICALL GLuint (*GL_APIENTRY glGetUniformBlockIndex)( 559 + GLuint program, const GLchar* uniformBlockName); 560 + extern GL_APICALL void (*GL_APIENTRY glGetActiveUniformBlockiv)( 561 + GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); 562 + extern GL_APICALL void (*GL_APIENTRY glGetActiveUniformBlockName)( 563 + GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, 564 + GLchar* uniformBlockName); 565 + extern GL_APICALL void (*GL_APIENTRY glUniformBlockBinding)( 566 + GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); 567 + extern GL_APICALL void (*GL_APIENTRY glDrawArraysInstanced)( 568 + GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); 569 + extern GL_APICALL void (*GL_APIENTRY glDrawElementsInstanced)( 570 + GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, 571 + GLsizei instanceCount); 572 + extern GL_APICALL GLsync (*GL_APIENTRY glFenceSync)(GLenum condition, 573 + GLbitfield flags); 574 + extern GL_APICALL GLboolean (*GL_APIENTRY glIsSync)(GLsync sync); 575 + extern GL_APICALL void (*GL_APIENTRY glDeleteSync)(GLsync sync); 576 + extern GL_APICALL GLenum (*GL_APIENTRY glClientWaitSync)(GLsync sync, 577 + GLbitfield flags, 578 + GLuint64 timeout); 579 + extern GL_APICALL void (*GL_APIENTRY glWaitSync)(GLsync sync, GLbitfield flags, 580 + GLuint64 timeout); 581 + extern GL_APICALL void (*GL_APIENTRY glGetInteger64v)(GLenum pname, 582 + GLint64* params); 583 + extern GL_APICALL void (*GL_APIENTRY glGetSynciv)(GLsync sync, GLenum pname, 584 + GLsizei bufSize, 585 + GLsizei* length, 586 + GLint* values); 587 + extern GL_APICALL void (*GL_APIENTRY glGetInteger64i_v)(GLenum target, 588 + GLuint index, 589 + GLint64* data); 590 + extern GL_APICALL void (*GL_APIENTRY glGetBufferParameteri64v)(GLenum target, 591 + GLenum pname, 592 + GLint64* params); 593 + extern GL_APICALL void (*GL_APIENTRY glGenSamplers)(GLsizei count, 594 + GLuint* samplers); 595 + extern GL_APICALL void (*GL_APIENTRY glDeleteSamplers)(GLsizei count, 596 + const GLuint* samplers); 597 + extern GL_APICALL GLboolean (*GL_APIENTRY glIsSampler)(GLuint sampler); 598 + extern GL_APICALL void (*GL_APIENTRY glBindSampler)(GLuint unit, 599 + GLuint sampler); 600 + extern GL_APICALL void (*GL_APIENTRY glSamplerParameteri)(GLuint sampler, 601 + GLenum pname, 602 + GLint param); 603 + extern GL_APICALL void (*GL_APIENTRY glSamplerParameteriv)(GLuint sampler, 604 + GLenum pname, 605 + const GLint* param); 606 + extern GL_APICALL void (*GL_APIENTRY glSamplerParameterf)(GLuint sampler, 607 + GLenum pname, 608 + GLfloat param); 609 + extern GL_APICALL void (*GL_APIENTRY glSamplerParameterfv)( 610 + GLuint sampler, GLenum pname, const GLfloat* param); 611 + extern GL_APICALL void (*GL_APIENTRY glGetSamplerParameteriv)(GLuint sampler, 612 + GLenum pname, 613 + GLint* params); 614 + extern GL_APICALL void (*GL_APIENTRY glGetSamplerParameterfv)(GLuint sampler, 615 + GLenum pname, 616 + GLfloat* params); 617 + extern GL_APICALL void (*GL_APIENTRY glVertexAttribDivisor)(GLuint index, 618 + GLuint divisor); 619 + extern GL_APICALL void (*GL_APIENTRY glBindTransformFeedback)(GLenum target, 620 + GLuint id); 621 + extern GL_APICALL void (*GL_APIENTRY glDeleteTransformFeedbacks)( 622 + GLsizei n, const GLuint* ids); 623 + extern GL_APICALL void (*GL_APIENTRY glGenTransformFeedbacks)(GLsizei n, 624 + GLuint* ids); 625 + extern GL_APICALL GLboolean (*GL_APIENTRY glIsTransformFeedback)(GLuint id); 626 + extern GL_APICALL void (*GL_APIENTRY glPauseTransformFeedback)(void); 627 + extern GL_APICALL void (*GL_APIENTRY glResumeTransformFeedback)(void); 628 + extern GL_APICALL void (*GL_APIENTRY glGetProgramBinary)(GLuint program, 629 + GLsizei bufSize, 630 + GLsizei* length, 631 + GLenum* binaryFormat, 632 + GLvoid* binary); 633 + extern GL_APICALL void (*GL_APIENTRY glProgramBinary)(GLuint program, 634 + GLenum binaryFormat, 635 + const GLvoid* binary, 636 + GLsizei length); 637 + extern GL_APICALL void (*GL_APIENTRY glProgramParameteri)(GLuint program, 638 + GLenum pname, 639 + GLint value); 640 + extern GL_APICALL void (*GL_APIENTRY glInvalidateFramebuffer)( 641 + GLenum target, GLsizei numAttachments, const GLenum* attachments); 642 + extern GL_APICALL void (*GL_APIENTRY glInvalidateSubFramebuffer)( 643 + GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, 644 + GLint y, GLsizei width, GLsizei height); 645 + extern GL_APICALL void (*GL_APIENTRY glTexStorage2D)(GLenum target, 646 + GLsizei levels, 647 + GLenum internalformat, 648 + GLsizei width, 649 + GLsizei height); 650 + extern GL_APICALL void (*GL_APIENTRY glTexStorage3D)( 651 + GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, 652 + GLsizei height, GLsizei depth); 653 + extern GL_APICALL void (*GL_APIENTRY glGetInternalformativ)( 654 + GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, 655 + GLint* params); 656 + 657 + #ifdef __cplusplus 658 + } 659 + #endif 660 + 661 + #endif
+10 -1
src/renderer_GLES_3.c
··· 10 10 11 11 #else 12 12 13 + #if defined(SDL_GPU_DYNAMIC_GLES_3) 14 + #include "gl3stub.c" 15 + #endif 13 16 14 17 // Most of the code pulled in from here... 15 18 #define SDL_GPU_USE_GLES ··· 30 33 31 34 GPU_Renderer* GPU_CreateRenderer_GLES_3(GPU_RendererID request) 32 35 { 33 - GPU_Renderer* renderer = (GPU_Renderer*)SDL_malloc(sizeof(GPU_Renderer)); 36 + GPU_Renderer* renderer; 37 + #ifdef SDL_GPU_DYNAMIC_GLES_3 38 + if(!gl3stubInit()) 39 + return NULL; 40 + #endif 41 + 42 + renderer = (GPU_Renderer*)SDL_malloc(sizeof(GPU_Renderer)); 34 43 if(renderer == NULL) 35 44 return NULL; 36 45