mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-24 21:41:23 +00:00
Fix dedicated server for Windows
* the OpenAL function definitions mustn't include __declspec(dllimport) => fixed by pretending to compile OpenAL statically * glimp.cpp shouldn't be used in dedicated-only mode (as it was already the case on Linux and OSX) => No special handling for ID_DEDICATED needed in glimp.cpp, as it's not used anyway * add APIENTRY to every gl function in stub_gl.cpp for compatibility with windows headers and MSVC * remove GL/gl.h #include from win_local.h as it's not needed * in qgl.h, when building dedicated server for windows, redefine WINGDIAPI to nothing for SDL_opengl.h #include to get rid off __declspec(dllimport) by using #pragma push_macro and pop_macro, because our stub is no dll. Fixes https://github.com/dhewm/dhewm3/issues/39
This commit is contained in:
parent
ed1ffa8060
commit
4fc06760aa
2 changed files with 18 additions and 1 deletions
|
@ -693,7 +693,6 @@ elseif(WIN32)
|
||||||
set(src_sys_base
|
set(src_sys_base
|
||||||
sys/cpu.cpp
|
sys/cpu.cpp
|
||||||
sys/threads.cpp
|
sys/threads.cpp
|
||||||
sys/glimp.cpp
|
|
||||||
sys/events.cpp
|
sys/events.cpp
|
||||||
sys/sys_local.cpp
|
sys/sys_local.cpp
|
||||||
sys/win32/win_input.cpp
|
sys/win32/win_input.cpp
|
||||||
|
@ -705,6 +704,7 @@ elseif(WIN32)
|
||||||
)
|
)
|
||||||
|
|
||||||
set(src_sys_core
|
set(src_sys_core
|
||||||
|
sys/glimp.cpp
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(src_sys_base
|
set(src_sys_base
|
||||||
|
|
|
@ -32,8 +32,25 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
#ifndef __QGL_H__
|
#ifndef __QGL_H__
|
||||||
#define __QGL_H__
|
#define __QGL_H__
|
||||||
|
|
||||||
|
#if defined( ID_DEDICATED ) && defined( _WIN32 )
|
||||||
|
// to allow stubbing gl on windows, define WINGDIAPI to nothing - it would otherwise be
|
||||||
|
// extended to __declspec(dllimport) on MSVC (our stub is no dll.)
|
||||||
|
#ifdef WINGDIAPI
|
||||||
|
#pragma push_macro("WINGDIAPI")
|
||||||
|
#undef WINGDIAPI
|
||||||
|
#define WINGDIAPI
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
|
|
||||||
|
#if defined( ID_DEDICATED ) && defined( _WIN32 )
|
||||||
|
// restore WINGDIAPI
|
||||||
|
#ifdef WINGDIAPI
|
||||||
|
#pragma pop_macro("WINGDIAPI")
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (*GLExtension_t)(void);
|
typedef void (*GLExtension_t)(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in a new issue