mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-27 01:09:17 -05:00
Working on game templates
This commit is contained in:
@ -15,6 +15,10 @@
|
|||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
#include "screens/screens.h" // NOTE: Defines global variable: currentScreen
|
#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)
|
// Global Variables Definition (local to this module)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -36,16 +40,22 @@ void DrawTransition(void);
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Main entry point
|
// Main entry point
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
#if defined(PLATFORM_ANDROID)
|
||||||
|
void android_main(struct android_app *app)
|
||||||
|
#else
|
||||||
int main(void)
|
int main(void)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
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)
|
// TODO: Load global data here (assets that must be available in all screens, i.e. fonts)
|
||||||
|
|
||||||
// Setup and Init first screen
|
// Setup and Init first screen
|
||||||
@ -141,8 +151,9 @@ int main(void)
|
|||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransitionToScreen(int screen)
|
void TransitionToScreen(int screen)
|
||||||
|
|||||||
BIN
templates/advance_game/resources/ambient.ogg
Normal file
BIN
templates/advance_game/resources/ambient.ogg
Normal file
Binary file not shown.
BIN
templates/advance_game/resources/coin.wav
Normal file
BIN
templates/advance_game/resources/coin.wav
Normal file
Binary file not shown.
BIN
templates/advance_game/resources/raylib_logo.png
Normal file
BIN
templates/advance_game/resources/raylib_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@ -15,18 +15,29 @@
|
|||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
#include "screens/screens.h" // NOTE: Defines currentScreen
|
#include "screens/screens.h" // NOTE: Defines currentScreen
|
||||||
|
|
||||||
|
#if defined(PLATFORM_ANDROID)
|
||||||
|
#include "android_native_app_glue.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Main entry point
|
// Main entry point
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
#if defined(PLATFORM_ANDROID)
|
||||||
|
void android_main(struct android_app *app)
|
||||||
|
#else
|
||||||
int main(void)
|
int main(void)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
const char windowTitle[30] = "<game name goes here>";
|
|
||||||
|
#if defined(PLATFORM_ANDROID)
|
||||||
InitWindow(screenWidth, screenHeight, windowTitle);
|
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)
|
// 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
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user