fix desktop modern opengl build

This commit is contained in:
UnknownShadow200 2019-04-09 13:45:54 +10:00
parent 5495faa800
commit 69e59db629
2 changed files with 9 additions and 1 deletions

View file

@ -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."

View file

@ -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);