Merge pull request #151 from Wargus/tim/travis-build

Fix Travis Build
This commit is contained in:
Tim Felgentreff 2015-11-24 17:46:23 +01:00
commit 9968d614e1
4 changed files with 33 additions and 12 deletions

View file

@ -1,9 +1,11 @@
language: cpp
compiler:
- gcc
- clang
sudo: required
# compiler:
# - gcc
# - clang
os:
- linux
- osx
addons:
apt:
packages:
@ -15,7 +17,15 @@ addons:
- zlib1g-dev
- libpng12-dev
before_script:
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install libtolua++5.1-dev; fi
- "if [ $TRAVIS_OS_NAME == osx ]; then brew install lua51 sdl; \
git clone https://github.com/LuaDist/toluapp.git; \
cd toluapp; mkdir build;
cd build; cmake ..; make && sudo make install; \
cd ..;
cd ..;
fi"
- mkdir build
- cd build
- cmake ..
script: cd build && make
script: make

View file

@ -1122,7 +1122,7 @@ if(WIN32 AND MINGW AND ENABLE_STATIC)
endif()
if(APPLE)
set_target_properties(stratagus PROPERTIES LINK_FLAGS "${LINK_FLAGS} -framework libpng -lSDLmain")
set_target_properties(stratagus PROPERTIES LINK_FLAGS "${LINK_FLAGS} -lSDLmain")
endif()
########### next target ###############

View file

@ -40,6 +40,9 @@
#endif
#ifdef USE_OPENGL
#ifdef __APPLE__
#define GL_GLEXT_PROTOTYPES 1
#endif
#include "SDL_opengl.h"
#include "shaders.h"
#endif
@ -531,7 +534,7 @@ extern void FreeGraphics();
// ARB_texture_compression
#ifdef USE_OPENGL
#if defined(USE_OPENGL) && !defined(__APPLE__)
extern PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glCompressedTexImage3DARB;
extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
extern PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glCompressedTexImage1DARB;

View file

@ -319,7 +319,7 @@ const char* fragment_shaders[MAX_SHADERS] = {
}"
};
#ifndef __APPLE__
PFNGLCREATESHADERPROC glCreateShader;
PFNGLSHADERSOURCEPROC glShaderSource;
PFNGLCOMPILESHADERPROC glCompileShader;
@ -338,10 +338,6 @@ PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
PFNGLACTIVETEXTUREPROC glActiveTextureProc;
PFNGLUNIFORM1FPROC glUniform1f;
PFNGLUNIFORM1IPROC glUniform1i;
GLuint fullscreenShader;
GLuint fullscreenFramebuffer = 0;
GLuint fullscreenTexture;
PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffers;
PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebuffer;
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture;
@ -351,6 +347,17 @@ PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorage;
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbuffer;
PFNGLDRAWBUFFERSPROC glDrawBuffers;
PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatus;
#else
#define glGenFramebuffers glGenFramebuffersEXT
#define glBindFramebuffer glBindFramebufferEXT
#define glCheckFramebufferStatus glCheckFramebufferStatusEXT
#define glActiveTextureProc glActiveTexture
#define glFramebufferTexture glFramebufferTexture2DEXT
#endif
GLuint fullscreenShader;
GLuint fullscreenFramebuffer = 0;
GLuint fullscreenTexture;
void printShaderInfoLog(GLuint obj, const char* prefix)
{
@ -411,6 +418,7 @@ extern void LoadShaders() {
}
extern bool LoadShaderExtensions() {
#ifndef __APPLE__
glCreateShader = (PFNGLCREATESHADERPROC)(uintptr_t)SDL_GL_GetProcAddress("glCreateShader");
glShaderSource = (PFNGLSHADERSOURCEPROC)(uintptr_t)SDL_GL_GetProcAddress("glShaderSource");
glCompileShader = (PFNGLCOMPILESHADERPROC)(uintptr_t)SDL_GL_GetProcAddress("glCompileShader");
@ -440,7 +448,7 @@ extern bool LoadShaderExtensions() {
glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(uintptr_t)SDL_GL_GetProcAddress("glFramebufferRenderbuffer");
glDrawBuffers = (PFNGLDRAWBUFFERSPROC)(uintptr_t)SDL_GL_GetProcAddress("glDrawBuffers");
glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(uintptr_t)SDL_GL_GetProcAddress("glCheckFramebufferStatus");
#endif
if (glCreateShader && glGenFramebuffers && glGetUniformLocation && glActiveTextureProc) {
LoadShaders();
return true;