|
@@ -15,12 +15,12 @@ using namespace oxygine;
|
|
|
|
|
|
|
|
// This function is called each frame
|
|
// This function is called each frame
|
|
|
int mainloop()
|
|
int mainloop()
|
|
|
-{
|
|
|
|
|
|
|
+{
|
|
|
// Update engine-internal components
|
|
// Update engine-internal components
|
|
|
// If input events are available, they are passed to Stage::instance.handleEvent
|
|
// If input events are available, they are passed to Stage::instance.handleEvent
|
|
|
// If the function returns true, it means that the user requested the application to terminate
|
|
// If the function returns true, it means that the user requested the application to terminate
|
|
|
bool done = core::update();
|
|
bool done = core::update();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// It gets passed to our example game implementation
|
|
// It gets passed to our example game implementation
|
|
|
example_update();
|
|
example_update();
|
|
|
|
|
|
|
@@ -82,12 +82,12 @@ void run()
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
|
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
|
|
// On iPhone mainloop is called automatically by CADisplayLink, see int main() below
|
|
// On iPhone mainloop is called automatically by CADisplayLink, see int main() below
|
|
|
return;
|
|
return;
|
|
|
#endif
|
|
#endif
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// This is the main game loop.
|
|
// This is the main game loop.
|
|
|
while (1)
|
|
while (1)
|
|
|
{
|
|
{
|
|
@@ -140,17 +140,17 @@ int main(int argc, char* argv[])
|
|
|
#include "SDL.h"
|
|
#include "SDL.h"
|
|
|
extern "C"
|
|
extern "C"
|
|
|
{
|
|
{
|
|
|
- void one(void *param) { mainloop(); }
|
|
|
|
|
|
|
+ void one(void* param) { mainloop(); }
|
|
|
int main(int argc, char* argv[])
|
|
int main(int argc, char* argv[])
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
run();
|
|
run();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
|
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
|
|
// If parameter 2 is set to 1, refresh rate will be 60 fps, 2 - 30 fps, 3 - 15 fps.
|
|
// If parameter 2 is set to 1, refresh rate will be 60 fps, 2 - 30 fps, 3 - 15 fps.
|
|
|
SDL_iPhoneSetAnimationCallback(core::getWindow(), 1, one, nullptr);
|
|
SDL_iPhoneSetAnimationCallback(core::getWindow(), 1, one, nullptr);
|
|
|
#endif
|
|
#endif
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|