From 69e59db6294415f515df76e0fe51f9bd9f45985a Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 9 Apr 2019 13:45:54 +1000 Subject: [PATCH] fix desktop modern opengl build --- src/Core.h | 1 + src/Graphics.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Core.h b/src/Core.h index f5e0c23a8..eaaa46dfc 100644 --- a/src/Core.h +++ b/src/Core.h @@ -133,6 +133,7 @@ typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec; #define CC_BUILD_WEB #define CC_BUILD_POSIX #define CC_BUILD_GLMODERN +#define CC_BUILD_GLES #define CC_BUILD_WEBCANVAS #define CC_BUILD_WEBGL #error "Web backend is still a WIP. Please do not publicly mention it, thanks." diff --git a/src/Graphics.c b/src/Graphics.c index dc2408299..90066c87d 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -1399,7 +1399,9 @@ static void Gfx_GenFragmentShader(const struct GLShader* shader, String* dst) { int fd = shader->Features & FTR_DENSIT_FOG; int fm = shader->Features & FTR_HASANY_FOG; +#ifdef CC_BUILD_GLES String_AppendConst(dst, "precision highp float;\n"); +#endif String_AppendConst(dst, "varying vec4 out_col;\n"); if (uv) String_AppendConst(dst, "varying vec2 out_uv;\n"); if (uv) String_AppendConst(dst, "uniform sampler2D texImage;\n"); @@ -1613,7 +1615,12 @@ void Gfx_LoadIdentityMatrix(MatrixType type) { } } -static void GL_CheckSupport(void) { } +static void GL_CheckSupport(void) { +#ifndef CC_BUILD_GLES + Gfx.CustomMipmapsLevels = true; +#endif +} + static void GL_InitState(void) { glEnableVertexAttribArray(0); glEnableVertexAttribArray(1);