浏览代码

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 年前
父节点
当前提交
5bd24fa1d3
共有 16 个文件被更改,包括 23 次插入65 次删除
  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 查看文件

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


+ 6
- 1
src/core.h 查看文件

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


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


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

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


+ 0
- 4
test/BtPhysTest.cpp 查看文件

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


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

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




+ 0
- 4
test/benchsuite.cpp 查看文件

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


#include <cstdio> #include <cstdio>


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

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


using namespace std; using namespace std;


+ 0
- 4
test/debug/quad.cpp 查看文件

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


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

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


+ 0
- 4
test/math/pi.cpp 查看文件

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


#include <cstdio> #include <cstdio>


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

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


using std::printf; using std::printf;


+ 0
- 4
test/math/poly.cpp 查看文件

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


#include <cstdio> #include <cstdio>


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

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


using namespace lol; using namespace lol;


+ 0
- 4
test/math/remez.cpp 查看文件

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


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

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




+ 0
- 4
test/sandbox/sample.cpp 查看文件

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


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

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


class Moo class Moo


+ 0
- 4
test/testsuite.cpp 查看文件

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


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

#include <lol/unit.h> #include <lol/unit.h>


int main(int argc, char **argv) int main(int argc, char **argv)


+ 0
- 4
test/xolotl/xolotl.cpp 查看文件

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


using namespace lol; using namespace lol;


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

#include "xolotl.h" #include "xolotl.h"


class Xolotl : public WorldEntity class Xolotl : public WorldEntity


+ 0
- 4
tutorial/01_triangle.cpp 查看文件

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


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

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


+ 0
- 4
tutorial/02_cube.cpp 查看文件

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


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

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


+ 0
- 4
tutorial/05_easymesh.cpp 查看文件

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


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

class EasyMeshTutorial : public WorldEntity class EasyMeshTutorial : public WorldEntity
{ {
public: public:


+ 0
- 4
tutorial/08_fbo.cpp 查看文件

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


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

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


+ 5
- 10
tutorial/11_fractal.cpp 查看文件

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


using namespace lol; 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 #if defined _WIN32
# include <direct.h> # include <direct.h>
# if defined USE_D3D9
# define FAR
# define NEAR
# include <d3d9.h>
# endif
#endif #endif


extern char const *lolfx_11_fractal; extern char const *lolfx_11_fractal;


正在加载...
取消
保存