Bladeren bron

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.
legacy
Sam Hocevar sam 13 jaren geleden
bovenliggende
commit
5bd24fa1d3
16 gewijzigde bestanden met toevoegingen van 23 en 65 verwijderingen
  1. +12
    -2
      configure.ac
  2. +6
    -1
      src/core.h
  3. +0
    -4
      test/BtPhysTest.cpp
  4. +0
    -4
      test/benchsuite.cpp
  5. +0
    -4
      test/debug/quad.cpp
  6. +0
    -4
      test/math/pi.cpp
  7. +0
    -4
      test/math/poly.cpp
  8. +0
    -4
      test/math/remez.cpp
  9. +0
    -4
      test/sandbox/sample.cpp
  10. +0
    -4
      test/testsuite.cpp
  11. +0
    -4
      test/xolotl/xolotl.cpp
  12. +0
    -4
      tutorial/01_triangle.cpp
  13. +0
    -4
      tutorial/02_cube.cpp
  14. +0
    -4
      tutorial/05_easymesh.cpp
  15. +0
    -4
      tutorial/08_fbo.cpp
  16. +5
    -10
      tutorial/11_fractal.cpp

+ 12
- 2
configure.ac Bestand weergeven

@@ -123,6 +123,17 @@ AM_CONDITIONAL(USE_MAKE_FSELF, test "${MAKE_FSELF}" != "no")
AM_CONDITIONAL(USE_PS3, test "${ac_cv_my_have_ps3}" != "no")


dnl Are we building using MinGW?
LIBS_save="$LIBS"
LIBS="$LIBS -mwindows"
AC_MSG_CHECKING(for -mwindows)
AC_TRY_LINK([], [],
[AC_MSG_RESULT(yes)
LOL_LIBS="${LOL_LIBS} -mwindows"],
[AC_MSG_RESULT(no)])
LIBS="$LIBS_save"


dnl Are we on the Xbox 360?
dnl Answer: NO! we don't know how to build for it anyway
AM_CONDITIONAL(USE_X360, false)
@@ -142,8 +153,7 @@ LIBS_save="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,OpenGL"
AC_MSG_CHECKING(for -framework OpenGL)
AC_TRY_LINK([], [],
[ac_cv_my_have_cocoa="yes"
AC_MSG_RESULT(yes)
[AC_MSG_RESULT(yes)
GL_LIBS="${GL_LIBS} -framework OpenGL"
CXXFLAGS="${CXXFLAGS} -ObjC++"],
[AC_MSG_RESULT(no)])


+ 6
- 1
src/core.h Bestand weergeven

@@ -61,11 +61,16 @@ static inline int isnan(float f)
}
#endif

/* If using NaCl, override main with our version */
/* If using NaCl, override main() with our version */
#if defined __native_client__
# define main lol_nacl_main
#endif

/* If using SDL and Visual Studio, let it override main() */
#if defined _MSVC && defined USE_SDL
# include <SDL_main.h>
#endif

// Base types
#include "lol/debug.h"
#include "lol/math/math.h"


+ 0
- 4
test/BtPhysTest.cpp Bestand weergeven

@@ -28,10 +28,6 @@
# include <cmath>
#endif

#if USE_SDL
# include <SDL_main.h>
#endif

#include "core.h"
#include "loldebug.h"



+ 0
- 4
test/benchsuite.cpp Bestand weergeven

@@ -14,10 +14,6 @@

#include <cstdio>

#if USE_SDL
# include <SDL_main.h>
#endif

#include "core.h"

using namespace std;


+ 0
- 4
test/debug/quad.cpp Bestand weergeven

@@ -19,10 +19,6 @@
using namespace std;
using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

int main(int argc, char **argv)
{
Application app("Quad", ivec2(640, 480), 60.0f);


+ 0
- 4
test/math/pi.cpp Bestand weergeven

@@ -14,10 +14,6 @@

#include <cstdio>

#if USE_SDL
# include <SDL_main.h>
#endif

#include "core.h"

using std::printf;


+ 0
- 4
test/math/poly.cpp Bestand weergeven

@@ -14,10 +14,6 @@

#include <cstdio>

#if USE_SDL
# include <SDL_main.h>
#endif

#include "core.h"

using namespace lol;


+ 0
- 4
test/math/remez.cpp Bestand weergeven

@@ -12,10 +12,6 @@
# include "config.h"
#endif

#if USE_SDL
# include <SDL_main.h>
#endif

#include "lol/math/real.h"
#include "lol/math/remez.h"



+ 0
- 4
test/sandbox/sample.cpp Bestand weergeven

@@ -12,10 +12,6 @@
# include "config.h"
#endif

#if USE_SDL
# include <SDL_main.h>
#endif

#include "core.h"

class Moo


+ 0
- 4
test/testsuite.cpp Bestand weergeven

@@ -15,10 +15,6 @@
#include <cstdio>
#include <cstdlib>

#if USE_SDL
# include <SDL_main.h>
#endif

#include <lol/unit.h>

int main(int argc, char **argv)


+ 0
- 4
test/xolotl/xolotl.cpp Bestand weergeven

@@ -19,10 +19,6 @@

using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

#include "xolotl.h"

class Xolotl : public WorldEntity


+ 0
- 4
tutorial/01_triangle.cpp Bestand weergeven

@@ -18,10 +18,6 @@
using namespace std;
using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

#if defined _WIN32
# include <direct.h>
#endif


+ 0
- 4
tutorial/02_cube.cpp Bestand weergeven

@@ -18,10 +18,6 @@
using namespace std;
using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

#if defined _WIN32
# include <direct.h>
#endif


+ 0
- 4
tutorial/05_easymesh.cpp Bestand weergeven

@@ -17,10 +17,6 @@
using namespace std;
using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

class EasyMeshTutorial : public WorldEntity
{
public:


+ 0
- 4
tutorial/08_fbo.cpp Bestand weergeven

@@ -18,10 +18,6 @@
using namespace std;
using namespace lol;

#if USE_SDL
# include <SDL_main.h>
#endif

#if defined _WIN32
# include <direct.h>
#endif


+ 5
- 10
tutorial/11_fractal.cpp Bestand weergeven

@@ -20,18 +20,13 @@

using namespace lol;

#if defined _WIN32 && defined USE_D3D9
# define FAR
# define NEAR
# include <d3d9.h>
#endif

#if USE_SDL
# include <SDL_main.h>
#endif

#if defined _WIN32
# include <direct.h>
# if defined USE_D3D9
# define FAR
# define NEAR
# include <d3d9.h>
# endif
#endif

extern char const *lolfx_11_fractal;


Laden…
Annuleren
Opslaan