mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #4116
4116: Update GLEW r=def- a=Jupeyy If the glew mantainer merges his pr we can remove the ifdefs But we can also use it like this for now, then atleast our official build has no x11 calls ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
eaad036e28
|
@ -2025,6 +2025,10 @@ if(CLIENT)
|
||||||
target_compile_definitions(${TARGET_CLIENT} PRIVATE CONF_WAVPACK_CLOSE_FILE)
|
target_compile_definitions(${TARGET_CLIENT} PRIVATE CONF_WAVPACK_CLOSE_FILE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(GLEW_BUNDLED)
|
||||||
|
target_compile_definitions(${TARGET_CLIENT} PRIVATE CONF_GLEW_HAS_CONTEXT_INIT)
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND TARGETS_OWN ${TARGET_CLIENT})
|
list(APPEND TARGETS_OWN ${TARGET_CLIENT})
|
||||||
list(APPEND TARGETS_LINK ${TARGET_CLIENT})
|
list(APPEND TARGETS_LINK ${TARGET_CLIENT})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -301,7 +301,11 @@ static bool BackendInitGlew(EBackendType BackendType, int &GlewMajor, int &GlewM
|
||||||
#ifndef CONF_BACKEND_OPENGL_ES
|
#ifndef CONF_BACKEND_OPENGL_ES
|
||||||
//support graphic cards that are pretty old(and linux)
|
//support graphic cards that are pretty old(and linux)
|
||||||
glewExperimental = GL_TRUE;
|
glewExperimental = GL_TRUE;
|
||||||
|
#ifdef CONF_GLEW_HAS_CONTEXT_INIT
|
||||||
|
if(GLEW_OK != glewContextInit())
|
||||||
|
#else
|
||||||
if(GLEW_OK != glewInit())
|
if(GLEW_OK != glewInit())
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef GLEW_VERSION_4_6
|
#ifdef GLEW_VERSION_4_6
|
||||||
|
|
1
src/engine/external/glew/GL/glew.h
vendored
1
src/engine/external/glew/GL/glew.h
vendored
|
@ -23645,6 +23645,7 @@ VERSION_MICRO 0
|
||||||
|
|
||||||
/* API */
|
/* API */
|
||||||
GLEWAPI GLenum GLEWAPIENTRY glewInit (void);
|
GLEWAPI GLenum GLEWAPIENTRY glewInit (void);
|
||||||
|
GLEWAPI GLenum GLEWAPIENTRY glewContextInit (void);
|
||||||
GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name);
|
GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name);
|
||||||
#define glewIsExtensionSupported(x) glewIsSupported(x)
|
#define glewIsExtensionSupported(x) glewIsSupported(x)
|
||||||
|
|
||||||
|
|
2
src/engine/external/glew/glew.c
vendored
2
src/engine/external/glew/glew.c
vendored
|
@ -16156,7 +16156,7 @@ GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
|
||||||
typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name);
|
typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name);
|
||||||
typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
|
typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
|
||||||
|
|
||||||
static GLenum GLEWAPIENTRY glewContextInit ()
|
GLenum GLEWAPIENTRY glewContextInit ()
|
||||||
{
|
{
|
||||||
PFNGLGETSTRINGPROC getString;
|
PFNGLGETSTRINGPROC getString;
|
||||||
const GLubyte* s;
|
const GLubyte* s;
|
||||||
|
|
Loading…
Reference in a new issue