From 886d6ba79b7c8d592a6502f71e323e5b867aa44f Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Thu, 21 Dec 2023 16:02:40 +0100 Subject: [PATCH] Add underscore prefix to globals in game.h --- engine/breeze/game.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/engine/breeze/game.h b/engine/breeze/game.h index f6731a7..9127f07 100644 --- a/engine/breeze/game.h +++ b/engine/breeze/game.h @@ -63,28 +63,28 @@ static void bzRaylibLogger(int msgType, const char *text, va_list args) { bzLoggerOnlyLogV(level, text, args); } -static BzAppDesc appDesc = {0, 0}; -static bool running = true; +static BzAppDesc _appDesc; +static bool _running = true; void bzGameExit() { - running = false; + _running = false; } static void bzGameLoopTick() { float dt = GetFrameTime(); - if (appDesc.update) - appDesc.update(dt, appDesc.userData); + if (_appDesc.update) + _appDesc.update(dt, _appDesc.userData); //if (ECS) // ecs_progress(ECS, dt); BeginDrawing(); - if (appDesc.render) - appDesc.render(dt, appDesc.userData); + if (_appDesc.render) + _appDesc.render(dt, _appDesc.userData); - if (appDesc.imguiRender) { + if (_appDesc.imguiRender) { rlImGuiBegin(); - appDesc.imguiRender(dt, appDesc.userData); + _appDesc.imguiRender(dt, _appDesc.userData); rlImGuiEnd(); } EndDrawing(); @@ -99,48 +99,48 @@ int main(int argc, const char **argv) { SetTraceLogCallback(bzRaylibLogger); - appDesc = (BzAppDesc){ + _appDesc = (BzAppDesc){ 1280, 720, "Breeze Engine", 60 }; - bool successful = bzMain(&appDesc, argc, argv); + bool successful = bzMain(&_appDesc, argc, argv); if (!successful) return 1; // Validate - if (!appDesc.render) { + if (!_appDesc.render) { bzLogFatal("[Breeze] No render function specifies."); return 1; } bzLogInfo("[Breeze] User initialization (bzMain) successful."); - InitWindow(appDesc.width, appDesc.height, appDesc.title); - SetTargetFPS(appDesc.fps); + InitWindow(_appDesc.width, _appDesc.height, _appDesc.title); + SetTargetFPS(_appDesc.fps); // Initialize modules - if (appDesc.imguiRender) + if (_appDesc.imguiRender) rlImGuiSetup(true); // User initialize - if (appDesc.init && !appDesc.init(appDesc.userData)) { + if (_appDesc.init && !_appDesc.init(_appDesc.userData)) { return 1; } #ifdef PLATFORM_WEB emscripten_set_main_loop(bzGameLoopTick, 0, 1); #else - while (!WindowShouldClose() && running) { + while (!WindowShouldClose() && _running) { bzGameLoopTick(); } // User deinitialize - if (appDesc.deinit) - appDesc.deinit(appDesc.userData); + if (_appDesc.deinit) + _appDesc.deinit(_appDesc.userData); // Deinitialize modules - if (appDesc.imguiRender) + if (_appDesc.imguiRender) rlImGuiShutdown(); CloseWindow();