From 02510db20af27829c5a094c6c979acbfbb7263ef Mon Sep 17 00:00:00 2001 From: XProger Date: Sun, 13 May 2018 17:27:42 +0300 Subject: [PATCH] #15 fix OGL ES platforms --- src/gapi_gl.h | 5 +++-- src/platform/android/app/src/main/cpp/main.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gapi_gl.h b/src/gapi_gl.h index fb1c29f..b4528b7 100644 --- a/src/gapi_gl.h +++ b/src/gapi_gl.h @@ -358,15 +358,16 @@ namespace GAPI { } char defines[1024]; - sprintf(defines, "#define PASS_%s\n", passNames[pass]); + defines[0] = 0; for (int i = 0; i < defCount; i++) { #ifdef _GAPI_GLES if (def[i] == SD_SHADOW_SAMPLER) - strcat(ext, "#extension GL_EXT_shadow_samplers : require\n"); + strcat(defines, "#extension GL_EXT_shadow_samplers : require\n"); // ACHTUNG! must be first in the list #endif sprintf(defines, "%s#define %s\n", defines, DefineName[def[i]]); } + sprintf(defines, "%s#define PASS_%s\n", defines, passNames[pass]); char fileName[255]; // generate shader file path diff --git a/src/platform/android/app/src/main/cpp/main.cpp b/src/platform/android/app/src/main/cpp/main.cpp index 80152ec..7e82ca0 100644 --- a/src/platform/android/app/src/main/cpp/main.cpp +++ b/src/platform/android/app/src/main/cpp/main.cpp @@ -65,7 +65,7 @@ JNI_METHOD(void, nativeInit)(JNIEnv* env, jobject obj, jstring contentDir, jstri strcat(Stream::cacheDir, str); env->ReleaseStringUTFChars(cacheDir, str); - glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&Core::defaultFBO); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&GAPI::defaultFBO); Game::init(); } @@ -78,7 +78,7 @@ JNI_METHOD(void, nativeReset)(JNIEnv* env) { } JNI_METHOD(void, nativeUpdate)(JNIEnv* env) { - glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&Core::defaultFBO); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&GAPI::defaultFBO); Game::update(); } @@ -88,7 +88,7 @@ JNI_METHOD(void, nativeFrameBegin)(JNIEnv* env) { } JNI_METHOD(void, nativeFrameEnd)(JNIEnv* env) { - Core::setBlending(bmNone); + Core::setBlendMode(bmNone); Core::validateRenderState(); Game::frameEnd(); @@ -101,7 +101,7 @@ JNI_METHOD(void, nativeFrameRender)(JNIEnv* env) { } JNI_METHOD(void, nativeResize)(JNIEnv* env, jobject obj, jint x, jint y, jint w, jint h) { - Core::viewportDef = vec4(float(x), float(y), float(w), float(h)); + Core::viewportDef = Viewport(x, y, w, h); Core::x = x; Core::y = y; Core::width = w;