Changeset 673


Ignore:
Timestamp:
Feb 20, 2011, 1:03:07 PM (9 years ago)
Author:
sam
Message:

Put the OpenGL header handling in <lolgl.h> for more convenience.

Location:
trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r658 r673  
    7777AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
    7878
     79# Which version of OpenGL to use?
     80ac_cv_my_have_gl="no"
     81PKG_CHECK_MODULES(GLES1, glesv1_cm,
     82 [ac_cv_my_have_gl="yes"
     83  AC_DEFINE(HAVE_GLES_1X, 1, Define to 1 if GLES 1.x is available)
     84  GL_CFLAGS="${GLES1_CFLAGS}"
     85  GL_LIBS="${GLES1_LIBS}"],
     86 [:])
     87PKG_CHECK_MODULES(GLES2, glesv2,
     88 [ac_cv_my_have_gl="yes"
     89  AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
     90  GL_CFLAGS="${GLES2_CFLAGS}"
     91  GL_LIBS="${GLES2_LIBS}"],
     92 [:])
     93AC_CHECK_LIB(GL, glLoadIdentity,
     94 [ac_cv_my_have_gl="yes"
     95  AC_DEFINE(HAVE_GL_1X, 1, Define to 1 if GL 1.x is available)
     96  GL_LIBS="-lGL"]) # FIXME: hackish
     97if test "${ac_cv_my_have_gl}" = "no"; then
     98  AC_MSG_ERROR([[No OpenGL or OpenGL ES implementation found]])
     99fi
     100
    79101# Use SDL? (always required)
    80102ac_cv_my_have_sdl="yes"
     
    84106  SDL_LIBS="${SDL_LIBS} `sdl-config --libs`"
    85107fi
     108SDL_CFLAGS="${SDL_CFLAGS} ${GL_CFLAGS}"
     109SDL_LIBS="${SDL_LIBS} ${GL_LIBS}"
    86110PKG_CHECK_MODULES(SDL, sdl, [:],
    87111 [SDL_LIBS="${SDL_LIBS} -lSDL"])
    88 AC_CHECK_LIB(GL, glLoadIdentity, SDL_LIBS="${SDL_LIBS} -lGL") # FIXME: hackish
    89112PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:],
    90113 [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"])
    91114PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:],
    92115 [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"])
    93 save_CPPFLAGS="${CPPFLAGS}"
    94116SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
    95117SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
    96118
     119save_CPPFLAGS="${CPPFLAGS}"
    97120CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}"
    98121AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"])
  • trunk/src/Makefile.am

    r669 r673  
    55    core.h matrix.cpp matrix.h tiler.cpp tiler.h dict.cpp dict.h \
    66    audio.cpp audio.h scene.cpp scene.h font.cpp font.h layer.cpp layer.h \
    7     map.cpp map.h entity.cpp entity.h ticker.cpp ticker.h \
     7    map.cpp map.h entity.cpp entity.h ticker.cpp ticker.h lolgl.h \
    88    tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h \
    99    timer.cpp timer.h bitfield.h profiler.cpp profiler.h input.h input.cpp \
  • trunk/src/debugsphere.cpp

    r647 r673  
    1818#   include <windows.h>
    1919#endif
    20 #if defined __APPLE__ && defined __MACH__
    21 #   include <OpenGL/gl.h>
    22 #else
    23 #   define GL_GLEXT_PROTOTYPES
    24 #   include <GL/gl.h>
    25 #endif
    2620
    2721#include <cstdio>
     
    2923
    3024#include "core.h"
     25#include "lolgl.h"
    3126#include "debugsphere.h"
    3227
  • trunk/src/scene.cpp

    r672 r673  
    2121#   include <windows.h>
    2222#endif
    23 #if defined __APPLE__ && defined __MACH__
    24 #   include <OpenGL/gl.h>
    25 #else
    26 #   define GL_GLEXT_PROTOTYPES
    27 #   include <GL/gl.h>
    28 #endif
    2923
    3024#include "core.h"
     25#include "lolgl.h"
    3126
    3227struct Tile
  • trunk/src/shader.cpp

    r670 r673  
    2020#   include <windows.h>
    2121#endif
    22 #if defined __APPLE__ && defined __MACH__
    23 #   include <OpenGL/gl.h>
    24 #else
    25 #   define GL_GLEXT_PROTOTYPES
    26 #   include <GL/gl.h>
    27 #endif
    2822
    2923#include "core.h"
     24#include "lolgl.h"
    3025
    3126/*
  • trunk/src/tileset.cpp

    r664 r673  
    2020#   include <windows.h>
    2121#endif
    22 #if defined __APPLE__ && defined __MACH__
    23 #   include <OpenGL/gl.h>
    24 #else
    25 #   define GL_GLEXT_PROTOTYPES
    26 #   include <GL/gl.h>
    27 #endif
    2822
    2923#include <SDL.h>
     
    3125
    3226#include "core.h"
     27#include "lolgl.h"
    3328
    3429/*
  • trunk/src/video.cpp

    r668 r673  
    2020#   include <windows.h>
    2121#endif
    22 #if defined __APPLE__ && defined __MACH__
    23 #   include <OpenGL/gl.h>
    24 #else
    25 #   define GL_GLEXT_PROTOTYPES
    26 #   include <GL/gl.h>
    27 #endif
    2822
    2923#include "core.h"
     24#include "lolgl.h"
    3025
    3126#if LOL_EXPERIMENTAL
  • trunk/win32/deushax.vcxproj

    r669 r673  
    2929    <ClInclude Include="..\src\input.h" />
    3030    <ClInclude Include="..\src\layer.h" />
     31    <ClInclude Include="..\src\lolgl.h" />
    3132    <ClInclude Include="..\src\map.h" />
    3233    <ClInclude Include="..\src\matrix.h" />
  • trunk/win32/deushax.vcxproj.filters

    r669 r673  
    4949      <Filter>lolengine</Filter>
    5050    </ClInclude>
     51    <ClInclude Include="..\src\lolgl.h">
     52      <Filter>lolengine</Filter>
     53    </ClInclude>
    5154    <ClInclude Include="..\src\map.h">
    5255      <Filter>lolengine</Filter>
  • trunk/win32/editor.vcxproj

    r669 r673  
    2929    <ClInclude Include="..\src\input.h" />
    3030    <ClInclude Include="..\src\layer.h" />
     31    <ClInclude Include="..\src\lolgl.h" />
    3132    <ClInclude Include="..\src\map.h" />
    3233    <ClInclude Include="..\src\matrix.h" />
  • trunk/win32/editor.vcxproj.filters

    r669 r673  
    4949      <Filter>lolengine</Filter>
    5050    </ClInclude>
     51    <ClInclude Include="..\src\lolgl.h">
     52      <Filter>lolengine</Filter>
     53    </ClInclude>
    5154    <ClInclude Include="..\src\map.h">
    5255      <Filter>lolengine</Filter>
  • trunk/win32/monsterz.vcxproj

    r669 r673  
    3434    <ClInclude Include="..\src\input.h" />
    3535    <ClInclude Include="..\src\layer.h" />
     36    <ClInclude Include="..\src\lolgl.h" />
    3637    <ClInclude Include="..\src\map.h" />
    3738    <ClInclude Include="..\src\matrix.h" />
  • trunk/win32/monsterz.vcxproj.filters

    r669 r673  
    4949      <Filter>lolengine</Filter>
    5050    </ClInclude>
     51    <ClInclude Include="..\src\lolgl.h">
     52      <Filter>lolengine</Filter>
     53    </ClInclude>
    5154    <ClInclude Include="..\src\map.h">
    5255      <Filter>lolengine</Filter>
Note: See TracChangeset for help on using the changeset viewer.