mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-05-12 03:53:52 +00:00
fix MSVC OpenGL linkage warnings & mingw linker problems. use SDL.lib also for MinGW.
This commit is contained in:
parent
6df593975f
commit
827e8f2a4b
7 changed files with 14 additions and 52 deletions
|
@ -1797,7 +1797,7 @@ void Core::setSDLGLAttributes()
|
||||||
#define GLAPIENTRY
|
#define GLAPIENTRY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BBGE_BUILD_OPENGL_DYNAMIC
|
#ifdef BBGE_BUILD_OPENGL_DYNAMIC
|
||||||
#define GL_FUNC(ret,fn,params,call,rt) \
|
#define GL_FUNC(ret,fn,params,call,rt) \
|
||||||
extern "C" { \
|
extern "C" { \
|
||||||
static ret (GLAPIENTRY *p##fn) params = NULL; \
|
static ret (GLAPIENTRY *p##fn) params = NULL; \
|
||||||
|
|
|
@ -32,9 +32,7 @@ GLuint emptyTexture() // Create An Empty Texture
|
||||||
|
|
||||||
// Create Storage Space For Texture Data (128x128x4)
|
// Create Storage Space For Texture Data (128x128x4)
|
||||||
data = (unsigned int*)new GLuint[((quality * quality)* 4 * sizeof(unsigned int))];
|
data = (unsigned int*)new GLuint[((quality * quality)* 4 * sizeof(unsigned int))];
|
||||||
#ifdef BBGE_BUILD_WINDOWS
|
memset(data, 0, ((quality * quality)* 4 * sizeof(unsigned int))); // Clear Storage Memory
|
||||||
ZeroMemory(data,((quality * quality)* 4 * sizeof(unsigned int))); // Clear Storage Memory
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glGenTextures(1, &txtnumber); // Create 1 Texture
|
glGenTextures(1, &txtnumber); // Create 1 Texture
|
||||||
|
|
13
BBGE/GL/gl.h
13
BBGE/GL/gl.h
|
@ -35,9 +35,18 @@ extern "C" {
|
||||||
#define APIENTRY
|
#define APIENTRY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
// BBGE HACK:
|
||||||
|
// Because Win32 uses __declspec(dllimport) for OpenGL function imports,
|
||||||
|
// although Core.cpp defines its own functions using the same names, which are just accessing
|
||||||
|
// OpenGL function pointers acquired elsewhere, this leads to inconsistent linkage between
|
||||||
|
// declaration in gl.h and the actual function definition in Core.cpp.
|
||||||
|
// So, we use this little hack to disable external linkage globally.
|
||||||
|
#undef WINGDIAPI
|
||||||
|
#define WINGDIAPI extern
|
||||||
|
|
||||||
|
/*#ifndef WIN32
|
||||||
#define WINGDIAPI
|
#define WINGDIAPI
|
||||||
#endif
|
#endif*/
|
||||||
|
|
||||||
#ifndef GLAPI
|
#ifndef GLAPI
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
|
|
|
@ -138,11 +138,7 @@ if (NOT SDL_FOUND)
|
||||||
set(SDLDIR "${EXTLIBDIR}/SDL12")
|
set(SDLDIR "${EXTLIBDIR}/SDL12")
|
||||||
set(SDL_INCLUDE_DIR "${SDLDIR}/include" CACHE PATH "SDL include directory" FORCE)
|
set(SDL_INCLUDE_DIR "${SDLDIR}/include" CACHE PATH "SDL include directory" FORCE)
|
||||||
message(STATUS "Using internal copy of SDL")
|
message(STATUS "Using internal copy of SDL")
|
||||||
if(MSVC)
|
|
||||||
set(SDL_LIBRARY "${SDLDIR}/lib/win32/SDL.lib" CACHE PATH "Where the SDL library can be found")
|
set(SDL_LIBRARY "${SDLDIR}/lib/win32/SDL.lib" CACHE PATH "Where the SDL library can be found")
|
||||||
else(MSVC)
|
|
||||||
set(SDL_LIBRARY "${SDLDIR}/lib/win32/libSDL.dll.a" CACHE PATH "Where the SDL library can be found")
|
|
||||||
endif(MSVC)
|
|
||||||
else(MACOSX)
|
else(MACOSX)
|
||||||
message(SEND_ERROR "We don't have a prebuilt SDL for this platform.")
|
message(SEND_ERROR "We don't have a prebuilt SDL for this platform.")
|
||||||
endif(MACOSX)
|
endif(MACOSX)
|
||||||
|
|
Binary file not shown.
|
@ -1,41 +0,0 @@
|
||||||
# libSDL.la - a libtool library file
|
|
||||||
# Generated by ltmain.sh (GNU libtool) 2.2.6
|
|
||||||
#
|
|
||||||
# Please DO NOT delete this file!
|
|
||||||
# It is necessary for linking the library.
|
|
||||||
|
|
||||||
# The name that we can dlopen(3).
|
|
||||||
dlname='../bin/SDL.dll'
|
|
||||||
|
|
||||||
# Names of this library.
|
|
||||||
library_names='libSDL.dll.a'
|
|
||||||
|
|
||||||
# The name of the static archive.
|
|
||||||
old_library='libSDL.a'
|
|
||||||
|
|
||||||
# Linker flags that can not go in dependency_libs.
|
|
||||||
inherited_linker_flags=''
|
|
||||||
|
|
||||||
# Libraries that this one depends upon.
|
|
||||||
dependency_libs=' -luser32 -lgdi32 -lwinmm -ldxguid'
|
|
||||||
|
|
||||||
# Names of additional weak libraries provided by this library
|
|
||||||
weak_library_names=''
|
|
||||||
|
|
||||||
# Version information for libSDL.
|
|
||||||
current=11
|
|
||||||
age=11
|
|
||||||
revision=3
|
|
||||||
|
|
||||||
# Is this an already installed library?
|
|
||||||
installed=yes
|
|
||||||
|
|
||||||
# Should we warn about portability when linking against -modules?
|
|
||||||
shouldnotlink=no
|
|
||||||
|
|
||||||
# Files to dlopen/dlpreopen
|
|
||||||
dlopen=''
|
|
||||||
dlpreopen=''
|
|
||||||
|
|
||||||
# Directory that this library needs to be installed in:
|
|
||||||
libdir='/usr/local/lib'
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue