Fix compilation errors

This commit is contained in:
UnknownShadow200 2021-10-30 15:33:53 +11:00
parent 542a6ff65d
commit 7b7fdbbeff
2 changed files with 22 additions and 19 deletions

View file

@ -469,7 +469,7 @@ static void APIENTRY fake_glBufferSubData(GLenum target, cc_uintptr offset, cc_u
Mem_Copy(buffer->data, data, size);
}
static void GL_CheckSupport(void) {
static void GLBackend_Init(void) {
static const struct DynamicLibSym coreVboFuncs[5] = {
DynamicLib_Sym2("glBindBuffer", glBindBuffer), DynamicLib_Sym2("glDeleteBuffers", glDeleteBuffers),
DynamicLib_Sym2("glGenBuffers", glGenBuffers), DynamicLib_Sym2("glBufferData", glBufferData),

View file

@ -1,14 +1,17 @@
#define _GL_TEXTURE_MAX_LEVEL 0x813D
#define _GL_BGRA_EXT 0x80E1
#define _GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
#if defined CC_BUILD_WEB || defined CC_BUILD_ANDROID
#define PIXEL_FORMAT GL_RGBA
#else
#define PIXEL_FORMAT GL_BGRA_EXT
#define PIXEL_FORMAT _GL_BGRA_EXT
#endif
#define _GL_TEXTURE_MAX_LEVEL 0x813D
#if defined CC_BIG_ENDIAN
/* Pixels are stored in memory as A,R,G,B but GL_UNSIGNED_BYTE will interpret as B,G,R,A */
/* So use GL_UNSIGNED_INT_8_8_8_8_REV instead to remedy this */
#define TRANSFER_FORMAT GL_UNSIGNED_INT_8_8_8_8_REV
#define TRANSFER_FORMAT _GL_UNSIGNED_INT_8_8_8_8_REV
#else
/* Pixels are stored in memory as B,G,R,A and GL_UNSIGNED_BYTE will interpret as B,G,R,A */
/* So fine to just use GL_UNSIGNED_BYTE here */