summaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2017-10-14 00:14:24 +0200
committerraysan5 <[email protected]>2017-10-14 00:14:24 +0200
commitba4b39a025fd8d88445bd929456f288191aad70d (patch)
treeb92b885ad0d535e1a5594ed1a12ee149b7c4d08b /templates
parent5430d5d52e61ce5cd7e02d99b5d98f8fc56ddb28 (diff)
downloadraylib-ba4b39a025fd8d88445bd929456f288191aad70d.tar.gz
raylib-ba4b39a025fd8d88445bd929456f288191aad70d.zip
Working on game templates
Diffstat (limited to 'templates')
-rw-r--r--templates/advance_game/advance_game.c19
-rw-r--r--templates/advance_game/resources/ambient.oggbin0 -> 2672956 bytes
-rw-r--r--templates/advance_game/resources/coin.wavbin0 -> 9508 bytes
-rw-r--r--templates/advance_game/resources/raylib_logo.pngbin0 -> 3760 bytes
-rw-r--r--templates/standard_game/standard_game.c20
5 files changed, 31 insertions, 8 deletions
diff --git a/templates/advance_game/advance_game.c b/templates/advance_game/advance_game.c
index 5e837f87..2c6aee3a 100644
--- a/templates/advance_game/advance_game.c
+++ b/templates/advance_game/advance_game.c
@@ -15,6 +15,10 @@
#include "raylib.h"
#include "screens/screens.h" // NOTE: Defines global variable: currentScreen
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
@@ -36,16 +40,22 @@ void DrawTransition(void);
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
+#if defined(PLATFORM_ANDROID)
+void android_main(struct android_app *app)
+#else
int main(void)
+#endif
{
// Initialization
//---------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
- const char windowTitle[30] = "<game name goes here>";
-
- InitWindow(screenWidth, screenHeight, windowTitle);
+#if defined(PLATFORM_ANDROID)
+ InitWindow(screenWidth, screenHeight, app);
+#else
+ InitWindow(screenWidth, screenHeight, "raylib template - standard game");
+#endif
// TODO: Load global data here (assets that must be available in all screens, i.e. fonts)
// Setup and Init first screen
@@ -141,8 +151,9 @@ int main(void)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
void TransitionToScreen(int screen)
diff --git a/templates/advance_game/resources/ambient.ogg b/templates/advance_game/resources/ambient.ogg
new file mode 100644
index 00000000..af7f836e
--- /dev/null
+++ b/templates/advance_game/resources/ambient.ogg
Binary files differ
diff --git a/templates/advance_game/resources/coin.wav b/templates/advance_game/resources/coin.wav
new file mode 100644
index 00000000..6684ffc6
--- /dev/null
+++ b/templates/advance_game/resources/coin.wav
Binary files differ
diff --git a/templates/advance_game/resources/raylib_logo.png b/templates/advance_game/resources/raylib_logo.png
new file mode 100644
index 00000000..66545627
--- /dev/null
+++ b/templates/advance_game/resources/raylib_logo.png
Binary files differ
diff --git a/templates/standard_game/standard_game.c b/templates/standard_game/standard_game.c
index 36ca30f9..f95087f7 100644
--- a/templates/standard_game/standard_game.c
+++ b/templates/standard_game/standard_game.c
@@ -15,18 +15,29 @@
#include "raylib.h"
#include "screens/screens.h" // NOTE: Defines currentScreen
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
+#if defined(PLATFORM_ANDROID)
+void android_main(struct android_app *app)
+#else
int main(void)
+#endif
{
// Initialization
//---------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
- const char windowTitle[30] = "<game name goes here>";
-
- InitWindow(screenWidth, screenHeight, windowTitle);
+
+#if defined(PLATFORM_ANDROID)
+ InitWindow(screenWidth, screenHeight, app);
+#else
+ InitWindow(screenWidth, screenHeight, "raylib template - standard game");
+#endif
// TODO: Load global data here (assets that must be available in all screens, i.e. fonts)
@@ -139,6 +150,7 @@ int main(void)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
} \ No newline at end of file