on Windows if using Visual Studio; if using MinGW, try to stick to the original main() entry point.legacy
| @@ -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)]) | ||||
| @@ -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" | ||||
| @@ -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" | ||||
| @@ -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; | ||||
| @@ -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); | ||||
| @@ -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; | ||||
| @@ -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; | ||||
| @@ -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" | ||||
| @@ -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 | ||||
| @@ -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) | ||||
| @@ -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 | ||||
| @@ -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 | ||||
| @@ -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 | ||||
| @@ -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: | ||||
| @@ -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 | ||||
| @@ -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; | ||||