mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-22 15:19:18 -05:00
Updated Makefile to support Android
This commit is contained in:
@ -13,6 +13,10 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -57,7 +61,6 @@ typedef struct Shoot{
|
||||
static int screenWidth = 800;
|
||||
static int screenHeight = 450;
|
||||
|
||||
static int framesCounter;
|
||||
static bool gameOver;
|
||||
static bool pause;
|
||||
static int score;
|
||||
@ -87,11 +90,19 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main()
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: space invaders");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -105,14 +116,9 @@ int main()
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
// Update and Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateGame();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
DrawGame();
|
||||
UpdateDrawFrame();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
#endif
|
||||
@ -123,8 +129,9 @@ int main()
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user