aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp12
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/GLEScontext.cpp4
-rw-r--r--emulator/opengl/host/tools/emugen/getopt.c6
-rw-r--r--emulator/opengl/host/tools/emugen/getopt.h2
4 files changed, 19 insertions, 5 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;
}
diff --git a/emulator/opengl/host/tools/emugen/getopt.c b/emulator/opengl/host/tools/emugen/getopt.c
index 0ac02d8..3523538 100644
--- a/emulator/opengl/host/tools/emugen/getopt.c
+++ b/emulator/opengl/host/tools/emugen/getopt.c
@@ -8,7 +8,7 @@
int opterr = 1;
int optind = 1;
int optopt = 0;
-const char* optarg;
+char* optarg;
int getopt(int argc, char* const argv[], const char* ostr) {
static const char kEmpty[] = "";
@@ -57,9 +57,9 @@ int getopt(int argc, char* const argv[], const char* ostr) {
// This option needs an argument. Either after the option character,
// or the argument that follows.
if (*place) {
- optarg = place;
+ optarg = (char *)place;
} else if (argc > ++optind) {
- optarg = argv[optind];
+ optarg = (char *)argv[optind];
} else if (oindex[2] == ':') {
// Optional argument is missing.
place = kEmpty;
diff --git a/emulator/opengl/host/tools/emugen/getopt.h b/emulator/opengl/host/tools/emugen/getopt.h
index 5ad039c..cc04850 100644
--- a/emulator/opengl/host/tools/emugen/getopt.h
+++ b/emulator/opengl/host/tools/emugen/getopt.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
extern int optind;
-extern const char* optarg;
+extern char* optarg;
extern int optopt;
int getopt(int argc, char* const argv[], const char* ostr);