1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-04-21 19:41:53 +02:00

fix android and GL ES3 shaders

This commit is contained in:
XProger 2020-02-02 14:04:42 +03:00
parent 576a7cda0d
commit e05c587681
2 changed files with 8 additions and 3 deletions

View File

@ -1317,11 +1317,15 @@ namespace GAPI {
char extHeader[256];
GLSL_HEADER_VERT[0] = GLSL_HEADER_FRAG[0] = extHeader[0] = 0;
if (_GL_OES_standard_derivatives) {
strcat(extHeader, "#extension GL_OES_standard_derivatives : enable\n");
if (!GLES3) {
strcat(extHeader, "#extension GL_OES_standard_derivatives : enable\n");
}
}
if (_GL_EXT_shadow_samplers && !_GL_ARB_shadow) {
strcat(extHeader, "#extension GL_EXT_shadow_samplers : enable\n");
if (!GLES3) {
strcat(extHeader, "#extension GL_EXT_shadow_samplers : enable\n");
}
strcat(extHeader, "#define USE_GL_EXT_shadow_samplers\n");
}
@ -1346,6 +1350,7 @@ namespace GAPI {
"#define texture2D texture\n"
"#define texture3D texture\n"
"#define textureCube texture\n"
"#define shadow2DEXT texture\n"
"out vec4 fragColor;\n");
} else {
// vertex

View File

@ -189,7 +189,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 = Viewport(x, y, w, h);
Core::viewportDef = short4(x, y, w, h);
Core::x = x;
Core::y = y;
Core::width = w;