diff options
Diffstat (limited to 'emulator/opengl/host/libs/Translator')
| -rw-r--r-- | emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp | 12 | ||||
| -rw-r--r-- | emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp index c96ba52..fe64f6f 100644 --- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -940,11 +940,19 @@ GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params){ } GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params){ + int destroyCtx = 0; GET_CTX(); + if (!ctx) { + ctx = createGLESContext(); + if (ctx) + destroyCtx = 1; + } if (ctx->glGetIntegerv(pname,params)) { - return; + if (destroyCtx) + deleteGLESContext(ctx); + return; } bool es2 = ctx->getCaps()->GL_ARB_ES2_COMPATIBILITY; @@ -1030,6 +1038,8 @@ GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params){ default: ctx->dispatcher().glGetIntegerv(pname,params); } + if (destroyCtx) + deleteGLESContext(ctx); } GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params){ diff --git a/emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp b/emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp index c0519c4..ba3edbe 100644 --- a/emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp +++ b/emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp @@ -677,6 +677,10 @@ bool GLEScontext::glGetIntegerv(GLenum pname, GLint *params) case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: *params = GL_RGBA; break; + + case GL_MAX_TEXTURE_SIZE: + *params = getMaxTexSize(); + break; default: return false; } |
