hm nicht so geil

This commit is contained in:
huaqo-games
2025-11-02 12:15:41 +01:00
parent c1a2448126
commit 55005b0801
4 changed files with 35 additions and 19 deletions
+3
View File
@@ -249,6 +249,9 @@ void RenderComponents(App *app);
void RenderGame(App *app);
void CleanupGame(App *app);
void OnEscapeChangeView(App *app, View view);
void OnWindowClosedStoppApp(App *app);
void ConfigApp(App *app);
void InitApp(App *app);
void UpdateApp(App *app);
+15 -18
View File
@@ -1,12 +1,12 @@
#include "appTypes.h"
const ShaderAsset shaderAssets[SHADER_COUNT] = {
{"shaders/postfx.fs"}};
{"shaders/postfx.fs"}
};
const SoundtrackAsset soundtrackAssets[SOUNDTRACK_COUNT] = {
{"assets/sea.mp3"}};
{"assets/sea.mp3"}
};
void InitGame(App *app)
@@ -38,27 +38,24 @@ void InitGame(App *app)
g->mouse = CreateMouse(0.10f, 5.0f, 10.0f, &mouseTexture);
}
void UpdateGame(App *app)
void StartGame(App *app)
{
GameState *g = &app->game;
if(!app->state.gameStarted){
app->state.gameStarted = true;
}
}
if (GetFPS() <= 60)
{
SetTargetFPS(0);
}
if (IsKeyPressed(KEY_ESCAPE))
{
app->state.currentView = MENU;
}
void UpdateGame(App *app)
{
GameState *g = &app->game;
if (WindowShouldClose() && !IsKeyPressed(KEY_ESCAPE))
{
app->state.running = false;
}
SetTargetFPS(0);
StartGame(app);
OnEscapeChangeView(app, MENU);
OnWindowClosedStoppApp(app);
for (int i = 0; i < SHADER_COUNT; i++)
{
-1
View File
@@ -18,7 +18,6 @@ void InitMenuSettings(MenuSettings *s)
void UpdateMenuSettings(MenuSettings *s, MenuView *menuView,Flags *flags)
{
ShowCursor();
if(isButtonClicked(&s->showFPS)){
flags->showFPS = !flags->showFPS;
+17
View File
@@ -0,0 +1,17 @@
#include "appTypes.h"
void OnEscapeChangeView(App *app, View view)
{
if (IsKeyPressed(KEY_ESCAPE))
{
app->state.currentView = view;
}
}
void OnWindowClosedStoppApp(App *app)
{
if (WindowShouldClose() && !IsKeyPressed(KEY_ESCAPE))
{
app->state.running = false;
}
}