Changeset 1647


Ignore:
Timestamp:
Jul 18, 2012, 10:27:34 PM (7 years ago)
Author:
sam
Message:

build: hide the SDL_main.h inclusion in core.h, and only activate it
on Windows if using Visual Studio; if using MinGW, try to stick to the
original main() entry point.

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r1643 r1647  
    124124
    125125
     126dnl  Are we building using MinGW?
     127LIBS_save="$LIBS"
     128LIBS="$LIBS -mwindows"
     129AC_MSG_CHECKING(for -mwindows)
     130AC_TRY_LINK([], [],
     131 [AC_MSG_RESULT(yes)
     132  LOL_LIBS="${LOL_LIBS} -mwindows"],
     133 [AC_MSG_RESULT(no)])
     134LIBS="$LIBS_save"
     135
     136
    126137dnl  Are we on the Xbox 360?
    127138dnl  Answer: NO! we don't know how to build for it anyway
     
    143154AC_MSG_CHECKING(for -framework OpenGL)
    144155AC_TRY_LINK([], [],
    145  [ac_cv_my_have_cocoa="yes"
    146   AC_MSG_RESULT(yes)
     156 [AC_MSG_RESULT(yes)
    147157  GL_LIBS="${GL_LIBS} -framework OpenGL"
    148158  CXXFLAGS="${CXXFLAGS} -ObjC++"],
  • trunk/games/ToukyDemo/ToukyDemo.cpp

    r1645 r1647  
    2828#else
    2929#   include <cmath>
    30 #endif
    31 
    32 #if USE_SDL
    33 #   include <SDL_main.h>
    3430#endif
    3531
  • trunk/src/core.h

    r1535 r1647  
    6262#endif
    6363
    64 /* If using NaCl, override main with our version */
     64/* If using NaCl, override main() with our version */
    6565#if defined __native_client__
    6666#   define main lol_nacl_main
     67#endif
     68
     69/* If using SDL and Visual Studio, let it override main() */
     70#if defined _MSVC && defined USE_SDL
     71#   include <SDL_main.h>
    6772#endif
    6873
  • trunk/test/BtPhysTest.cpp

    r1645 r1647  
    2929#endif
    3030
    31 #if USE_SDL
    32 #   include <SDL_main.h>
    33 #endif
    34 
    3531#include "core.h"
    3632#include "loldebug.h"
  • trunk/test/benchsuite.cpp

    r1645 r1647  
    1414
    1515#include <cstdio>
    16 
    17 #if USE_SDL
    18 #   include <SDL_main.h>
    19 #endif
    2016
    2117#include "core.h"
  • trunk/test/debug/quad.cpp

    r1645 r1647  
    2020using namespace lol;
    2121
    22 #if USE_SDL
    23 #   include <SDL_main.h>
    24 #endif
    25 
    2622int main(int argc, char **argv)
    2723{
  • trunk/test/math/pi.cpp

    r1645 r1647  
    1414
    1515#include <cstdio>
    16 
    17 #if USE_SDL
    18 #   include <SDL_main.h>
    19 #endif
    2016
    2117#include "core.h"
  • trunk/test/math/poly.cpp

    r1645 r1647  
    1414
    1515#include <cstdio>
    16 
    17 #if USE_SDL
    18 #   include <SDL_main.h>
    19 #endif
    2016
    2117#include "core.h"
  • trunk/test/math/remez.cpp

    r1645 r1647  
    1111#if defined HAVE_CONFIG_H
    1212#   include "config.h"
    13 #endif
    14 
    15 #if USE_SDL
    16 #   include <SDL_main.h>
    1713#endif
    1814
  • trunk/test/sandbox/sample.cpp

    r1645 r1647  
    1111#if defined HAVE_CONFIG_H
    1212#   include "config.h"
    13 #endif
    14 
    15 #if USE_SDL
    16 #   include <SDL_main.h>
    1713#endif
    1814
  • trunk/test/testsuite.cpp

    r1645 r1647  
    1616#include <cstdlib>
    1717
    18 #if USE_SDL
    19 #   include <SDL_main.h>
    20 #endif
    21 
    2218#include <lol/unit.h>
    2319
  • trunk/test/xolotl/xolotl.cpp

    r1645 r1647  
    1919
    2020using namespace lol;
    21 
    22 #if USE_SDL
    23 #   include <SDL_main.h>
    24 #endif
    2521
    2622#include "xolotl.h"
  • trunk/tools/neercs/neercs.cpp

    r1645 r1647  
    2626#else
    2727#   include <cmath>
    28 #endif
    29 
    30 #if USE_SDL
    31 #   include <SDL_main.h>
    3228#endif
    3329
  • trunk/tutorial/01_triangle.cpp

    r1645 r1647  
    1818using namespace std;
    1919using namespace lol;
    20 
    21 #if USE_SDL
    22 #   include <SDL_main.h>
    23 #endif
    2420
    2521#if defined _WIN32
  • trunk/tutorial/02_cube.cpp

    r1645 r1647  
    1818using namespace std;
    1919using namespace lol;
    20 
    21 #if USE_SDL
    22 #   include <SDL_main.h>
    23 #endif
    2420
    2521#if defined _WIN32
  • trunk/tutorial/05_easymesh.cpp

    r1645 r1647  
    1717using namespace std;
    1818using namespace lol;
    19 
    20 #if USE_SDL
    21 #   include <SDL_main.h>
    22 #endif
    2319
    2420class EasyMeshTutorial : public WorldEntity
  • trunk/tutorial/08_fbo.cpp

    r1645 r1647  
    1818using namespace std;
    1919using namespace lol;
    20 
    21 #if USE_SDL
    22 #   include <SDL_main.h>
    23 #endif
    2420
    2521#if defined _WIN32
  • trunk/tutorial/11_fractal.cpp

    r1645 r1647  
    2121using namespace lol;
    2222
    23 #if defined _WIN32 && defined USE_D3D9
    24 #   define FAR
    25 #   define NEAR
    26 #   include <d3d9.h>
    27 #endif
    28 
    29 #if USE_SDL
    30 #   include <SDL_main.h>
    31 #endif
    32 
    3323#if defined _WIN32
    3424#   include <direct.h>
     25#   if defined USE_D3D9
     26#       define FAR
     27#       define NEAR
     28#       include <d3d9.h>
     29#   endif
    3530#endif
    3631
Note: See TracChangeset for help on using the changeset viewer.