mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Allow use of main instead of android_main
Inspired by #504. Instead of requiring the user to do PLATFORM_ANDROID #ifdefery, have the android_main entry point exported by raylib and call the user-defined main. This way many games could (in theory) run unmodified on Android and elsewhere. This is untested!
This commit is contained in:
@ -18,10 +18,6 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -83,19 +79,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: arkanoid");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -122,9 +110,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -338,4 +325,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -101,19 +97,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: asteroids");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -140,9 +128,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -578,4 +565,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -84,19 +80,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: asteroids survival");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -123,9 +111,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -388,4 +375,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,10 +13,6 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -72,19 +68,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#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: floppy");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -111,9 +99,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Definitions (local)
|
||||
@ -250,4 +237,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,10 +13,6 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -81,19 +77,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: gold fever");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -120,9 +108,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -291,4 +278,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,6 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -120,19 +116,11 @@ static bool UpdateBall(int playerTurn);
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: gorilas");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -159,9 +147,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -576,4 +563,4 @@ static bool UpdateBall(int playerTurn)
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,10 +16,6 @@
|
||||
#include "raylib.h"
|
||||
#include "screens/screens.h" // NOTE: Defines currentScreen
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -53,19 +49,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "GGJ15 - JUST DO");
|
||||
#endif
|
||||
|
||||
// Load global data here (assets that must be available in all screens, i.e. fonts)
|
||||
InitAudioDevice();
|
||||
@ -104,9 +92,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -370,4 +357,4 @@ void UpdateDrawFrame(void)
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,6 @@
|
||||
#include "raylib.h"
|
||||
#include "screens/screens.h" // NOTE: Defines currentScreen
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -47,12 +43,7 @@ void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
int main(void) {
|
||||
// Initialization
|
||||
//---------------------------------------------------------
|
||||
const int screenWidth = 1280;
|
||||
@ -62,11 +53,8 @@ int main(void)
|
||||
//ShowLogo();
|
||||
//SetConfigFlags(FLAG_FULLSCREEN_MODE);
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
// Note that windowTitle is ignored on Android
|
||||
InitWindow(screenWidth, screenHeight, windowTitle);
|
||||
#endif
|
||||
|
||||
// Load global data here (assets that must be available in all screens, i.e. fonts)
|
||||
font = LoadSpriteFont("resources/graphics/mainfont.png");
|
||||
@ -145,9 +133,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void TransitionToScreen(int screen)
|
||||
@ -282,4 +269,4 @@ void UpdateDrawFrame(void)
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,10 +19,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -55,19 +51,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "GGJ16 - LIGHT MY RITUAL!");
|
||||
#endif
|
||||
|
||||
// Global data loading (assets that must be available in all screens, i.e. fonts)
|
||||
InitAudioDevice();
|
||||
@ -129,9 +117,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void TransitionToScreen(int screen)
|
||||
|
||||
@ -18,10 +18,6 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -119,19 +115,11 @@ static void UpdateIncomingFire();
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: missile commander");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -158,9 +146,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -544,4 +531,4 @@ static void UpdateIncomingFire()
|
||||
missileIndex++;
|
||||
if (missileIndex == MAX_MISSILES) missileIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
games/pang.c
19
games/pang.c
@ -15,10 +15,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -110,19 +106,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: pang");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -149,9 +137,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -637,4 +624,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,10 +14,6 @@
|
||||
|
||||
#include "player.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -52,19 +48,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "SKULLY ESCAPE [KING GAMEJAM]");
|
||||
#endif
|
||||
|
||||
// Global data loading (assets that must be available in all screens, i.e. fonts)
|
||||
InitAudioDevice();
|
||||
@ -112,9 +100,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void TransitionToScreen(int screen)
|
||||
|
||||
@ -13,10 +13,6 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -73,19 +69,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: snake");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -112,9 +100,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -298,4 +285,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,10 +13,6 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -90,19 +86,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame)
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: space invaders");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -129,9 +117,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -410,4 +397,4 @@ void UpdateDrawFrame(void)
|
||||
{
|
||||
UpdateGame();
|
||||
DrawGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,6 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -109,19 +105,11 @@ static void DeleteCompleteLines();
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(void)
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
// Initialization (Note windowTitle is unused on Android)
|
||||
//---------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
InitWindow(screenWidth, screenHeight, "sample game: tetris");
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
@ -148,9 +136,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -841,4 +828,4 @@ static void DeleteCompleteLines()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,10 +17,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -55,20 +51,15 @@ static void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#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
|
||||
#ifndef PLATFORM_ANDROID
|
||||
SetConfigFlags(FLAG_SHOW_LOGO); // | FLAG_FULLSCREEN_MODE);
|
||||
InitWindow(screenWidth, screenHeight, "raylib game - transmission mission");
|
||||
#endif
|
||||
// Note windowTitle is unused on Android
|
||||
InitWindow(screenWidth, screenHeight, "raylib game - transmission mission");
|
||||
|
||||
// Global data loading (assets that must be available in all screens, i.e. fonts)
|
||||
InitAudioDevice();
|
||||
@ -138,9 +129,8 @@ int main(void)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -462,4 +452,4 @@ void DrawButton(const char *text)
|
||||
Vector2 measure = MeasureTextEx(fontMission, text, fontSizeButton, 0);
|
||||
Vector2 textPos = {textPositionButton.x - measure.x/2 + 10, textPositionButton.y - measure.y/2 - 10};
|
||||
DrawTextEx(fontMission, text, textPos , fontSizeButton, 0, textColorButton);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,10 +22,6 @@
|
||||
#include <stdio.h> // Required for: printf()
|
||||
#include <string.h> // Required for: strcpy()
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
#include "android_native_app_glue.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
@ -60,11 +56,7 @@ static void UpdateDrawFrame(void); // Update and Draw one frame
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
void android_main(struct android_app *app)
|
||||
#else
|
||||
int main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
// Initialization
|
||||
//---------------------------------------------------------
|
||||
@ -89,12 +81,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_ANDROID)
|
||||
InitWindow(screenWidth, screenHeight, app);
|
||||
#else
|
||||
#ifndef PLATFORM_ANDROID
|
||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||
InitWindow(screenWidth, screenHeight, "GGJ17 - WAVE COLLECTOR");
|
||||
#endif
|
||||
// Note windowTitle is unused on Android
|
||||
InitWindow(screenWidth, screenHeight, "GGJ17 - WAVE COLLECTOR");
|
||||
|
||||
// Global data loading (assets that must be available in all screens, i.e. fonts)
|
||||
InitAudioDevice();
|
||||
@ -143,9 +134,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(PLATFORM_ANDROID)
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user