From a9ee01e64fecf40bae0eade1e31712aefe03063d Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Mon, 2 Feb 2026 18:32:07 -0500 Subject: [PATCH] Rename AppData to AppState --- RecastDemo/Include/{AppData.h => AppState.h} | 2 +- RecastDemo/Include/imguiHelpers.h | 6 +++--- RecastDemo/Source/{AppData.cpp => AppState.cpp} | 14 ++++++-------- RecastDemo/Source/main.cpp | 10 +++++----- 4 files changed, 15 insertions(+), 17 deletions(-) rename RecastDemo/Include/{AppData.h => AppState.h} (99%) rename RecastDemo/Source/{AppData.cpp => AppState.cpp} (90%) diff --git a/RecastDemo/Include/AppData.h b/RecastDemo/Include/AppState.h similarity index 99% rename from RecastDemo/Include/AppData.h rename to RecastDemo/Include/AppState.h index 9113efbe..4ede35a2 100644 --- a/RecastDemo/Include/AppData.h +++ b/RecastDemo/Include/AppState.h @@ -11,7 +11,7 @@ class TestCase; class Sample; class InputGeom; -struct AppData +struct AppState { SDL_Window* window; SDL_GLContext glContext; diff --git a/RecastDemo/Include/imguiHelpers.h b/RecastDemo/Include/imguiHelpers.h index 66f7104c..ced786ec 100644 --- a/RecastDemo/Include/imguiHelpers.h +++ b/RecastDemo/Include/imguiHelpers.h @@ -1,11 +1,11 @@ #pragma once +#include "AppState.h" + #include #include -#include "AppData.h" - -extern AppData app; +extern AppState app; inline void DrawScreenspaceText(float x, float y, ImU32 color, const char* text, bool centered = false) { diff --git a/RecastDemo/Source/AppData.cpp b/RecastDemo/Source/AppState.cpp similarity index 90% rename from RecastDemo/Source/AppData.cpp rename to RecastDemo/Source/AppState.cpp index 40749bb5..3655d9ac 100644 --- a/RecastDemo/Source/AppData.cpp +++ b/RecastDemo/Source/AppState.cpp @@ -1,9 +1,7 @@ -#include "AppData.h" - +#include "AppState.h" #include "InputGeom.h" -#include "Sample.h" - #include "SDL_opengl.h" +#include "Sample.h" #ifdef __APPLE__ # include @@ -13,7 +11,7 @@ #include -void AppData::resetCamera() +void AppState::resetCamera() { // Reset camera and fog to match the mesh bounds. if (inputGeometry) @@ -38,7 +36,7 @@ void AppData::resetCamera() glFogf(GL_FOG_END, camr * 1.25f); } -void AppData::updateWindowSize() +void AppState::updateWindowSize() { SDL_GetWindowSize(window, &width, &height); SDL_GL_GetDrawableSize(window, &drawableWidth, &drawableHeight); @@ -52,7 +50,7 @@ void AppData::updateWindowSize() glGetDoublev(GL_PROJECTION_MATRIX, projectionMatrix); } -void AppData::updateUIScale() const +void AppState::updateUIScale() const { ImGuiIO& io = ImGui::GetIO(); io.DisplaySize = ImVec2(static_cast(width), static_cast(height)); @@ -61,7 +59,7 @@ void AppData::updateUIScale() const static_cast(drawableHeight) / static_cast(height)); } -void AppData::worldToScreen(float x, float y, float z, float* screenX, float* screenY) const +void AppState::worldToScreen(float x, float y, float z, float* screenX, float* screenY) const { GLdouble modelviewMatrix[16]; glGetDoublev(GL_MODELVIEW_MATRIX, modelviewMatrix); diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index 3c2a42ec..b6700be4 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -16,7 +16,7 @@ // 3. This notice may not be removed or altered from any source distribution. // -#include "AppData.h" +#include "AppState.h" #include "InputGeom.h" #include "SDL.h" #include "SDL_keycode.h" @@ -28,13 +28,13 @@ #include "TestCase.h" #include "imguiHelpers.h" -#include -#include - #include #include #include #include + +#include +#include #ifdef __APPLE__ # include #else @@ -68,7 +68,7 @@ constexpr ImGuiWindowFlags staticWindowFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse; } -AppData app; +AppState app; int main(int /*argc*/, char** /*argv*/) {