diff --git a/devcpp/ZEngine.dev b/devcpp/ZEngine.dev
index 9a45c4a..7e35b34 100755
--- a/devcpp/ZEngine.dev
+++ b/devcpp/ZEngine.dev
@@ -1,7 +1,7 @@
[Project]
FileName=ZEngine.dev
Name=ZEngine
-UnitCount=33
+UnitCount=34
Type=2
Ver=1
ObjFiles=
@@ -375,3 +375,13 @@ ProductName=
ProductVersion=
AutoIncBuildNr=0
+[Unit34]
+FileName=..\src\ZE_main.cpp
+CompileCpp=1
+Folder=Source
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/devcpp/ZFontTest.dev b/devcpp/ZFontTest.dev
index 5f0f613..3fa924a 100755
--- a/devcpp/ZFontTest.dev
+++ b/devcpp/ZFontTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZImageTest.dev b/devcpp/ZImageTest.dev
index f23e381..4d85147 100755
--- a/devcpp/ZImageTest.dev
+++ b/devcpp/ZImageTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZMouseTest.dev b/devcpp/ZMouseTest.dev
index db670e0..24c4ccb 100755
--- a/devcpp/ZMouseTest.dev
+++ b/devcpp/ZMouseTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZMusicTest.dev b/devcpp/ZMusicTest.dev
index d66f036..afd0481 100755
--- a/devcpp/ZMusicTest.dev
+++ b/devcpp/ZMusicTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZParticleTest.dev b/devcpp/ZParticleTest.dev
index 6e83f08..297a5f8 100755
--- a/devcpp/ZParticleTest.dev
+++ b/devcpp/ZParticleTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZRectTest.dev b/devcpp/ZRectTest.dev
index f7050d4..f499610 100755
--- a/devcpp/ZRectTest.dev
+++ b/devcpp/ZRectTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZSoundTest.dev b/devcpp/ZSoundTest.dev
index 353a280..9726a75 100755
--- a/devcpp/ZSoundTest.dev
+++ b/devcpp/ZSoundTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/devcpp/ZTimerTest.dev b/devcpp/ZTimerTest.dev
index 078c12d..336bfb3 100755
--- a/devcpp/ZTimerTest.dev
+++ b/devcpp/ZTimerTest.dev
@@ -12,7 +12,7 @@ ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
-Linker=-lmingw32_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDLmain_@@_-lSDL_@@_-lOpenGL32_@@_
+Linker=-lmingw32_@@_-lSDLmain_@@_-lZEngineS_@@_-lSDL_mixer_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_@@_-lOpenGL32_@@_
IsCpp=1
Icon=
ExeOutput=..\test\bin
diff --git a/src/ZE_main.cpp b/src/ZE_main.cpp
new file mode 100755
index 0000000..fde3bcf
--- /dev/null
+++ b/src/ZE_main.cpp
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ This file is Part of the ZEngine Library for 2D game development.
+ Copyright (C) 2002, 2003 James Turk
+
+ Licensed under a BSD-style license.
+
+ The maintainer of this library is James Turk (james@conceptofzero.net)
+ and the home of this Library is http://www.zengine.sourceforge.net
+*******************************************************************************/
+
+/**
+ \file ZE_main.cpp
+ \brief Source file which defines default ZEngine entry point.
+
+ The entry point 'main' defined in this file simply does the initial creation and freeing of ZEngine.
+ An application that defines main overrides this main, so backwards compatibility is not broken, however as of 0.8.5 ZE_main is the
+ expected entry point of ZEngine applications.
+
$Id: ZE_main.cpp,v 1.1 2003/09/09 02:45:58 cozman Exp $
+ \author James Turk
+**/
+
+#include "ZEngine.h"
+
+extern int ZE_main(int argc, char *argv[]);
+
+int main(int argc, char *argv[])
+{
+ ZE::ZEngine *engine = ZE::ZEngine::GetInstance();
+ int ret;
+
+#ifdef USE_PHYSFS
+ engine->InitPhysFS(argv[0]);
+#endif
+ ret = ZE_main(argc,argv);
+
+ ZE::ZEngine::ReleaseInstance(); //release engine instance
+ return ret;
+}
+
diff --git a/test/ZFontTest.cpp b/test/ZFontTest.cpp
index 52ae25e..8ddef4a 100644
--- a/test/ZFontTest.cpp
+++ b/test/ZFontTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZFontTest.cpp,v 1.14 2003/08/02 01:18:45 cozman Exp $*/
+/*$Id: ZFontTest.cpp,v 1.15 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -77,16 +77,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZImageTest.cpp b/test/ZImageTest.cpp
index ab8451b..67497d5 100644
--- a/test/ZImageTest.cpp
+++ b/test/ZImageTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZImageTest.cpp,v 1.23 2003/09/05 19:44:13 cozman Exp $*/
+/*$Id: ZImageTest.cpp,v 1.24 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -134,16 +134,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZMouseTest.cpp b/test/ZMouseTest.cpp
index bbe3b2f..a8d6538 100644
--- a/test/ZMouseTest.cpp
+++ b/test/ZMouseTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZMouseTest.cpp,v 1.15 2003/07/10 20:45:39 cozman Exp $*/
+/*$Id: ZMouseTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -87,16 +87,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZMusicTest.cpp b/test/ZMusicTest.cpp
index ead3339..2fa5e89 100644
--- a/test/ZMusicTest.cpp
+++ b/test/ZMusicTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZMusicTest.cpp,v 1.16 2003/07/10 20:45:39 cozman Exp $*/
+/*$Id: ZMusicTest.cpp,v 1.17 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -103,16 +103,9 @@ void Test()
}
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZParticleTest.cpp b/test/ZParticleTest.cpp
index 70bc3b8..a6fd063 100755
--- a/test/ZParticleTest.cpp
+++ b/test/ZParticleTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZParticleTest.cpp,v 1.4 2003/08/02 01:32:46 cozman Exp $*/
+/*$Id: ZParticleTest.cpp,v 1.5 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -147,16 +147,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZRectTest.cpp b/test/ZRectTest.cpp
index 16cec09..9e800c0 100644
--- a/test/ZRectTest.cpp
+++ b/test/ZRectTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZRectTest.cpp,v 1.17 2003/07/10 20:45:39 cozman Exp $*/
+/*$Id: ZRectTest.cpp,v 1.18 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -82,16 +82,9 @@ void Test()
} while(!engine->QuitRequested());
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZSoundTest.cpp b/test/ZSoundTest.cpp
index 9213d80..155bda8 100644
--- a/test/ZSoundTest.cpp
+++ b/test/ZSoundTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZSoundTest.cpp,v 1.15 2003/07/10 23:30:07 cozman Exp $*/
+/*$Id: ZSoundTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -99,16 +99,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
+int ZE_main(int argc, char *argv[])
{
- ZEngine *engine = ZEngine::GetInstance();
-
if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
return 0;
}
diff --git a/test/ZTimerTest.cpp b/test/ZTimerTest.cpp
index 78808d4..a1cb2b1 100644
--- a/test/ZTimerTest.cpp
+++ b/test/ZTimerTest.cpp
@@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
-/*$Id: ZTimerTest.cpp,v 1.15 2003/07/12 01:25:42 cozman Exp $*/
+/*$Id: ZTimerTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/
#include
#include
@@ -117,16 +117,9 @@ void Test()
} while(!engine->QuitRequested()); //quit only when engine has encountered a quit request
}
-int main(int argc, char *argv[])
-{
- ZEngine *engine = ZEngine::GetInstance();
-
- if(Initialize())
- {
- //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available
- Test();
- }
-
- ZEngine::ReleaseInstance(); //release engine instance
- return 0;
+int ZE_main(int argc, char *argv[])
+{
+ if(Initialize())
+ Test();
+ return 0;
}