restructure and add server/client example

This commit is contained in:
2025-01-24 10:34:04 +01:00
parent 729b475135
commit ec7b293bd5
30 changed files with 299 additions and 15 deletions

48
app/src/main.cpp Normal file
View File

@@ -0,0 +1,48 @@
#include <raylib.h>
#include "App.hpp"
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h>
#endif
static App app;
void UpdateDrawFrame()
{
app.update();
BeginDrawing();
app.draw();
EndDrawing();
}
int main(void)
{
char name[] = "treender";
int screenWidth = 600;
int screenHeight = 800;
#ifdef PLATFORM_ANDROID
InitWindow(0, 0, name);
screenWidth = GetScreenWidth();
screenHeight = GetScreenHeight();
#else
InitWindow(screenWidth, screenHeight, name);
#endif
app.init(screenWidth, screenHeight);
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else
SetTargetFPS(60);
while (!WindowShouldClose())
{
UpdateDrawFrame();
}
#endif
app.deinit();
CloseWindow();
return 0;
}