Skip to content

Commit

Permalink
fix desktop modern opengl build
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Apr 9, 2019
1 parent 5495faa commit 69e59db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Core.h
Expand Up @@ -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."
Expand Down
9 changes: 8 additions & 1 deletion src/Graphics.c
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 69e59db

Please sign in to comment.