emulator 0x501

tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp – platform/development – Git at Google

Đang xem: Emulator 0x501

tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp – platform/development – Git at Google

Xem thêm: Red Switches In World 7 – How Do I Continue Once I Beat Level 7

rev-conf.org / platform / development / 3b7e5e3281ecdbd4e3aa9f8046a1afe8d021799b / . / tools / emulator / opengl / host / libs / Translator / GLES_V2 / GLESv2Imp.cpp

Xem thêm: Hướng Dẫn Cách Chơi Xì Dách !, Tăng Tỉ Lệ Thắng Lên 90% Khi Chơi Bài Xì Dách!

/* * Copyright(C) 2011 The rev-conf.org Open Source Project * * Licensed under the Apache License, Version 2.0(the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef _WIN32 #undef GL_APICALL #define GL_APICALL __declspec ( dllexport ) #endif #include <stdio.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <GLcommon/TranslatorIfaces.h> #include <GLcommon/ThreadInfo.h> #include "GLESv2Context.h" #include "GLESv2Validate.h" extern "C" static EGLiface * s_eglIface = NULL ; static GLESiface s_glesIface = ; #include <GLcommon/GLESmacros.h> extern "C" static GLEScontext * createGLESContext () static void deleteGLESContext ( GLEScontext * ctx ) static void setShareGroup ( GLEScontext * ctx , ShareGroupPtr grp ) } static __translatorMustCastToProperFunctionPointerType getProcAddress ( const char * procName ) GL_APICALL GLESiface * __translator_getIfaces ( EGLiface * eglIface ) } GL_APICALL void GL_APIENTRY glActiveTexture ( GLenum texture ) GL_APICALL void GL_APIENTRY glAttachShader ( GLuint program , GLuint shader ) } GL_APICALL void GL_APIENTRY glBindAttribLocation ( GLuint program , GLuint index , const GLchar * name ) } GL_APICALL void GL_APIENTRY glBindBuffer ( GLenum target , GLuint buffer ) ctx -> bindBuffer ( target , buffer ); GLESbuffer * vbo = ( GLESbuffer *) thrd -> shareGroup -> getObjectData ( VERTEXBUFFER , buffer ). Ptr (); vbo -> wasBinded (); } GL_APICALL void GL_APIENTRY glBindFramebuffer ( GLenum target , GLuint framebuffer ) } ctx -> dispatcher (). glBindFramebuffer ( target , globalFrameBufferName ); } GL_APICALL void GL_APIENTRY glBindRenderbuffer ( GLenum target , GLuint renderbuffer ) } ctx -> dispatcher (). glBindRenderbuffer ( target , globalRenderBufferName ); } GL_APICALL void GL_APIENTRY glBindTexture ( GLenum target , GLuint texture ) } ctx -> setBindedTexture ( globalTextureName ); ctx -> dispatcher (). glBindTexture ( target , globalTextureName ); } GL_APICALL void GL_APIENTRY glBlendColor ( GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha ) GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ) GL_APICALL void GL_APIENTRY glBlendEquationSeparate ( GLenum modeRGB , GLenum modeAlpha ) GL_APICALL void GL_APIENTRY glBlendFunc ( GLenum sfactor , GLenum dfactor ) GL_APICALL void GL_APIENTRY glBlendFuncSeparate ( GLenum srcRGB , GLenum dstRGB , GLenum srcAlpha , GLenum dstAlpha ) GL_APICALL void GL_APIENTRY glBufferData ( GLenum target , GLsizeiptr size , const GLvoid * data , GLenum usage ) GL_APICALL void GL_APIENTRY glBufferSubData ( GLenum target , GLintptr offset , GLsizeiptr size , const GLvoid * data ) GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus ( GLenum target ) GL_APICALL void GL_APIENTRY glClear ( GLbitfield mask ) GL_APICALL void GL_APIENTRY glClearColor ( GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha ) GL_APICALL void GL_APIENTRY glClearDepthf ( GLclampf depth ) GL_APICALL void GL_APIENTRY glClearStencil ( GLint s ) GL_APICALL void GL_APIENTRY glColorMask ( GLboolean red , GLboolean green , GLboolean blue , GLboolean alpha ) GL_APICALL void GL_APIENTRY glCompileShader ( GLuint shader ) } GL_APICALL void GL_APIENTRY glCompressedTexImage2D ( GLenum target , GLint level , GLenum internalformat , GLsizei width , GLsizei height , GLint border , GLsizei imageSize , const GLvoid * data ) GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D ( GLenum target , GLint level , GLint xoffset , GLint yoffset , GLsizei width , GLsizei height , GLenum format , GLsizei imageSize , const GLvoid * data ) GL_APICALL void GL_APIENTRY glCopyTexImage2D ( GLenum target , GLint level , GLenum internalformat , GLint x , GLint y , GLsizei width , GLsizei height , GLint border ) GL_APICALL void GL_APIENTRY glCopyTexSubImage2D ( GLenum target , GLint level , GLint xoffset , GLint yoffset , GLint x , GLint y , GLsizei width , GLsizei height ) GL_APICALL GLuint GL_APIENTRY glCreateProgram ( void ) if ( globalProgramName ) return 0 ; } GL_APICALL GLuint GL_APIENTRY glCreateShader ( GLenum type ) if ( globalShaderName ) return 0 ; } GL_APICALL void GL_APIENTRY glCullFace ( GLenum mode ) GL_APICALL void GL_APIENTRY glDeleteBuffers ( GLsizei n , const GLuint * buffers ) } } GL_APICALL void GL_APIENTRY glDeleteFramebuffers ( GLsizei n , const GLuint * framebuffers ) } } GL_APICALL void GL_APIENTRY glDeleteRenderbuffers ( GLsizei n , const GLuint * renderbuffers ) } } GL_APICALL void GL_APIENTRY glDeleteTextures ( GLsizei n , const GLuint * textures ) } } GL_APICALL void GL_APIENTRY glDeleteProgram ( GLuint program ) } GL_APICALL void GL_APIENTRY glDeleteShader ( GLuint shader ) } GL_APICALL void GL_APIENTRY glDepthFunc ( GLenum func ) GL_APICALL void GL_APIENTRY glDepthMask ( GLboolean flag ) GL_APICALL void GL_APIENTRY glDepthRangef ( GLclampf zNear , GLclampf zFar ) GL_APICALL void GL_APIENTRY glDetachShader ( GLuint program , GLuint shader ) } GL_APICALL void GL_APIENTRY glDisable ( GLenum cap ) GL_APICALL void GL_APIENTRY glDisableVertexAttribArray ( GLuint index ) GL_APICALL void GL_APIENTRY glDrawArrays ( GLenum mode , GLint first , GLsizei count ) GL_APICALL void GL_APIENTRY glDrawElements ( GLenum mode , GLsizei count , GLenum type , const GLvoid * elementsIndices ) //if no vertex are enabled no need to convert anything if (! ctx -> isArrEnabled ( 0 )) return ; GLESFloatArrays tmpArrs ; ctx -> convertArrs ( tmpArrs , 0 , count , type , indices , false ); ctx -> dispatcher (). glDrawElements ( mode , count , type , indices ); } GL_APICALL void GL_APIENTRY glEnable ( GLenum cap ) GL_APICALL void GL_APIENTRY glEnableVertexAttribArray ( GLuint index ) GL_APICALL void GL_APIENTRY glFinish ( void ) GL_APICALL void GL_APIENTRY glFlush ( void ) GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer ( GLenum target , GLenum attachment , GLenum renderbuffertarget , GLuint renderbuffer ) } GL_APICALL void GL_APIENTRY glFramebufferTexture2D ( GLenum target , GLenum attachment , GLenum textarget , GLuint texture , GLint level ) } GL_APICALL void GL_APIENTRY glFrontFace ( GLenum mode ) GL_APICALL void GL_APIENTRY glGenBuffers ( GLsizei n , GLuint * buffers ) } } GL_APICALL void GL_APIENTRY glGenerateMipmap ( GLenum target ) GL_APICALL void GL_APIENTRY glGenFramebuffers ( GLsizei n , GLuint * framebuffers ) } } GL_APICALL void GL_APIENTRY glGenRenderbuffers ( GLsizei n , GLuint * renderbuffers ) } } GL_APICALL void GL_APIENTRY glGenTextures ( GLsizei n , GLuint * textures ) } } GL_APICALL void GL_APIENTRY glGetActiveAttrib ( GLuint program , GLuint index , GLsizei bufsize , GLsizei * length , GLint * size , GLenum * type , GLchar * name ) } GL_APICALL void GL_APIENTRY glGetActiveUniform ( GLuint program , GLuint index , GLsizei bufsize , GLsizei * length , GLint * size , GLenum * type , GLchar * name ) } GL_APICALL void GL_APIENTRY glGetAttachedShaders ( GLuint program , GLsizei maxcount , GLsizei * count , GLuint * shaders ) } } GL_APICALL int GL_APIENTRY glGetAttribLocation ( GLuint program , const GLchar * name ) return – 1 ; } GL_APICALL void GL_APIENTRY glGetBooleanv ( GLenum pname , GLboolean * params ) GL_APICALL void GL_APIENTRY glGetBufferParameteriv ( GLenum target , GLenum pname , GLint * params ) } GL_APICALL GLenum GL_APIENTRY glGetError ( void ) return ctx -> dispatcher (). glGetError (); } GL_APICALL void GL_APIENTRY glGetFloatv ( GLenum pname , GLfloat * params ) GL_APICALL void GL_APIENTRY glGetIntegerv ( GLenum pname , GLint * params ) GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv ( GLenum target , GLenum attachment , GLenum pname , GLint * params ) GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv ( GLenum target , GLenum pname , GLint * params ) GL_APICALL void GL_APIENTRY glGetProgramiv ( GLuint program , GLenum pname , GLint * params ) } GL_APICALL void GL_APIENTRY glGetProgramInfoLog ( GLuint program , GLsizei bufsize , GLsizei * length , GLchar * infolog ) } GL_APICALL void GL_APIENTRY glGetShaderiv ( GLuint shader , GLenum pname , GLint * params ) } GL_APICALL void GL_APIENTRY glGetShaderInfoLog ( GLuint shader , GLsizei bufsize , GLsizei * length , GLchar * infolog ) } GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat ( GLenum shadertype , GLenum precisiontype , GLint * range , GLint * precision ) //TODO: may need to convert the source to fit to gles 2.0 shadders GL_APICALL void GL_APIENTRY glGetShaderSource ( GLuint shader , GLsizei bufsize , GLsizei * length , GLchar * source ) } GL_APICALL const GLubyte * GL_APIENTRY glGetString ( GLenum name ) } GL_APICALL void GL_APIENTRY glGetTexParameterfv ( GLenum target , GLenum pname , GLfloat * params ) GL_APICALL void GL_APIENTRY glGetTexParameteriv ( GLenum target , GLenum pname , GLint * params ) GL_APICALL void GL_APIENTRY glGetUniformfv ( GLuint program , GLint location , GLfloat * params ) } GL_APICALL void GL_APIENTRY glGetUniformiv ( GLuint program , GLint location , GLint * params ) } GL_APICALL int GL_APIENTRY glGetUniformLocation ( GLuint program , const GLchar * name ) return – 1 ; } GL_APICALL void GL_APIENTRY glGetVertexAttribfv ( GLuint index , GLenum pname , GLfloat * params ) } else } GL_APICALL void GL_APIENTRY glGetVertexAttribiv ( GLuint index , GLenum pname , GLint * params ) } else } GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv ( GLuint index , GLenum pname , GLvoid ** pointer ) else } GL_APICALL void GL_APIENTRY glHint ( GLenum target , GLenum mode ) GL_APICALL GLboolean GL_APIENTRY glIsEnabled ( GLenum cap ) GL_APICALL GLboolean GL_APIENTRY glIsBuffer ( GLuint buffer ) return GL_FALSE ; } GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer ( GLuint framebuffer ) return GL_FALSE ; } GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer ( GLuint renderbuffer ) return GL_FALSE ; } GL_APICALL GLboolean GL_APIENTRY glIsTexture ( GLuint texture ) return GL_FALSE ; } GL_APICALL GLboolean GL_APIENTRY glIsProgram ( GLuint program ) return GL_FALSE ; } GL_APICALL GLboolean GL_APIENTRY glIsShader ( GLuint shader ) return GL_FALSE ; } GL_APICALL void GL_APIENTRY glLineWidth ( GLfloat width ) GL_APICALL void GL_APIENTRY glLinkProgram ( GLuint program ) } GL_APICALL void GL_APIENTRY glPixelStorei ( GLenum pname , GLint param ) GL_APICALL void GL_APIENTRY glPolygonOffset ( GLfloat factor , GLfloat units ) GL_APICALL void GL_APIENTRY glReadPixels ( GLint x , GLint y , GLsizei width , GLsizei height , GLenum format , GLenum type , GLvoid * pixels ) GL_APICALL void GL_APIENTRY glReleaseShaderCompiler ( void ) GL_APICALL void GL_APIENTRY glRenderbufferStorage ( GLenum target , GLenum internalformat , GLsizei width , GLsizei height ) GL_APICALL void GL_APIENTRY glSampleCoverage ( GLclampf value , GLboolean invert ) GL_APICALL void GL_APIENTRY glScissor ( GLint x , GLint y , GLsizei width , GLsizei height ) GL_APICALL void GL_APIENTRY glShaderBinary ( GLsizei n , const GLuint * shaders , GLenum binaryformat , const GLvoid * binary , GLsizei length ) } } //TODO: may need to change the source to match to GL shaders format GL_APICALL void GL_APIENTRY glShaderSource ( GLuint shader , GLsizei count , const GLchar ** string , const GLint * length ) } GL_APICALL void GL_APIENTRY glStencilFunc ( GLenum func , GLint ref , GLuint mask ) GL_APICALL void GL_APIENTRY glStencilFuncSeparate ( GLenum face , GLenum func , GLint ref , GLuint mask ) GL_APICALL void GL_APIENTRY glStencilMask ( GLuint mask ) GL_APICALL void GL_APIENTRY glStencilMaskSeparate ( GLenum face , GLuint mask ) GL_APICALL void GL_APIENTRY glStencilOp ( GLenum fail , GLenum zfail , GLenum zpass ) GL_APICALL void GL_APIENTRY glStencilOpSeparate ( GLenum face , GLenum fail , GLenum zfail , GLenum zpass ) static TextureData * getTextureData () else return texData ; } GL_APICALL void GL_APIENTRY glTexImage2D ( GLenum target , GLint level , GLint internalformat , GLsizei width , GLsizei height , GLint border , GLenum format , GLenum type , const GLvoid * pixels ) } ctx -> dispatcher (). glTexImage2D ( target , level , internalformat , width , height , border , format , type , pixels ); } GL_APICALL void GL_APIENTRY glTexParameterf ( GLenum target , GLenum pname , GLfloat param ) GL_APICALL void GL_APIENTRY glTexParameterfv ( GLenum target , GLenum pname , const GLfloat * params ) GL_APICALL void GL_APIENTRY glTexParameteri ( GLenum target , GLenum pname , GLint param ) GL_APICALL void GL_APIENTRY glTexParameteriv ( GLenum target , GLenum pname , const GLint * params ) GL_APICALL void GL_APIENTRY glTexSubImage2D ( GLenum target , GLint level , GLint xoffset , GLint yoffset , GLsizei width , GLsizei height , GLenum format , GLenum type , const GLvoid * pixels ) GL_APICALL void GL_APIENTRY glUniform1f ( GLint location , GLfloat x ) GL_APICALL void GL_APIENTRY glUniform1fv ( GLint location , GLsizei count , const GLfloat * v ) GL_APICALL void GL_APIENTRY glUniform1i ( GLint location , GLint x ) GL_APICALL void GL_APIENTRY glUniform1iv ( GLint location , GLsizei count , const GLint * v ) GL_APICALL void GL_APIENTRY glUniform2f ( GLint location , GLfloat x , GLfloat y ) GL_APICALL void GL_APIENTRY glUniform2fv ( GLint location , GLsizei count , const GLfloat * v ) GL_APICALL void GL_APIENTRY glUniform2i ( GLint location , GLint x , GLint y ) GL_APICALL void GL_APIENTRY glUniform2iv ( GLint location , GLsizei count , const GLint * v ) GL_APICALL void GL_APIENTRY glUniform3f ( GLint location , GLfloat x , GLfloat y , GLfloat z ) GL_APICALL void GL_APIENTRY glUniform3fv ( GLint location , GLsizei count , const GLfloat * v ) GL_APICALL void GL_APIENTRY glUniform3i ( GLint location , GLint x , GLint y , GLint z ) GL_APICALL void GL_APIENTRY glUniform3iv ( GLint location , GLsizei count , const GLint * v ) GL_APICALL void GL_APIENTRY glUniform4f ( GLint location , GLfloat x , GLfloat y , GLfloat z , GLfloat w ) GL_APICALL void GL_APIENTRY glUniform4fv ( GLint location , GLsizei count , const GLfloat * v ) GL_APICALL void GL_APIENTRY glUniform4i ( GLint location , GLint x , GLint y , GLint z , GLint w ) GL_APICALL void GL_APIENTRY glUniform4iv ( GLint location , GLsizei count , const GLint * v ) GL_APICALL void GL_APIENTRY glUniformMatrix2fv ( GLint location , GLsizei count , GLboolean transpose , const GLfloat * value ) GL_APICALL void GL_APIENTRY glUniformMatrix3fv ( GLint location , GLsizei count , GLboolean transpose , const GLfloat * value ) GL_APICALL void GL_APIENTRY glUniformMatrix4fv ( GLint location , GLsizei count , GLboolean transpose , const GLfloat * value ) GL_APICALL void GL_APIENTRY glUseProgram ( GLuint program ) } GL_APICALL void GL_APIENTRY glValidateProgram ( GLuint program ) } GL_APICALL void GL_APIENTRY glVertexAttrib1f ( GLuint indx , GLfloat x ) GL_APICALL void GL_APIENTRY glVertexAttrib1fv ( GLuint indx , const GLfloat * values ) GL_APICALL void GL_APIENTRY glVertexAttrib2f ( GLuint indx , GLfloat x , GLfloat y ) GL_APICALL void GL_APIENTRY glVertexAttrib2fv ( GLuint indx , const GLfloat * values ) GL_APICALL void GL_APIENTRY glVertexAttrib3f ( GLuint indx , GLfloat x , GLfloat y , GLfloat z ) GL_APICALL void GL_APIENTRY glVertexAttrib3fv ( GLuint indx , const GLfloat * values ) GL_APICALL void GL_APIENTRY glVertexAttrib4f ( GLuint indx , GLfloat x , GLfloat y , GLfloat z , GLfloat w ) GL_APICALL void GL_APIENTRY glVertexAttrib4fv ( GLuint indx , const GLfloat * values ) GL_APICALL void GL_APIENTRY glVertexAttribPointer ( GLuint indx , GLint size , GLenum type , GLboolean normalized , GLsizei stride , const GLvoid * ptr ) GL_APICALL void GL_APIENTRY glViewport ( GLint x , GLint y , GLsizei width , GLsizei height )

Leave a comment

Your email address will not be published. Required fields are marked *