@@ -76,6 +76,28 @@ CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Ws | |||||
AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") | AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") | ||||
# Which version of OpenGL to use? | |||||
ac_cv_my_have_gl="no" | |||||
PKG_CHECK_MODULES(GLES1, glesv1_cm, | |||||
[ac_cv_my_have_gl="yes" | |||||
AC_DEFINE(HAVE_GLES_1X, 1, Define to 1 if GLES 1.x is available) | |||||
GL_CFLAGS="${GLES1_CFLAGS}" | |||||
GL_LIBS="${GLES1_LIBS}"], | |||||
[:]) | |||||
PKG_CHECK_MODULES(GLES2, glesv2, | |||||
[ac_cv_my_have_gl="yes" | |||||
AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) | |||||
GL_CFLAGS="${GLES2_CFLAGS}" | |||||
GL_LIBS="${GLES2_LIBS}"], | |||||
[:]) | |||||
AC_CHECK_LIB(GL, glLoadIdentity, | |||||
[ac_cv_my_have_gl="yes" | |||||
AC_DEFINE(HAVE_GL_1X, 1, Define to 1 if GL 1.x is available) | |||||
GL_LIBS="-lGL"]) # FIXME: hackish | |||||
if test "${ac_cv_my_have_gl}" = "no"; then | |||||
AC_MSG_ERROR([[No OpenGL or OpenGL ES implementation found]]) | |||||
fi | |||||
# Use SDL? (always required) | # Use SDL? (always required) | ||||
ac_cv_my_have_sdl="yes" | ac_cv_my_have_sdl="yes" | ||||
AC_PATH_PROG(SDL_CONFIG, sdl-config, no) | AC_PATH_PROG(SDL_CONFIG, sdl-config, no) | ||||
@@ -83,17 +105,18 @@ if test "${SDL_CONFIG}" != "no"; then | |||||
SDL_CFLAGS="${SDL_CFLAGS} `sdl-config --cflags`" | SDL_CFLAGS="${SDL_CFLAGS} `sdl-config --cflags`" | ||||
SDL_LIBS="${SDL_LIBS} `sdl-config --libs`" | SDL_LIBS="${SDL_LIBS} `sdl-config --libs`" | ||||
fi | fi | ||||
SDL_CFLAGS="${SDL_CFLAGS} ${GL_CFLAGS}" | |||||
SDL_LIBS="${SDL_LIBS} ${GL_LIBS}" | |||||
PKG_CHECK_MODULES(SDL, sdl, [:], | PKG_CHECK_MODULES(SDL, sdl, [:], | ||||
[SDL_LIBS="${SDL_LIBS} -lSDL"]) | [SDL_LIBS="${SDL_LIBS} -lSDL"]) | ||||
AC_CHECK_LIB(GL, glLoadIdentity, SDL_LIBS="${SDL_LIBS} -lGL") # FIXME: hackish | |||||
PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:], | PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:], | ||||
[SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"]) | [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"]) | ||||
PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:], | PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:], | ||||
[SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"]) | [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"]) | ||||
save_CPPFLAGS="${CPPFLAGS}" | |||||
SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" | SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" | ||||
SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" | SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" | ||||
save_CPPFLAGS="${CPPFLAGS}" | |||||
CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}" | CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}" | ||||
AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"]) | AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"]) | ||||
AC_CHECK_HEADERS(SDL_image.h, [:], [ac_cv_my_have_sdl="no"]) | AC_CHECK_HEADERS(SDL_image.h, [:], [ac_cv_my_have_sdl="no"]) | ||||
@@ -4,7 +4,7 @@ noinst_LIBRARIES = liblol.a | |||||
liblol_a_SOURCES = \ | liblol_a_SOURCES = \ | ||||
core.h matrix.cpp matrix.h tiler.cpp tiler.h dict.cpp dict.h \ | core.h matrix.cpp matrix.h tiler.cpp tiler.h dict.cpp dict.h \ | ||||
audio.cpp audio.h scene.cpp scene.h font.cpp font.h layer.cpp layer.h \ | audio.cpp audio.h scene.cpp scene.h font.cpp font.h layer.cpp layer.h \ | ||||
map.cpp map.h entity.cpp entity.h ticker.cpp ticker.h \ | |||||
map.cpp map.h entity.cpp entity.h ticker.cpp ticker.h lolgl.h \ | |||||
tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h \ | tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h \ | ||||
timer.cpp timer.h bitfield.h profiler.cpp profiler.h input.h input.cpp \ | timer.cpp timer.h bitfield.h profiler.cpp profiler.h input.h input.cpp \ | ||||
world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \ | world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \ | ||||
@@ -17,17 +17,12 @@ | |||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
#else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
#endif | |||||
#include <cstdio> | #include <cstdio> | ||||
#include <cmath> | #include <cmath> | ||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | |||||
#include "debugsphere.h" | #include "debugsphere.h" | ||||
/* | /* | ||||
@@ -0,0 +1,33 @@ | |||||
// | |||||
// Lol Engine | |||||
// | |||||
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net> | |||||
// This program is free software; you can redistribute it and/or | |||||
// modify it under the terms of the Do What The Fuck You Want To | |||||
// Public License, Version 2, as published by Sam Hocevar. See | |||||
// http://sam.zoy.org/projects/COPYING.WTFPL for more details. | |||||
// | |||||
// | |||||
// The GL support | |||||
// -------------- | |||||
// | |||||
#if !defined __DH_LOLGL_H__ | |||||
#define __DH_LOLGL_H__ | |||||
#if defined HAVE_GL_1X | |||||
# if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
# else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
# endif | |||||
#elif defined HAVE_GLES_1X | |||||
# include <GLES/gl.h> | |||||
#elif defined HAVE_GLES_2X | |||||
# include <GLES2/gl.h> | |||||
#endif | |||||
#endif // __DH_LOLGL_H__ | |||||
@@ -20,14 +20,9 @@ | |||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
#else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
#endif | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | |||||
struct Tile | struct Tile | ||||
{ | { | ||||
@@ -19,14 +19,9 @@ | |||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
#else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
#endif | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | |||||
/* | /* | ||||
* Shader implementation class | * Shader implementation class | ||||
@@ -19,17 +19,12 @@ | |||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
#else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
#endif | |||||
#include <SDL.h> | #include <SDL.h> | ||||
#include <SDL_image.h> | #include <SDL_image.h> | ||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | |||||
/* | /* | ||||
* TileSet implementation class | * TileSet implementation class | ||||
@@ -19,14 +19,9 @@ | |||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#if defined __APPLE__ && defined __MACH__ | |||||
# include <OpenGL/gl.h> | |||||
#else | |||||
# define GL_GLEXT_PROTOTYPES | |||||
# include <GL/gl.h> | |||||
#endif | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | |||||
#if LOL_EXPERIMENTAL | #if LOL_EXPERIMENTAL | ||||
Shader *stdshader; | Shader *stdshader; | ||||
@@ -28,6 +28,7 @@ | |||||
<ClInclude Include="..\src\hash.h" /> | <ClInclude Include="..\src\hash.h" /> | ||||
<ClInclude Include="..\src\input.h" /> | <ClInclude Include="..\src\input.h" /> | ||||
<ClInclude Include="..\src\layer.h" /> | <ClInclude Include="..\src\layer.h" /> | ||||
<ClInclude Include="..\src\lolgl.h" /> | |||||
<ClInclude Include="..\src\map.h" /> | <ClInclude Include="..\src\map.h" /> | ||||
<ClInclude Include="..\src\matrix.h" /> | <ClInclude Include="..\src\matrix.h" /> | ||||
<ClInclude Include="..\src\numeric.h" /> | <ClInclude Include="..\src\numeric.h" /> | ||||
@@ -48,6 +48,9 @@ | |||||
<ClInclude Include="..\src\layer.h"> | <ClInclude Include="..\src\layer.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lolgl.h"> | |||||
<Filter>lolengine</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="..\src\map.h"> | <ClInclude Include="..\src\map.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
@@ -28,6 +28,7 @@ | |||||
<ClInclude Include="..\src\hash.h" /> | <ClInclude Include="..\src\hash.h" /> | ||||
<ClInclude Include="..\src\input.h" /> | <ClInclude Include="..\src\input.h" /> | ||||
<ClInclude Include="..\src\layer.h" /> | <ClInclude Include="..\src\layer.h" /> | ||||
<ClInclude Include="..\src\lolgl.h" /> | |||||
<ClInclude Include="..\src\map.h" /> | <ClInclude Include="..\src\map.h" /> | ||||
<ClInclude Include="..\src\matrix.h" /> | <ClInclude Include="..\src\matrix.h" /> | ||||
<ClInclude Include="..\src\numeric.h" /> | <ClInclude Include="..\src\numeric.h" /> | ||||
@@ -48,6 +48,9 @@ | |||||
<ClInclude Include="..\src\layer.h"> | <ClInclude Include="..\src\layer.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lolgl.h"> | |||||
<Filter>lolengine</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="..\src\map.h"> | <ClInclude Include="..\src\map.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
@@ -33,6 +33,7 @@ | |||||
<ClInclude Include="..\src\hash.h" /> | <ClInclude Include="..\src\hash.h" /> | ||||
<ClInclude Include="..\src\input.h" /> | <ClInclude Include="..\src\input.h" /> | ||||
<ClInclude Include="..\src\layer.h" /> | <ClInclude Include="..\src\layer.h" /> | ||||
<ClInclude Include="..\src\lolgl.h" /> | |||||
<ClInclude Include="..\src\map.h" /> | <ClInclude Include="..\src\map.h" /> | ||||
<ClInclude Include="..\src\matrix.h" /> | <ClInclude Include="..\src\matrix.h" /> | ||||
<ClInclude Include="..\src\numeric.h" /> | <ClInclude Include="..\src\numeric.h" /> | ||||
@@ -48,6 +48,9 @@ | |||||
<ClInclude Include="..\src\layer.h"> | <ClInclude Include="..\src\layer.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lolgl.h"> | |||||
<Filter>lolengine</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="..\src\map.h"> | <ClInclude Include="..\src\map.h"> | ||||
<Filter>lolengine</Filter> | <Filter>lolengine</Filter> | ||||
</ClInclude> | </ClInclude> | ||||