1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // main.cpp: DLL entry point and management of thread-local data. 16 17 #include "main.h" 18 19 #include "libGLESv2.hpp" 20 #include "Framebuffer.h" 21 #include "libEGL/main.h" 22 #include "libEGL/Surface.h" 23 #include "Common/Thread.hpp" 24 #include "Common/SharedLibrary.hpp" 25 #include "common/debug.h" 26 27 #if !defined(_MSC_VER) 28 #define CONSTRUCTOR __attribute__((constructor)) 29 #define DESTRUCTOR __attribute__((destructor)) 30 #else 31 #define CONSTRUCTOR 32 #define DESTRUCTOR 33 #endif 34 35 static void glAttachThread() 36 { 37 TRACE("()"); 38 } 39 40 static void glDetachThread() 41 { 42 TRACE("()"); 43 } 44 45 CONSTRUCTOR static void glAttachProcess() 46 { 47 TRACE("()"); 48 49 glAttachThread(); 50 } 51 52 DESTRUCTOR static void glDetachProcess() 53 { 54 TRACE("()"); 55 56 glDetachThread(); 57 } 58 59 #if defined(_WIN32) 60 extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) 61 { 62 switch(reason) 63 { 64 case DLL_PROCESS_ATTACH: 65 glAttachProcess(); 66 break; 67 case DLL_THREAD_ATTACH: 68 glAttachThread(); 69 break; 70 case DLL_THREAD_DETACH: 71 glDetachThread(); 72 break; 73 case DLL_PROCESS_DETACH: 74 glDetachProcess(); 75 break; 76 default: 77 break; 78 } 79 80 return TRUE; 81 } 82 #endif 83 84 namespace es2 85 { 86 es2::Context *getContext() 87 { 88 egl::Context *context = libEGL->clientGetCurrentContext(); 89 90 if(context && (context->getClientVersion() == 2 || 91 context->getClientVersion() == 3)) 92 { 93 return static_cast<es2::Context*>(context); 94 } 95 96 return 0; 97 } 98 99 Device *getDevice() 100 { 101 Context *context = getContext(); 102 103 return context ? context->getDevice() : 0; 104 } 105 106 // Records an error code 107 void error(GLenum errorCode) 108 { 109 es2::Context *context = es2::getContext(); 110 111 if(context) 112 { 113 switch(errorCode) 114 { 115 case GL_INVALID_ENUM: 116 context->recordInvalidEnum(); 117 TRACE("\t! Error generated: invalid enum\n"); 118 break; 119 case GL_INVALID_VALUE: 120 context->recordInvalidValue(); 121 TRACE("\t! Error generated: invalid value\n"); 122 break; 123 case GL_INVALID_OPERATION: 124 context->recordInvalidOperation(); 125 TRACE("\t! Error generated: invalid operation\n"); 126 break; 127 case GL_OUT_OF_MEMORY: 128 context->recordOutOfMemory(); 129 TRACE("\t! Error generated: out of memory\n"); 130 break; 131 case GL_INVALID_FRAMEBUFFER_OPERATION: 132 context->recordInvalidFramebufferOperation(); 133 TRACE("\t! Error generated: invalid framebuffer operation\n"); 134 break; 135 default: UNREACHABLE(errorCode); 136 } 137 } 138 } 139 } 140 141 namespace egl 142 { 143 GLint getClientVersion() 144 { 145 Context *context = libEGL->clientGetCurrentContext(); 146 147 return context ? context->getClientVersion() : 0; 148 } 149 } 150 151 namespace es2 152 { 153 void ActiveTexture(GLenum texture); 154 void AttachShader(GLuint program, GLuint shader); 155 void BeginQueryEXT(GLenum target, GLuint name); 156 void BindAttribLocation(GLuint program, GLuint index, const GLchar* name); 157 void BindBuffer(GLenum target, GLuint buffer); 158 void BindFramebuffer(GLenum target, GLuint framebuffer); 159 void BindRenderbuffer(GLenum target, GLuint renderbuffer); 160 void BindTexture(GLenum target, GLuint texture); 161 void BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 162 void BlendEquation(GLenum mode); 163 void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); 164 void BlendFunc(GLenum sfactor, GLenum dfactor); 165 void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); 166 void BufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); 167 void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); 168 GLenum CheckFramebufferStatus(GLenum target); 169 void Clear(GLbitfield mask); 170 void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 171 void ClearDepthf(GLclampf depth); 172 void ClearStencil(GLint s); 173 void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 174 void CompileShader(GLuint shader); 175 void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, 176 GLint border, GLsizei imageSize, const GLvoid* data); 177 void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 178 GLenum format, GLsizei imageSize, const GLvoid* data); 179 void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); 180 void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); 181 GLuint CreateProgram(void); 182 GLuint CreateShader(GLenum type); 183 void CullFace(GLenum mode); 184 void DeleteBuffers(GLsizei n, const GLuint* buffers); 185 void DeleteFencesNV(GLsizei n, const GLuint* fences); 186 void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers); 187 void DeleteProgram(GLuint program); 188 void DeleteQueriesEXT(GLsizei n, const GLuint *ids); 189 void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers); 190 void DeleteShader(GLuint shader); 191 void DeleteTextures(GLsizei n, const GLuint* textures); 192 void DepthFunc(GLenum func); 193 void DepthMask(GLboolean flag); 194 void DepthRangef(GLclampf zNear, GLclampf zFar); 195 void DetachShader(GLuint program, GLuint shader); 196 void Disable(GLenum cap); 197 void DisableVertexAttribArray(GLuint index); 198 void DrawArrays(GLenum mode, GLint first, GLsizei count); 199 void DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); 200 void DrawArraysInstancedEXT(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); 201 void DrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount); 202 void VertexAttribDivisorEXT(GLuint index, GLuint divisor); 203 void DrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); 204 void DrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount); 205 void VertexAttribDivisorANGLE(GLuint index, GLuint divisor); 206 void Enable(GLenum cap); 207 void EnableVertexAttribArray(GLuint index); 208 void EndQueryEXT(GLenum target); 209 void FinishFenceNV(GLuint fence); 210 void Finish(void); 211 void Flush(void); 212 void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); 213 void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 214 void FrontFace(GLenum mode); 215 void GenBuffers(GLsizei n, GLuint* buffers); 216 void GenerateMipmap(GLenum target); 217 void GenFencesNV(GLsizei n, GLuint* fences); 218 void GenFramebuffers(GLsizei n, GLuint* framebuffers); 219 void GenQueriesEXT(GLsizei n, GLuint* ids); 220 void GenRenderbuffers(GLsizei n, GLuint* renderbuffers); 221 void GenTextures(GLsizei n, GLuint* textures); 222 void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); 223 void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); 224 void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); 225 int GetAttribLocation(GLuint program, const GLchar* name); 226 void GetBooleanv(GLenum pname, GLboolean* params); 227 void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params); 228 GLenum GetError(void); 229 void GetFenceivNV(GLuint fence, GLenum pname, GLint *params); 230 void GetFloatv(GLenum pname, GLfloat* params); 231 void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params); 232 GLenum GetGraphicsResetStatusEXT(void); 233 void GetIntegerv(GLenum pname, GLint* params); 234 void GetProgramiv(GLuint program, GLenum pname, GLint* params); 235 void GetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); 236 void GetQueryivEXT(GLenum target, GLenum pname, GLint *params); 237 void GetQueryObjectuivEXT(GLuint name, GLenum pname, GLuint *params); 238 void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params); 239 void GetShaderiv(GLuint shader, GLenum pname, GLint* params); 240 void GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); 241 void GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); 242 void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); 243 const GLubyte* GetString(GLenum name); 244 void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params); 245 void GetTexParameteriv(GLenum target, GLenum pname, GLint* params); 246 void GetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); 247 void GetUniformfv(GLuint program, GLint location, GLfloat* params); 248 void GetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params); 249 void GetUniformiv(GLuint program, GLint location, GLint* params); 250 int GetUniformLocation(GLuint program, const GLchar* name); 251 void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params); 252 void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params); 253 void GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer); 254 void Hint(GLenum target, GLenum mode); 255 GLboolean IsBuffer(GLuint buffer); 256 GLboolean IsEnabled(GLenum cap); 257 GLboolean IsFenceNV(GLuint fence); 258 GLboolean IsFramebuffer(GLuint framebuffer); 259 GLboolean IsProgram(GLuint program); 260 GLboolean IsQueryEXT(GLuint name); 261 GLboolean IsRenderbuffer(GLuint renderbuffer); 262 GLboolean IsShader(GLuint shader); 263 GLboolean IsTexture(GLuint texture); 264 void LineWidth(GLfloat width); 265 void LinkProgram(GLuint program); 266 void PixelStorei(GLenum pname, GLint param); 267 void PolygonOffset(GLfloat factor, GLfloat units); 268 void ReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, 269 GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); 270 void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); 271 void ReleaseShaderCompiler(void); 272 void RenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 273 void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); 274 void SampleCoverage(GLclampf value, GLboolean invert); 275 void SetFenceNV(GLuint fence, GLenum condition); 276 void Scissor(GLint x, GLint y, GLsizei width, GLsizei height); 277 void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); 278 void ShaderSource(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length); 279 void StencilFunc(GLenum func, GLint ref, GLuint mask); 280 void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); 281 void StencilMask(GLuint mask); 282 void StencilMaskSeparate(GLenum face, GLuint mask); 283 void StencilOp(GLenum fail, GLenum zfail, GLenum zpass); 284 void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); 285 GLboolean TestFenceNV(GLuint fence); 286 void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, 287 GLint border, GLenum format, GLenum type, const GLvoid* pixels); 288 void TexParameterf(GLenum target, GLenum pname, GLfloat param); 289 void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params); 290 void TexParameteri(GLenum target, GLenum pname, GLint param); 291 void TexParameteriv(GLenum target, GLenum pname, const GLint* params); 292 void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 293 GLenum format, GLenum type, const GLvoid* pixels); 294 void Uniform1f(GLint location, GLfloat x); 295 void Uniform1fv(GLint location, GLsizei count, const GLfloat* v); 296 void Uniform1i(GLint location, GLint x); 297 void Uniform1iv(GLint location, GLsizei count, const GLint* v); 298 void Uniform2f(GLint location, GLfloat x, GLfloat y); 299 void Uniform2fv(GLint location, GLsizei count, const GLfloat* v); 300 void Uniform2i(GLint location, GLint x, GLint y); 301 void Uniform2iv(GLint location, GLsizei count, const GLint* v); 302 void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z); 303 void Uniform3fv(GLint location, GLsizei count, const GLfloat* v); 304 void Uniform3i(GLint location, GLint x, GLint y, GLint z); 305 void Uniform3iv(GLint location, GLsizei count, const GLint* v); 306 void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 307 void Uniform4fv(GLint location, GLsizei count, const GLfloat* v); 308 void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w); 309 void Uniform4iv(GLint location, GLsizei count, const GLint* v); 310 void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 311 void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 312 void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 313 void UseProgram(GLuint program); 314 void ValidateProgram(GLuint program); 315 void VertexAttrib1f(GLuint index, GLfloat x); 316 void VertexAttrib1fv(GLuint index, const GLfloat* values); 317 void VertexAttrib2f(GLuint index, GLfloat x, GLfloat y); 318 void VertexAttrib2fv(GLuint index, const GLfloat* values); 319 void VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); 320 void VertexAttrib3fv(GLuint index, const GLfloat* values); 321 void VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 322 void VertexAttrib4fv(GLuint index, const GLfloat* values); 323 GL_APICALL void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); 324 GL_APICALL void Viewport(GLint x, GLint y, GLsizei width, GLsizei height); 325 GL_APICALL void BlitFramebufferNV(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 326 GL_APICALL void BlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 327 GLbitfield mask, GLenum filter); 328 GL_APICALL void TexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, 329 GLint border, GLenum format, GLenum type, const GLvoid* pixels); 330 GL_APICALL void TexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); 331 GL_APICALL void CopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); 332 GL_APICALL void CompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); 333 GL_APICALL void CompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); 334 GL_APICALL void FramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); 335 GL_APICALL void EGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image); 336 GL_APICALL void EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image); 337 GL_APICALL GLboolean IsRenderbufferOES(GLuint renderbuffer); 338 GL_APICALL void BindRenderbufferOES(GLenum target, GLuint renderbuffer); 339 GL_APICALL void DeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers); 340 GL_APICALL void GenRenderbuffersOES(GLsizei n, GLuint* renderbuffers); 341 GL_APICALL void RenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); 342 GL_APICALL void GetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params); 343 GL_APICALL GLboolean IsFramebufferOES(GLuint framebuffer); 344 GL_APICALL void BindFramebufferOES(GLenum target, GLuint framebuffer); 345 GL_APICALL void DeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers); 346 GL_APICALL void GenFramebuffersOES(GLsizei n, GLuint* framebuffers); 347 GL_APICALL GLenum CheckFramebufferStatusOES(GLenum target); 348 GL_APICALL void FramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); 349 GL_APICALL void FramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 350 GL_APICALL void GetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params); 351 GL_APICALL void GenerateMipmapOES(GLenum target); 352 GL_APICALL void DrawBuffersEXT(GLsizei n, const GLenum *bufs); 353 } 354 355 extern "C" 356 { 357 GL_APICALL void GL_APIENTRY glActiveTexture(GLenum texture) 358 { 359 return es2::ActiveTexture(texture); 360 } 361 362 GL_APICALL void GL_APIENTRY glAttachShader(GLuint program, GLuint shader) 363 { 364 return es2::AttachShader(program, shader); 365 } 366 367 GL_APICALL void GL_APIENTRY glBeginQueryEXT(GLenum target, GLuint name) 368 { 369 return es2::BeginQueryEXT(target, name); 370 } 371 372 GL_APICALL void GL_APIENTRY glBindAttribLocation(GLuint program, GLuint index, const GLchar* name) 373 { 374 return es2::BindAttribLocation(program, index, name); 375 } 376 377 GL_APICALL void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer) 378 { 379 return es2::BindBuffer(target, buffer); 380 } 381 382 GL_APICALL void GL_APIENTRY glBindFramebuffer(GLenum target, GLuint framebuffer) 383 { 384 return es2::BindFramebuffer(target, framebuffer); 385 } 386 387 GL_APICALL void GL_APIENTRY glBindFramebufferOES(GLenum target, GLuint framebuffer) 388 { 389 return es2::BindFramebuffer(target, framebuffer); 390 } 391 392 GL_APICALL void GL_APIENTRY glBindRenderbuffer(GLenum target, GLuint renderbuffer) 393 { 394 return es2::BindRenderbuffer(target, renderbuffer); 395 } 396 397 GL_APICALL void GL_APIENTRY glBindRenderbufferOES(GLenum target, GLuint renderbuffer) 398 { 399 return es2::BindRenderbuffer(target, renderbuffer); 400 } 401 402 GL_APICALL void GL_APIENTRY glBindTexture(GLenum target, GLuint texture) 403 { 404 return es2::BindTexture(target, texture); 405 } 406 407 GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 408 { 409 return es2::BlendColor(red, green, blue, alpha); 410 } 411 412 GL_APICALL void GL_APIENTRY glBlendEquation(GLenum mode) 413 { 414 return es2::BlendEquation(mode); 415 } 416 417 GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) 418 { 419 return es2::BlendEquationSeparate(modeRGB, modeAlpha); 420 } 421 422 GL_APICALL void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor) 423 { 424 return es2::BlendFunc(sfactor, dfactor); 425 } 426 427 GL_APICALL void GL_APIENTRY glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) 428 { 429 return es2::BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); 430 } 431 432 GL_APICALL void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) 433 { 434 return es2::BufferData(target, size, data, usage); 435 } 436 437 GL_APICALL void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) 438 { 439 return es2::BufferSubData(target, offset, size, data); 440 } 441 442 GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target) 443 { 444 return es2::CheckFramebufferStatus(target); 445 } 446 447 GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatusOES(GLenum target) 448 { 449 return es2::CheckFramebufferStatus(target); 450 } 451 452 GL_APICALL void GL_APIENTRY glClear(GLbitfield mask) 453 { 454 return es2::Clear(mask); 455 } 456 457 GL_APICALL void GL_APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 458 { 459 return es2::ClearColor(red, green, blue, alpha); 460 } 461 462 GL_APICALL void GL_APIENTRY glClearDepthf(GLclampf depth) 463 { 464 return es2::ClearDepthf(depth); 465 } 466 467 GL_APICALL void GL_APIENTRY glClearStencil(GLint s) 468 { 469 return es2::ClearStencil(s); 470 } 471 472 GL_APICALL void GL_APIENTRY glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) 473 { 474 return es2::ColorMask(red, green, blue, alpha); 475 } 476 477 GL_APICALL void GL_APIENTRY glCompileShader(GLuint shader) 478 { 479 return es2::CompileShader(shader); 480 } 481 482 GL_APICALL void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, 483 GLint border, GLsizei imageSize, const GLvoid* data) 484 { 485 return es2::CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); 486 } 487 488 GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 489 GLenum format, GLsizei imageSize, const GLvoid* data) 490 { 491 return es2::CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); 492 } 493 494 GL_APICALL void GL_APIENTRY glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) 495 { 496 return es2::CopyTexImage2D(target, level, internalformat, x, y, width, height, border); 497 } 498 499 GL_APICALL void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) 500 { 501 return es2::CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 502 } 503 504 GL_APICALL GLuint GL_APIENTRY glCreateProgram(void) 505 { 506 return es2::CreateProgram(); 507 } 508 509 GL_APICALL GLuint GL_APIENTRY glCreateShader(GLenum type) 510 { 511 return es2::CreateShader(type); 512 } 513 514 GL_APICALL void GL_APIENTRY glCullFace(GLenum mode) 515 { 516 return es2::CullFace(mode); 517 } 518 519 GL_APICALL void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint* buffers) 520 { 521 return es2::DeleteBuffers(n, buffers); 522 } 523 524 GL_APICALL void GL_APIENTRY glDeleteFencesNV(GLsizei n, const GLuint* fences) 525 { 526 return es2::DeleteFencesNV(n, fences); 527 } 528 529 GL_APICALL void GL_APIENTRY glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) 530 { 531 return es2::DeleteFramebuffers(n, framebuffers); 532 } 533 534 GL_APICALL void GL_APIENTRY glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) 535 { 536 return es2::DeleteFramebuffers(n, framebuffers); 537 } 538 539 GL_APICALL void GL_APIENTRY glDeleteProgram(GLuint program) 540 { 541 return es2::DeleteProgram(program); 542 } 543 544 GL_APICALL void GL_APIENTRY glDeleteQueriesEXT(GLsizei n, const GLuint *ids) 545 { 546 return es2::DeleteQueriesEXT(n, ids); 547 } 548 549 GL_APICALL void GL_APIENTRY glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) 550 { 551 return es2::DeleteRenderbuffers(n, renderbuffers); 552 } 553 554 GL_APICALL void GL_APIENTRY glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) 555 { 556 return es2::DeleteRenderbuffers(n, renderbuffers); 557 } 558 559 GL_APICALL void GL_APIENTRY glDeleteShader(GLuint shader) 560 { 561 return es2::DeleteShader(shader); 562 } 563 564 GL_APICALL void GL_APIENTRY glDeleteTextures(GLsizei n, const GLuint* textures) 565 { 566 return es2::DeleteTextures(n, textures); 567 } 568 569 GL_APICALL void GL_APIENTRY glDepthFunc(GLenum func) 570 { 571 return es2::DepthFunc(func); 572 } 573 574 GL_APICALL void GL_APIENTRY glDepthMask(GLboolean flag) 575 { 576 return es2::DepthMask(flag); 577 } 578 579 GL_APICALL void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar) 580 { 581 return es2::DepthRangef(zNear, zFar); 582 } 583 584 GL_APICALL void GL_APIENTRY glDetachShader(GLuint program, GLuint shader) 585 { 586 return es2::DetachShader(program, shader); 587 } 588 589 GL_APICALL void GL_APIENTRY glDisable(GLenum cap) 590 { 591 return es2::Disable(cap); 592 } 593 594 GL_APICALL void GL_APIENTRY glDisableVertexAttribArray(GLuint index) 595 { 596 return es2::DisableVertexAttribArray(index); 597 } 598 599 GL_APICALL void GL_APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) 600 { 601 return es2::DrawArrays(mode, first, count); 602 } 603 604 GL_APICALL void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) 605 { 606 return es2::DrawElements(mode, count, type, indices); 607 } 608 609 GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) 610 { 611 return es2::DrawArraysInstancedEXT(mode, first, count, instanceCount); 612 } 613 614 GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount) 615 { 616 return es2::DrawElementsInstancedEXT(mode, count, type, indices, instanceCount); 617 } 618 619 GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT(GLuint index, GLuint divisor) 620 { 621 return es2::VertexAttribDivisorEXT(index, divisor); 622 } 623 624 GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) 625 { 626 return es2::DrawArraysInstancedANGLE(mode, first, count, instanceCount); 627 } 628 629 GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount) 630 { 631 return es2::DrawElementsInstancedANGLE(mode, count, type, indices, instanceCount); 632 } 633 634 GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor) 635 { 636 return es2::VertexAttribDivisorANGLE(index, divisor); 637 } 638 639 GL_APICALL void GL_APIENTRY glEnable(GLenum cap) 640 { 641 return es2::Enable(cap); 642 } 643 644 GL_APICALL void GL_APIENTRY glEnableVertexAttribArray(GLuint index) 645 { 646 return es2::EnableVertexAttribArray(index); 647 } 648 649 GL_APICALL void GL_APIENTRY glEndQueryEXT(GLenum target) 650 { 651 return es2::EndQueryEXT(target); 652 } 653 654 GL_APICALL void GL_APIENTRY glFinishFenceNV(GLuint fence) 655 { 656 return es2::FinishFenceNV(fence); 657 } 658 659 GL_APICALL void GL_APIENTRY glFinish(void) 660 { 661 return es2::Finish(); 662 } 663 664 GL_APICALL void GL_APIENTRY glFlush(void) 665 { 666 return es2::Flush(); 667 } 668 669 GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) 670 { 671 return es2::FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); 672 } 673 674 GL_APICALL void GL_APIENTRY glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) 675 { 676 return es2::FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); 677 } 678 679 GL_APICALL void GL_APIENTRY glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 680 { 681 return es2::FramebufferTexture2D(target, attachment, textarget, texture, level); 682 } 683 684 GL_APICALL void GL_APIENTRY glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 685 { 686 return es2::FramebufferTexture2D(target, attachment, textarget, texture, level); 687 } 688 689 GL_APICALL void GL_APIENTRY glFrontFace(GLenum mode) 690 { 691 return es2::FrontFace(mode); 692 } 693 694 GL_APICALL void GL_APIENTRY glGenBuffers(GLsizei n, GLuint* buffers) 695 { 696 return es2::GenBuffers(n, buffers); 697 } 698 699 GL_APICALL void GL_APIENTRY glGenerateMipmap(GLenum target) 700 { 701 return es2::GenerateMipmap(target); 702 } 703 704 GL_APICALL void GL_APIENTRY glGenerateMipmapOES(GLenum target) 705 { 706 return es2::GenerateMipmap(target); 707 } 708 709 GL_APICALL void GL_APIENTRY glGenFencesNV(GLsizei n, GLuint* fences) 710 { 711 return es2::GenFencesNV(n, fences); 712 } 713 714 GL_APICALL void GL_APIENTRY glGenFramebuffers(GLsizei n, GLuint* framebuffers) 715 { 716 return es2::GenFramebuffers(n, framebuffers); 717 } 718 719 GL_APICALL void GL_APIENTRY glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) 720 { 721 return es2::GenFramebuffers(n, framebuffers); 722 } 723 724 GL_APICALL void GL_APIENTRY glGenQueriesEXT(GLsizei n, GLuint* ids) 725 { 726 return es2::GenQueriesEXT(n, ids); 727 } 728 729 GL_APICALL void GL_APIENTRY glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) 730 { 731 return es2::GenRenderbuffers(n, renderbuffers); 732 } 733 734 GL_APICALL void GL_APIENTRY glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) 735 { 736 return es2::GenRenderbuffers(n, renderbuffers); 737 } 738 739 GL_APICALL void GL_APIENTRY glGenTextures(GLsizei n, GLuint* textures) 740 { 741 return es2::GenTextures(n, textures); 742 } 743 744 GL_APICALL void GL_APIENTRY glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) 745 { 746 return es2::GetActiveAttrib(program, index, bufsize, length, size, type, name); 747 } 748 749 GL_APICALL void GL_APIENTRY glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) 750 { 751 return es2::GetActiveUniform(program, index, bufsize, length, size, type, name); 752 } 753 754 GL_APICALL void GL_APIENTRY glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) 755 { 756 return es2::GetAttachedShaders(program, maxcount, count, shaders); 757 } 758 759 GL_APICALL int GL_APIENTRY glGetAttribLocation(GLuint program, const GLchar* name) 760 { 761 return es2::GetAttribLocation(program, name); 762 } 763 764 GL_APICALL void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean* params) 765 { 766 return es2::GetBooleanv(pname, params); 767 } 768 769 GL_APICALL void GL_APIENTRY glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) 770 { 771 return es2::GetBufferParameteriv(target, pname, params); 772 } 773 774 GL_APICALL GLenum GL_APIENTRY glGetError(void) 775 { 776 return es2::GetError(); 777 } 778 779 GL_APICALL void GL_APIENTRY glGetFenceivNV(GLuint fence, GLenum pname, GLint *params) 780 { 781 return es2::GetFenceivNV(fence, pname, params); 782 } 783 784 GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params) 785 { 786 return es2::GetFloatv(pname, params); 787 } 788 789 GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) 790 { 791 return es2::GetFramebufferAttachmentParameteriv(target, attachment, pname, params); 792 } 793 794 GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params) 795 { 796 return es2::GetFramebufferAttachmentParameteriv(target, attachment, pname, params); 797 } 798 799 GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT(void) 800 { 801 return es2::GetGraphicsResetStatusEXT(); 802 } 803 804 GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params) 805 { 806 return es2::GetIntegerv(pname, params); 807 } 808 809 GL_APICALL void GL_APIENTRY glGetProgramiv(GLuint program, GLenum pname, GLint* params) 810 { 811 return es2::GetProgramiv(program, pname, params); 812 } 813 814 GL_APICALL void GL_APIENTRY glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) 815 { 816 return es2::GetProgramInfoLog(program, bufsize, length, infolog); 817 } 818 819 GL_APICALL void GL_APIENTRY glGetQueryivEXT(GLenum target, GLenum pname, GLint *params) 820 { 821 return es2::GetQueryivEXT(target, pname, params); 822 } 823 824 GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT(GLuint name, GLenum pname, GLuint *params) 825 { 826 return es2::GetQueryObjectuivEXT(name, pname, params); 827 } 828 829 GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) 830 { 831 return es2::GetRenderbufferParameteriv(target, pname, params); 832 } 833 834 GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params) 835 { 836 return es2::GetRenderbufferParameteriv(target, pname, params); 837 } 838 839 GL_APICALL void GL_APIENTRY glGetShaderiv(GLuint shader, GLenum pname, GLint* params) 840 { 841 return es2::GetShaderiv(shader, pname, params); 842 } 843 844 GL_APICALL void GL_APIENTRY glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) 845 { 846 return es2::GetShaderInfoLog(shader, bufsize, length, infolog); 847 } 848 849 GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) 850 { 851 return es2::GetShaderPrecisionFormat(shadertype, precisiontype, range, precision); 852 } 853 854 GL_APICALL void GL_APIENTRY glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) 855 { 856 return es2::GetShaderSource(shader, bufsize, length, source); 857 } 858 859 GL_APICALL const GLubyte* GL_APIENTRY glGetString(GLenum name) 860 { 861 return es2::GetString(name); 862 } 863 864 GL_APICALL void GL_APIENTRY glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) 865 { 866 return es2::GetTexParameterfv(target, pname, params); 867 } 868 869 GL_APICALL void GL_APIENTRY glGetTexParameteriv(GLenum target, GLenum pname, GLint* params) 870 { 871 return es2::GetTexParameteriv(target, pname, params); 872 } 873 874 GL_APICALL void GL_APIENTRY glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params) 875 { 876 return es2::GetnUniformfvEXT(program, location, bufSize, params); 877 } 878 879 GL_APICALL void GL_APIENTRY glGetUniformfv(GLuint program, GLint location, GLfloat* params) 880 { 881 return es2::GetUniformfv(program, location, params); 882 } 883 884 GL_APICALL void GL_APIENTRY glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params) 885 { 886 return es2::GetnUniformivEXT(program, location, bufSize, params); 887 } 888 889 GL_APICALL void GL_APIENTRY glGetUniformiv(GLuint program, GLint location, GLint* params) 890 { 891 return es2::GetUniformiv(program, location, params); 892 } 893 894 GL_APICALL int GL_APIENTRY glGetUniformLocation(GLuint program, const GLchar* name) 895 { 896 return es2::GetUniformLocation(program, name); 897 } 898 899 GL_APICALL void GL_APIENTRY glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) 900 { 901 return es2::GetVertexAttribfv(index, pname, params); 902 } 903 904 GL_APICALL void GL_APIENTRY glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) 905 { 906 return es2::GetVertexAttribiv(index, pname, params); 907 } 908 909 GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer) 910 { 911 return es2::GetVertexAttribPointerv(index, pname, pointer); 912 } 913 914 GL_APICALL void GL_APIENTRY glHint(GLenum target, GLenum mode) 915 { 916 return es2::Hint(target, mode); 917 } 918 919 GL_APICALL GLboolean GL_APIENTRY glIsBuffer(GLuint buffer) 920 { 921 return es2::IsBuffer(buffer); 922 } 923 924 GL_APICALL GLboolean GL_APIENTRY glIsEnabled(GLenum cap) 925 { 926 return es2::IsEnabled(cap); 927 } 928 929 GL_APICALL GLboolean GL_APIENTRY glIsFenceNV(GLuint fence) 930 { 931 return es2::IsFenceNV(fence); 932 } 933 934 GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer(GLuint framebuffer) 935 { 936 return es2::IsFramebuffer(framebuffer); 937 } 938 939 GL_APICALL GLboolean GL_APIENTRY glIsFramebufferOES(GLuint framebuffer) 940 { 941 return es2::IsFramebuffer(framebuffer); 942 } 943 944 GL_APICALL GLboolean GL_APIENTRY glIsProgram(GLuint program) 945 { 946 return es2::IsProgram(program); 947 } 948 949 GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT(GLuint name) 950 { 951 return es2::IsQueryEXT(name); 952 } 953 954 GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer(GLuint renderbuffer) 955 { 956 return es2::IsRenderbuffer(renderbuffer); 957 } 958 959 GL_APICALL GLboolean GL_APIENTRY glIsRenderbufferOES(GLuint renderbuffer) 960 { 961 return es2::IsRenderbuffer(renderbuffer); 962 } 963 964 GL_APICALL GLboolean GL_APIENTRY glIsShader(GLuint shader) 965 { 966 return es2::IsShader(shader); 967 } 968 969 GL_APICALL GLboolean GL_APIENTRY glIsTexture(GLuint texture) 970 { 971 return es2::IsTexture(texture); 972 } 973 974 GL_APICALL void GL_APIENTRY glLineWidth(GLfloat width) 975 { 976 return es2::LineWidth(width); 977 } 978 979 GL_APICALL void GL_APIENTRY glLinkProgram(GLuint program) 980 { 981 return es2::LinkProgram(program); 982 } 983 984 GL_APICALL void GL_APIENTRY glPixelStorei(GLenum pname, GLint param) 985 { 986 return es2::PixelStorei(pname, param); 987 } 988 989 GL_APICALL void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units) 990 { 991 return es2::PolygonOffset(factor, units); 992 } 993 994 GL_APICALL void GL_APIENTRY glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, 995 GLenum format, GLenum type, GLsizei bufSize, GLvoid *data) 996 { 997 return es2::ReadnPixelsEXT(x, y, width, height, format, type, bufSize, data); 998 } 999 1000 GL_APICALL void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) 1001 { 1002 return es2::ReadPixels(x, y, width, height, format, type, pixels); 1003 } 1004 1005 GL_APICALL void GL_APIENTRY glReleaseShaderCompiler(void) 1006 { 1007 return es2::ReleaseShaderCompiler(); 1008 } 1009 1010 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) 1011 { 1012 return es2::RenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height); 1013 } 1014 1015 GL_APICALL void GL_APIENTRY glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) 1016 { 1017 return es2::RenderbufferStorage(target, internalformat, width, height); 1018 } 1019 1020 GL_APICALL void GL_APIENTRY glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) 1021 { 1022 return es2::RenderbufferStorage(target, internalformat, width, height); 1023 } 1024 1025 GL_APICALL void GL_APIENTRY glSampleCoverage(GLclampf value, GLboolean invert) 1026 { 1027 return es2::SampleCoverage(value, invert); 1028 } 1029 1030 GL_APICALL void GL_APIENTRY glSetFenceNV(GLuint fence, GLenum condition) 1031 { 1032 return es2::SetFenceNV(fence, condition); 1033 } 1034 1035 GL_APICALL void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) 1036 { 1037 return es2::Scissor(x, y, width, height); 1038 } 1039 1040 GL_APICALL void GL_APIENTRY glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) 1041 { 1042 return es2::ShaderBinary(n, shaders, binaryformat, binary, length); 1043 } 1044 1045 GL_APICALL void GL_APIENTRY glShaderSource(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length) 1046 { 1047 return es2::ShaderSource(shader, count, string, length); 1048 } 1049 1050 GL_APICALL void GL_APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask) 1051 { 1052 return es2::StencilFunc(func, ref, mask); 1053 } 1054 1055 GL_APICALL void GL_APIENTRY glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) 1056 { 1057 return es2::StencilFuncSeparate(face, func, ref, mask); 1058 } 1059 1060 GL_APICALL void GL_APIENTRY glStencilMask(GLuint mask) 1061 { 1062 return es2::StencilMask(mask); 1063 } 1064 1065 GL_APICALL void GL_APIENTRY glStencilMaskSeparate(GLenum face, GLuint mask) 1066 { 1067 return es2::StencilMaskSeparate(face, mask); 1068 } 1069 1070 GL_APICALL void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) 1071 { 1072 return es2::StencilOp(fail, zfail, zpass); 1073 } 1074 1075 GL_APICALL void GL_APIENTRY glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) 1076 { 1077 return es2::StencilOpSeparate(face, fail, zfail, zpass); 1078 } 1079 1080 GLboolean GL_APIENTRY glTestFenceNV(GLuint fence) 1081 { 1082 return es2::TestFenceNV(fence); 1083 } 1084 1085 GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, 1086 GLint border, GLenum format, GLenum type, const GLvoid* pixels) 1087 { 1088 return es2::TexImage2D(target, level, internalformat, width, height, border, format, type, pixels); 1089 } 1090 1091 GL_APICALL void GL_APIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param) 1092 { 1093 return es2::TexParameterf(target, pname, param); 1094 } 1095 1096 GL_APICALL void GL_APIENTRY glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params) 1097 { 1098 return es2::TexParameterfv(target, pname, params); 1099 } 1100 1101 GL_APICALL void GL_APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) 1102 { 1103 return es2::TexParameteri(target, pname, param); 1104 } 1105 1106 GL_APICALL void GL_APIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint* params) 1107 { 1108 return es2::TexParameteriv(target, pname, params); 1109 } 1110 1111 GL_APICALL void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 1112 GLenum format, GLenum type, const GLvoid* pixels) 1113 { 1114 return es2::TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); 1115 } 1116 1117 GL_APICALL void GL_APIENTRY glUniform1f(GLint location, GLfloat x) 1118 { 1119 return es2::Uniform1f(location, x); 1120 } 1121 1122 GL_APICALL void GL_APIENTRY glUniform1fv(GLint location, GLsizei count, const GLfloat* v) 1123 { 1124 return es2::Uniform1fv(location, count, v); 1125 } 1126 1127 GL_APICALL void GL_APIENTRY glUniform1i(GLint location, GLint x) 1128 { 1129 return es2::Uniform1i(location, x); 1130 } 1131 1132 GL_APICALL void GL_APIENTRY glUniform1iv(GLint location, GLsizei count, const GLint* v) 1133 { 1134 return es2::Uniform1iv(location, count, v); 1135 } 1136 1137 GL_APICALL void GL_APIENTRY glUniform2f(GLint location, GLfloat x, GLfloat y) 1138 { 1139 return es2::Uniform2f(location, x, y); 1140 } 1141 1142 GL_APICALL void GL_APIENTRY glUniform2fv(GLint location, GLsizei count, const GLfloat* v) 1143 { 1144 return es2::Uniform2fv(location, count, v); 1145 } 1146 1147 GL_APICALL void GL_APIENTRY glUniform2i(GLint location, GLint x, GLint y) 1148 { 1149 return es2::Uniform2i(location, x, y); 1150 } 1151 1152 GL_APICALL void GL_APIENTRY glUniform2iv(GLint location, GLsizei count, const GLint* v) 1153 { 1154 return es2::Uniform2iv(location, count, v); 1155 } 1156 1157 GL_APICALL void GL_APIENTRY glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) 1158 { 1159 return es2::Uniform3f(location, x, y, z); 1160 } 1161 1162 GL_APICALL void GL_APIENTRY glUniform3fv(GLint location, GLsizei count, const GLfloat* v) 1163 { 1164 return es2::Uniform3fv(location, count, v); 1165 } 1166 1167 GL_APICALL void GL_APIENTRY glUniform3i(GLint location, GLint x, GLint y, GLint z) 1168 { 1169 return es2::Uniform3i(location, x, y, z); 1170 } 1171 1172 GL_APICALL void GL_APIENTRY glUniform3iv(GLint location, GLsizei count, const GLint* v) 1173 { 1174 return es2::Uniform3iv(location, count, v); 1175 } 1176 1177 GL_APICALL void GL_APIENTRY glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1178 { 1179 return es2::Uniform4f(location, x, y, z, w); 1180 } 1181 1182 GL_APICALL void GL_APIENTRY glUniform4fv(GLint location, GLsizei count, const GLfloat* v) 1183 { 1184 return es2::Uniform4fv(location, count, v); 1185 } 1186 1187 GL_APICALL void GL_APIENTRY glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) 1188 { 1189 return es2::Uniform4i(location, x, y, z, w); 1190 } 1191 1192 GL_APICALL void GL_APIENTRY glUniform4iv(GLint location, GLsizei count, const GLint* v) 1193 { 1194 return es2::Uniform4iv(location, count, v); 1195 } 1196 1197 GL_APICALL void GL_APIENTRY glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) 1198 { 1199 return es2::UniformMatrix2fv(location, count, transpose, value); 1200 } 1201 1202 GL_APICALL void GL_APIENTRY glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) 1203 { 1204 return es2::UniformMatrix3fv(location, count, transpose, value); 1205 } 1206 1207 GL_APICALL void GL_APIENTRY glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) 1208 { 1209 return es2::UniformMatrix4fv(location, count, transpose, value); 1210 } 1211 1212 GL_APICALL void GL_APIENTRY glUseProgram(GLuint program) 1213 { 1214 return es2::UseProgram(program); 1215 } 1216 1217 GL_APICALL void GL_APIENTRY glValidateProgram(GLuint program) 1218 { 1219 return es2::ValidateProgram(program); 1220 } 1221 1222 GL_APICALL void GL_APIENTRY glVertexAttrib1f(GLuint index, GLfloat x) 1223 { 1224 return es2::VertexAttrib1f(index, x); 1225 } 1226 1227 GL_APICALL void GL_APIENTRY glVertexAttrib1fv(GLuint index, const GLfloat* values) 1228 { 1229 return es2::VertexAttrib1fv(index, values); 1230 } 1231 1232 GL_APICALL void GL_APIENTRY glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y) 1233 { 1234 return es2::VertexAttrib2f(index, x, y); 1235 } 1236 1237 GL_APICALL void GL_APIENTRY glVertexAttrib2fv(GLuint index, const GLfloat* values) 1238 { 1239 return es2::VertexAttrib2fv(index, values); 1240 } 1241 1242 GL_APICALL void GL_APIENTRY glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) 1243 { 1244 return es2::VertexAttrib3f(index, x, y, z); 1245 } 1246 1247 GL_APICALL void GL_APIENTRY glVertexAttrib3fv(GLuint index, const GLfloat* values) 1248 { 1249 return es2::VertexAttrib3fv(index, values); 1250 } 1251 1252 GL_APICALL void GL_APIENTRY glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1253 { 1254 return es2::VertexAttrib4f(index, x, y, z, w); 1255 } 1256 1257 GL_APICALL void GL_APIENTRY glVertexAttrib4fv(GLuint index, const GLfloat* values) 1258 { 1259 return es2::VertexAttrib4fv(index, values); 1260 } 1261 1262 GL_APICALL void GL_APIENTRY glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) 1263 { 1264 return es2::VertexAttribPointer(index, size, type, normalized, stride, ptr); 1265 } 1266 1267 GL_APICALL void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height) 1268 { 1269 return es2::Viewport(x, y, width, height); 1270 } 1271 1272 GL_APICALL void GL_APIENTRY glBlitFramebufferNV(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) 1273 { 1274 return es2::BlitFramebufferNV(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 1275 } 1276 1277 GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 1278 GLbitfield mask, GLenum filter) 1279 { 1280 return es2::BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 1281 } 1282 1283 GL_APICALL void GL_APIENTRY glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, 1284 GLint border, GLenum format, GLenum type, const GLvoid* pixels) 1285 { 1286 return es2::TexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels); 1287 } 1288 1289 GL_APICALL void GL_APIENTRY glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) 1290 { 1291 return es2::TexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); 1292 } 1293 1294 GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) 1295 { 1296 return es2::CopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height); 1297 } 1298 1299 GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) 1300 { 1301 return es2::CompressedTexImage3DOES(target, level,internalformat, width, height, depth, border, imageSize, data); 1302 } 1303 1304 GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) 1305 { 1306 return es2::CompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); 1307 } 1308 1309 GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) 1310 { 1311 return es2::FramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset); 1312 } 1313 1314 GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) 1315 { 1316 return es2::EGLImageTargetTexture2DOES(target, image); 1317 } 1318 1319 GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) 1320 { 1321 return es2::EGLImageTargetRenderbufferStorageOES(target, image); 1322 } 1323 1324 GL_APICALL void GL_APIENTRY glDrawBuffersEXT(GLsizei n, const GLenum *bufs) 1325 { 1326 return es2::DrawBuffersEXT(n, bufs); 1327 } 1328 } 1329 1330 egl::Context *es2CreateContext(const egl::Config *config, const egl::Context *shareContext, int clientVersion); 1331 extern "C" __eglMustCastToProperFunctionPointerType es2GetProcAddress(const char *procname); 1332 egl::Image *createBackBuffer(int width, int height, const egl::Config *config); 1333 egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard); 1334 sw::FrameBuffer *createFrameBuffer(void *display, EGLNativeWindowType window, int width, int height); 1335 1336 LibGLESv2exports::LibGLESv2exports() 1337 { 1338 this->glActiveTexture = es2::ActiveTexture; 1339 this->glAttachShader = es2::AttachShader; 1340 this->glBeginQueryEXT = es2::BeginQueryEXT; 1341 this->glBindAttribLocation = es2::BindAttribLocation; 1342 this->glBindBuffer = es2::BindBuffer; 1343 this->glBindFramebuffer = es2::BindFramebuffer; 1344 this->glBindRenderbuffer = es2::BindRenderbuffer; 1345 this->glBindTexture = es2::BindTexture; 1346 this->glBlendColor = es2::BlendColor; 1347 this->glBlendEquation = es2::BlendEquation; 1348 this->glBlendEquationSeparate = es2::BlendEquationSeparate; 1349 this->glBlendFunc = es2::BlendFunc; 1350 this->glBlendFuncSeparate = es2::BlendFuncSeparate; 1351 this->glBufferData = es2::BufferData; 1352 this->glBufferSubData = es2::BufferSubData; 1353 this->glCheckFramebufferStatus = es2::CheckFramebufferStatus; 1354 this->glClear = es2::Clear; 1355 this->glClearColor = es2::ClearColor; 1356 this->glClearDepthf = es2::ClearDepthf; 1357 this->glClearStencil = es2::ClearStencil; 1358 this->glColorMask = es2::ColorMask; 1359 this->glCompileShader = es2::CompileShader; 1360 this->glCompressedTexImage2D = es2::CompressedTexImage2D; 1361 this->glCompressedTexSubImage2D = es2::CompressedTexSubImage2D; 1362 this->glCopyTexImage2D = es2::CopyTexImage2D; 1363 this->glCopyTexSubImage2D = es2::CopyTexSubImage2D; 1364 this->glCreateProgram = es2::CreateProgram; 1365 this->glCreateShader = es2::CreateShader; 1366 this->glCullFace = es2::CullFace; 1367 this->glDeleteBuffers = es2::DeleteBuffers; 1368 this->glDeleteFencesNV = es2::DeleteFencesNV; 1369 this->glDeleteFramebuffers = es2::DeleteFramebuffers; 1370 this->glDeleteProgram = es2::DeleteProgram; 1371 this->glDeleteQueriesEXT = es2::DeleteQueriesEXT; 1372 this->glDeleteRenderbuffers = es2::DeleteRenderbuffers; 1373 this->glDeleteShader = es2::DeleteShader; 1374 this->glDeleteTextures = es2::DeleteTextures; 1375 this->glDepthFunc = es2::DepthFunc; 1376 this->glDepthMask = es2::DepthMask; 1377 this->glDepthRangef = es2::DepthRangef; 1378 this->glDetachShader = es2::DetachShader; 1379 this->glDisable = es2::Disable; 1380 this->glDisableVertexAttribArray = es2::DisableVertexAttribArray; 1381 this->glDrawArrays = es2::DrawArrays; 1382 this->glDrawElements = es2::DrawElements; 1383 this->glDrawArraysInstancedEXT = es2::DrawArraysInstancedEXT; 1384 this->glDrawElementsInstancedEXT = es2::DrawElementsInstancedEXT; 1385 this->glVertexAttribDivisorEXT = es2::VertexAttribDivisorEXT; 1386 this->glDrawArraysInstancedANGLE = es2::DrawArraysInstancedANGLE; 1387 this->glDrawElementsInstancedANGLE = es2::DrawElementsInstancedANGLE; 1388 this->glVertexAttribDivisorANGLE = es2::VertexAttribDivisorANGLE; 1389 this->glEnable = es2::Enable; 1390 this->glEnableVertexAttribArray = es2::EnableVertexAttribArray; 1391 this->glEndQueryEXT = es2::EndQueryEXT; 1392 this->glFinishFenceNV = es2::FinishFenceNV; 1393 this->glFinish = es2::Finish; 1394 this->glFlush = es2::Flush; 1395 this->glFramebufferRenderbuffer = es2::FramebufferRenderbuffer; 1396 this->glFramebufferTexture2D = es2::FramebufferTexture2D; 1397 this->glFrontFace = es2::FrontFace; 1398 this->glGenBuffers = es2::GenBuffers; 1399 this->glGenerateMipmap = es2::GenerateMipmap; 1400 this->glGenFencesNV = es2::GenFencesNV; 1401 this->glGenFramebuffers = es2::GenFramebuffers; 1402 this->glGenQueriesEXT = es2::GenQueriesEXT; 1403 this->glGenRenderbuffers = es2::GenRenderbuffers; 1404 this->glGenTextures = es2::GenTextures; 1405 this->glGetActiveAttrib = es2::GetActiveAttrib; 1406 this->glGetActiveUniform = es2::GetActiveUniform; 1407 this->glGetAttachedShaders = es2::GetAttachedShaders; 1408 this->glGetAttribLocation = es2::GetAttribLocation; 1409 this->glGetBooleanv = es2::GetBooleanv; 1410 this->glGetBufferParameteriv = es2::GetBufferParameteriv; 1411 this->glGetError = es2::GetError; 1412 this->glGetFenceivNV = es2::GetFenceivNV; 1413 this->glGetFloatv = es2::GetFloatv; 1414 this->glGetFramebufferAttachmentParameteriv = es2::GetFramebufferAttachmentParameteriv; 1415 this->glGetGraphicsResetStatusEXT = es2::GetGraphicsResetStatusEXT; 1416 this->glGetIntegerv = es2::GetIntegerv; 1417 this->glGetProgramiv = es2::GetProgramiv; 1418 this->glGetProgramInfoLog = es2::GetProgramInfoLog; 1419 this->glGetQueryivEXT = es2::GetQueryivEXT; 1420 this->glGetQueryObjectuivEXT = es2::GetQueryObjectuivEXT; 1421 this->glGetRenderbufferParameteriv = es2::GetRenderbufferParameteriv; 1422 this->glGetShaderiv = es2::GetShaderiv; 1423 this->glGetShaderInfoLog = es2::GetShaderInfoLog; 1424 this->glGetShaderPrecisionFormat = es2::GetShaderPrecisionFormat; 1425 this->glGetShaderSource = es2::GetShaderSource; 1426 this->glGetString = es2::GetString; 1427 this->glGetTexParameterfv = es2::GetTexParameterfv; 1428 this->glGetTexParameteriv = es2::GetTexParameteriv; 1429 this->glGetnUniformfvEXT = es2::GetnUniformfvEXT; 1430 this->glGetUniformfv = es2::GetUniformfv; 1431 this->glGetnUniformivEXT = es2::GetnUniformivEXT; 1432 this->glGetUniformiv = es2::GetUniformiv; 1433 this->glGetUniformLocation = es2::GetUniformLocation; 1434 this->glGetVertexAttribfv = es2::GetVertexAttribfv; 1435 this->glGetVertexAttribiv = es2::GetVertexAttribiv; 1436 this->glGetVertexAttribPointerv = es2::GetVertexAttribPointerv; 1437 this->glHint = es2::Hint; 1438 this->glIsBuffer = es2::IsBuffer; 1439 this->glIsEnabled = es2::IsEnabled; 1440 this->glIsFenceNV = es2::IsFenceNV; 1441 this->glIsFramebuffer = es2::IsFramebuffer; 1442 this->glIsProgram = es2::IsProgram; 1443 this->glIsQueryEXT = es2::IsQueryEXT; 1444 this->glIsRenderbuffer = es2::IsRenderbuffer; 1445 this->glIsShader = es2::IsShader; 1446 this->glIsTexture = es2::IsTexture; 1447 this->glLineWidth = es2::LineWidth; 1448 this->glLinkProgram = es2::LinkProgram; 1449 this->glPixelStorei = es2::PixelStorei; 1450 this->glPolygonOffset = es2::PolygonOffset; 1451 this->glReadnPixelsEXT = es2::ReadnPixelsEXT; 1452 this->glReadPixels = es2::ReadPixels; 1453 this->glReleaseShaderCompiler = es2::ReleaseShaderCompiler; 1454 this->glRenderbufferStorageMultisampleANGLE = es2::RenderbufferStorageMultisampleANGLE; 1455 this->glRenderbufferStorage = es2::RenderbufferStorage; 1456 this->glSampleCoverage = es2::SampleCoverage; 1457 this->glSetFenceNV = es2::SetFenceNV; 1458 this->glScissor = es2::Scissor; 1459 this->glShaderBinary = es2::ShaderBinary; 1460 this->glShaderSource = es2::ShaderSource; 1461 this->glStencilFunc = es2::StencilFunc; 1462 this->glStencilFuncSeparate = es2::StencilFuncSeparate; 1463 this->glStencilMask = es2::StencilMask; 1464 this->glStencilMaskSeparate = es2::StencilMaskSeparate; 1465 this->glStencilOp = es2::StencilOp; 1466 this->glStencilOpSeparate = es2::StencilOpSeparate; 1467 this->glTestFenceNV = es2::TestFenceNV; 1468 this->glTexImage2D = es2::TexImage2D; 1469 this->glTexParameterf = es2::TexParameterf; 1470 this->glTexParameterfv = es2::TexParameterfv; 1471 this->glTexParameteri = es2::TexParameteri; 1472 this->glTexParameteriv = es2::TexParameteriv; 1473 this->glTexSubImage2D = es2::TexSubImage2D; 1474 this->glUniform1f = es2::Uniform1f; 1475 this->glUniform1fv = es2::Uniform1fv; 1476 this->glUniform1i = es2::Uniform1i; 1477 this->glUniform1iv = es2::Uniform1iv; 1478 this->glUniform2f = es2::Uniform2f; 1479 this->glUniform2fv = es2::Uniform2fv; 1480 this->glUniform2i = es2::Uniform2i; 1481 this->glUniform2iv = es2::Uniform2iv; 1482 this->glUniform3f = es2::Uniform3f; 1483 this->glUniform3fv = es2::Uniform3fv; 1484 this->glUniform3i = es2::Uniform3i; 1485 this->glUniform3iv = es2::Uniform3iv; 1486 this->glUniform4f = es2::Uniform4f; 1487 this->glUniform4fv = es2::Uniform4fv; 1488 this->glUniform4i = es2::Uniform4i; 1489 this->glUniform4iv = es2::Uniform4iv; 1490 this->glUniformMatrix2fv = es2::UniformMatrix2fv; 1491 this->glUniformMatrix3fv = es2::UniformMatrix3fv; 1492 this->glUniformMatrix4fv = es2::UniformMatrix4fv; 1493 this->glUseProgram = es2::UseProgram; 1494 this->glValidateProgram = es2::ValidateProgram; 1495 this->glVertexAttrib1f = es2::VertexAttrib1f; 1496 this->glVertexAttrib1fv = es2::VertexAttrib1fv; 1497 this->glVertexAttrib2f = es2::VertexAttrib2f; 1498 this->glVertexAttrib2fv = es2::VertexAttrib2fv; 1499 this->glVertexAttrib3f = es2::VertexAttrib3f; 1500 this->glVertexAttrib3fv = es2::VertexAttrib3fv; 1501 this->glVertexAttrib4f = es2::VertexAttrib4f; 1502 this->glVertexAttrib4fv = es2::VertexAttrib4fv; 1503 this->glVertexAttribPointer = es2::VertexAttribPointer; 1504 this->glViewport = es2::Viewport; 1505 this->glBlitFramebufferNV = es2::BlitFramebufferNV; 1506 this->glBlitFramebufferANGLE = es2::BlitFramebufferANGLE; 1507 this->glTexImage3DOES = es2::TexImage3DOES; 1508 this->glTexSubImage3DOES = es2::TexSubImage3DOES; 1509 this->glCopyTexSubImage3DOES = es2::CopyTexSubImage3DOES; 1510 this->glCompressedTexImage3DOES = es2::CompressedTexImage3DOES; 1511 this->glCompressedTexSubImage3DOES = es2::CompressedTexSubImage3DOES; 1512 this->glFramebufferTexture3DOES = es2::FramebufferTexture3DOES; 1513 this->glEGLImageTargetTexture2DOES = es2::EGLImageTargetTexture2DOES; 1514 this->glEGLImageTargetRenderbufferStorageOES = es2::EGLImageTargetRenderbufferStorageOES; 1515 this->glIsRenderbufferOES = es2::IsRenderbufferOES; 1516 this->glBindRenderbufferOES = es2::BindRenderbufferOES; 1517 this->glDeleteRenderbuffersOES = es2::DeleteRenderbuffersOES; 1518 this->glGenRenderbuffersOES = es2::GenRenderbuffersOES; 1519 this->glRenderbufferStorageOES = es2::RenderbufferStorageOES; 1520 this->glGetRenderbufferParameterivOES = es2::GetRenderbufferParameterivOES; 1521 this->glIsFramebufferOES = es2::IsFramebufferOES; 1522 this->glBindFramebufferOES = es2::BindFramebufferOES; 1523 this->glDeleteFramebuffersOES = es2::DeleteFramebuffersOES; 1524 this->glGenFramebuffersOES = es2::GenFramebuffersOES; 1525 this->glCheckFramebufferStatusOES = es2::CheckFramebufferStatusOES; 1526 this->glFramebufferRenderbufferOES = es2::FramebufferRenderbufferOES; 1527 this->glFramebufferTexture2DOES = es2::FramebufferTexture2DOES; 1528 this->glGetFramebufferAttachmentParameterivOES = es2::GetFramebufferAttachmentParameterivOES; 1529 this->glGenerateMipmapOES = es2::GenerateMipmapOES; 1530 this->glDrawBuffersEXT = es2::DrawBuffersEXT; 1531 1532 this->es2CreateContext = ::es2CreateContext; 1533 this->es2GetProcAddress = ::es2GetProcAddress; 1534 this->createBackBuffer = ::createBackBuffer; 1535 this->createDepthStencil = ::createDepthStencil; 1536 this->createFrameBuffer = ::createFrameBuffer; 1537 } 1538 1539 extern "C" GL_APICALL LibGLESv2exports *libGLESv2_swiftshader() 1540 { 1541 static LibGLESv2exports libGLESv2; 1542 return &libGLESv2; 1543 } 1544 1545 LibEGL libEGL; 1546 LibGLES_CM libGLES_CM;