From f8b41a0d615e6650fe7008da6a703e40557609f8 Mon Sep 17 00:00:00 2001 From: Isuru Samarathunga Date: Sun, 5 Oct 2025 01:51:48 +0530 Subject: [PATCH] Engine & Game Library Interface Update --- .vscode/settings.json | 22 ++ Engine/CMakeLists.txt | 15 + Engine/Src/Imp/CPP/AudioManager.cpp | 29 ++ Engine/Src/Imp/CPP/Engine.cpp | 115 ++------ Engine/Src/Imp/CPP/EventManager.cpp | 66 +++++ Engine/Src/Imp/CPP/InputManager.cpp | 108 +++++++ Engine/Src/Imp/CPP/InternalEngine.cpp | 159 ++++++++++ Engine/Src/Imp/CPP/Random.cpp | 29 ++ Engine/Src/Imp/CPP/Renderer/DebugDraw.cpp | 110 +++++++ .../Imp/CPP/Renderer/GPUResourceManager.cpp | 148 ++++++++++ Engine/Src/Imp/CPP/Renderer/Pipeline.cpp | 108 +++++++ Engine/Src/Imp/CPP/Renderer/Renderer.cpp | 257 ++++++++++++++++ Engine/Src/Imp/CPP/Renderer/UIRenderer.cpp | 24 ++ Engine/Src/Imp/CPP/Renderer/imgui.ini | 4 + Engine/Src/Imp/CPP/ResourceManager.cpp | 65 +++++ Engine/Src/Imp/CPP/Time.cpp | 29 ++ Engine/Src/Imp/CPP/WorldManager.cpp | 92 ++++++ Engine/Src/Imp/CPP/imgui.ini | 4 + Engine/Src/Imp/HPP/AudioManager.hpp | 31 ++ Engine/Src/Imp/HPP/EventManager.hpp | 33 +++ Engine/Src/Imp/HPP/InputManager.hpp | 33 +++ .../HPP/{Engine.hpp => InternalEngine.hpp} | 0 Engine/Src/Imp/HPP/Random.hpp | 31 ++ Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp | 32 ++ .../Src/Imp/HPP/Renderer/EmbeddedShader.hpp | 154 ++++++++++ .../Imp/HPP/Renderer/GPUResourceManager.hpp | 38 +++ Engine/Src/Imp/HPP/Renderer/Pipeline.hpp | 48 +++ Engine/Src/Imp/HPP/Renderer/Renderer.hpp | 86 ++++++ Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp | 24 ++ Engine/Src/Imp/HPP/ResourceManager.hpp | 31 ++ Engine/Src/Imp/HPP/Time.hpp | 31 ++ Engine/Src/Imp/HPP/WorldManager.hpp | 36 +++ Engine/Src/Inc/IAEngine/Base.hpp | 276 +++++++++++++++++- .../IAEngine/Components/CameraComponent.hpp | 27 ++ .../Inc/IAEngine/Components/IComponent.hpp | 29 ++ Engine/Src/Inc/IAEngine/Engine.hpp | 51 +--- ...terface.hpp => EngineLibraryInterface.hpp} | 7 +- ...Interface.hpp => GameLibraryInterface.hpp} | 0 Engine/Src/Inc/IAEngine/Nodes/INode.hpp | 27 ++ Engine/Src/Inc/IAEngine/Nodes/Node2D.hpp | 24 ++ Engine/Src/Inc/IAEngine/Nodes/SpriteNode.hpp | 24 ++ .../Inc/IAEngine/Nodes/SpriteObjectNode.hpp | 24 ++ Engine/Src/Inc/IAEngine/Nodes/TextureNode.hpp | 24 ++ .../Inc/IAEngine/Nodes/TextureObjectNode.hpp | 24 ++ Engine/Src/Inc/IAEngine/Nodes/UINode.hpp | 24 ++ Runtime/Windows/Src/Imp/CPP/Main.cpp | 59 +--- Samples/SpaceInvaders/Src/Imp/HPP/Game.hpp | 2 +- Vendor/IACore | 2 +- 48 files changed, 2423 insertions(+), 193 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 Engine/Src/Imp/CPP/AudioManager.cpp create mode 100644 Engine/Src/Imp/CPP/EventManager.cpp create mode 100644 Engine/Src/Imp/CPP/InputManager.cpp create mode 100644 Engine/Src/Imp/CPP/InternalEngine.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/DebugDraw.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/GPUResourceManager.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/Pipeline.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/Renderer.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/UIRenderer.cpp create mode 100644 Engine/Src/Imp/CPP/Renderer/imgui.ini create mode 100644 Engine/Src/Imp/CPP/ResourceManager.cpp create mode 100644 Engine/Src/Imp/CPP/WorldManager.cpp create mode 100644 Engine/Src/Imp/CPP/imgui.ini create mode 100644 Engine/Src/Imp/HPP/AudioManager.hpp create mode 100644 Engine/Src/Imp/HPP/EventManager.hpp create mode 100644 Engine/Src/Imp/HPP/InputManager.hpp rename Engine/Src/Imp/HPP/{Engine.hpp => InternalEngine.hpp} (100%) create mode 100644 Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp create mode 100644 Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp create mode 100644 Engine/Src/Imp/HPP/Renderer/GPUResourceManager.hpp create mode 100644 Engine/Src/Imp/HPP/Renderer/Pipeline.hpp create mode 100644 Engine/Src/Imp/HPP/Renderer/Renderer.hpp create mode 100644 Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp create mode 100644 Engine/Src/Imp/HPP/ResourceManager.hpp create mode 100644 Engine/Src/Imp/HPP/WorldManager.hpp create mode 100644 Engine/Src/Inc/IAEngine/Components/CameraComponent.hpp create mode 100644 Engine/Src/Inc/IAEngine/Components/IComponent.hpp rename Engine/Src/Inc/IAEngine/{EngineInterface.hpp => EngineLibraryInterface.hpp} (75%) rename Engine/Src/Inc/IAEngine/{GameInterface.hpp => GameLibraryInterface.hpp} (100%) create mode 100644 Engine/Src/Inc/IAEngine/Nodes/INode.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/Node2D.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/SpriteNode.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/SpriteObjectNode.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/TextureNode.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/TextureObjectNode.hpp create mode 100644 Engine/Src/Inc/IAEngine/Nodes/UINode.hpp diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4ea351b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "files.associations": { + "*.rml": "html", + "format": "cpp", + "random": "cpp", + "chrono": "cpp", + "functional": "cpp", + "optional": "cpp", + "regex": "cpp", + "system_error": "cpp", + "type_traits": "cpp", + "xlocmon": "cpp", + "xlocnum": "cpp", + "xtr1common": "cpp", + "xutility": "cpp", + "filesystem": "cpp", + "xlocale": "cpp", + "xlocinfo": "cpp", + "xstring": "cpp", + "any": "cpp" + } +} \ No newline at end of file diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index 377182c..27c1dda 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -1,5 +1,20 @@ set(SRC_FILES + "Src/Imp/CPP/Time.cpp" + "Src/Imp/CPP/Random.cpp" "Src/Imp/CPP/Engine.cpp" + "Src/Imp/CPP/InternalEngine.cpp" + + "Src/Imp/CPP/InputManager.cpp" + "Src/Imp/CPP/ResourceManager.cpp" + "Src/Imp/CPP/EventManager.cpp" + "Src/Imp/CPP/WorldManager.cpp" + "Src/Imp/CPP/AudioManager.cpp" + + "Src/Imp/CPP/Renderer/DebugDraw.cpp" + "Src/Imp/CPP/Renderer/Pipeline.cpp" + "Src/Imp/CPP/Renderer/Renderer.cpp" + "Src/Imp/CPP/Renderer/UIRenderer.cpp" + "Src/Imp/CPP/Renderer/GPUResourceManager.cpp" ) add_library(IAEngine SHARED ${SRC_FILES}) diff --git a/Engine/Src/Imp/CPP/AudioManager.cpp b/Engine/Src/Imp/CPP/AudioManager.cpp new file mode 100644 index 0000000..04324fd --- /dev/null +++ b/Engine/Src/Imp/CPP/AudioManager.cpp @@ -0,0 +1,29 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID AudioManager::Initialize() + { + } + + VOID AudioManager::Terminate() + { + } +} \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Engine.cpp b/Engine/Src/Imp/CPP/Engine.cpp index c5b68e2..797f199 100644 --- a/Engine/Src/Imp/CPP/Engine.cpp +++ b/Engine/Src/Imp/CPP/Engine.cpp @@ -14,114 +14,53 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include #include +#include -#include +#include -#include - -GameFunctionTable g_gameFunctions{}; +EXTERN GameFunctionTable g_gameFunctions; namespace ia::iae { - String GetStringVersion(IN UINT64 version) + BOOL Engine::IsDebugMode() { - return ""; + return true; } - VOID __Internal_Engine::Initialize() + VOID Engine::ResizeDisplay(IN INT32 newWidth, IN INT32 newHeight) { - IAE_LOG_INFO("Booting IAEngine for ", g_gameFunctions.GetName()); - - SDL_SetAppMetadata(g_gameFunctions.GetName(), GetStringVersion(g_gameFunctions.GetVersion()).c_str(), - g_gameFunctions.GetPackageName()); - - g_gameFunctions.OnInitialize(); + Renderer::OnScreenResize(newWidth, newHeight); + g_gameFunctions.OnResize(newWidth, newHeight); } - VOID __Internal_Engine::Terminate() + FLOAT32 Engine::GetRandomFloat() { - g_gameFunctions.OnTerminate(); - - IAE_LOG_INFO("Shutting down IAEngine"); + return 0.0f; } - VOID __Internal_Engine::Iterate() + INT32 Engine::GetRandomInRange(IN INT32 min, IN INT32 max) { + return 0; } - VOID __Internal_Engine::ProcessEvent(IN SDL_Event *event) + INT64 Engine::GetTickCount() { - switch (event->type) - { - case SDL_EVENT_WINDOW_RESIZED: - break; + return 0; + } + INT64 Engine::GetUnixSecond() + { + return 0; + } - } + INT64 Engine::GetUnixMillisecond() + { + return 0; + } + + FLOAT32 Engine::GetFrameDeltaTime() + { + return 0.0f; } } // namespace ia::iae - -namespace ia::iae -{ - -} - -BOOL ValidateGameFunctionTable(IN GameFunctionTable gameFunctionTable) -{ - if (!gameFunctionTable.OnInitialize) - return false; - if (!gameFunctionTable.OnTerminate) - return false; - if (!gameFunctionTable.OnDebugDraw) - return false; - if (!gameFunctionTable.OnFixedUpdate) - return false; - if (!gameFunctionTable.OnUpdate) - return false; - if (!gameFunctionTable.OnResize) - return false; - if (!gameFunctionTable.GetName) - return false; - if (!gameFunctionTable.GetVersion) - return false; - if (!gameFunctionTable.GetPackageName) - return false; - if (!gameFunctionTable.GetDeveloperName) - return false; - if (!gameFunctionTable.GetPublisherName) - return false; - return true; -} - -C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnInitialize(IN GameFunctionTable gameFunctionTable)) -{ - if (!ValidateGameFunctionTable(gameFunctionTable)) - { - IAE_LOG_ERROR("Invalid game function table was passed to the engine. Exiting.."); - return false; - } - - g_gameFunctions = gameFunctionTable; - - __Internal_Engine::Initialize(); - - return true; -} - -C_DECL(IAE_DLL_API ia::VOID IAEngine_OnTerminate()) -{ - __Internal_Engine::Terminate(); -} - -C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnIterate()) -{ - __Internal_Engine::Iterate(); - return true; -} - -C_DECL(IAE_DLL_API ia::VOID IAEngine_OnEvent(IN PVOID event)) -{ - __Internal_Engine::ProcessEvent((SDL_Event *) event); -} \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/EventManager.cpp b/Engine/Src/Imp/CPP/EventManager.cpp new file mode 100644 index 0000000..542c969 --- /dev/null +++ b/Engine/Src/Imp/CPP/EventManager.cpp @@ -0,0 +1,66 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID EventManager::Initialize() + { + } + + VOID EventManager::Terminate() + { + } + + VOID EventManager::OnSDLEvent(IN SDL_Event *event) + { + } +} // namespace ia::iae + +namespace ia::iae +{ + Handle Engine::CreateEvent(IN CONST String &name) + { + return INVALID_HANDLE; + } + + VOID Engine::DestroyEvent(IN Handle event) + { + } + + Handle Engine::GetEventByName(IN CONST String &name) + { + return INVALID_HANDLE; + } + + VOID Engine::AddEventListener(IN Handle event, IN std::function callback) + { + } + + VOID Engine::AddEventListener(IN CONST String &eventName, IN std::function callback) + { + } + + VOID Engine::BroadcastEvent(IN Handle event) + { + } + + VOID Engine::BroadcastEvent(IN CONST String &eventName) + { + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/InputManager.cpp b/Engine/Src/Imp/CPP/InputManager.cpp new file mode 100644 index 0000000..a74561b --- /dev/null +++ b/Engine/Src/Imp/CPP/InputManager.cpp @@ -0,0 +1,108 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID InputManager::Initialize() + { + } + + VOID InputManager::Terminate() + { + } + + VOID InputManager::OnSDLEvent(IN SDL_Event *event) + { + } +} + +namespace ia::iae +{ + Vec2 Engine::GetInputAxis() + { + return {}; + } + + VOID Engine::SwitchInputModeToText() + { + } + + VOID Engine::SwitchInputModeToAction() + { + } + + Vec2 Engine::GetInputPointerPosition() + { + return {}; + } + + BOOL Engine::IsInputKeyDown(IN InputKey key) + { + return false; + } + + BOOL Engine::WasInputKeyPressed(IN InputKey key) + { + return false; + } + + BOOL Engine::WasInputKeyReleased(IN InputKey key) + { + return false; + } + + BOOL Engine::IsInputActionDown(IN Handle action) + { + return false; + } + + BOOL Engine::WasInputActionPressed(IN Handle action) + { + return false; + } + + BOOL Engine::WasInputActionReleased(IN Handle action) + { + return false; + } + + BOOL Engine::IsInputActionDown(IN PCCHAR action) + { + return false; + } + + BOOL Engine::WasInputActionPressed(IN PCCHAR action) + { + return false; + } + + BOOL Engine::WasInputActionReleased(IN PCCHAR action) + { + return false; + } + + Handle Engine::BindInputAction(IN CONST String &name, IN InputKey key) + { + return INVALID_HANDLE; + } + + VOID Engine::BindInputAxis(IN InputKey upKey, IN InputKey downKey, IN InputKey leftKey, IN InputKey rightKey) + { + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/InternalEngine.cpp b/Engine/Src/Imp/CPP/InternalEngine.cpp new file mode 100644 index 0000000..f07081a --- /dev/null +++ b/Engine/Src/Imp/CPP/InternalEngine.cpp @@ -0,0 +1,159 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +GameFunctionTable g_gameFunctions{}; + +namespace ia::iae +{ + SDL_Window *g_windowHandle; + + VOID __Internal_Engine::Initialize() + { + IAE_LOG_INFO("Booting IAEngine for ", g_gameFunctions.GetName()); + + if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_GAMEPAD)) + THROW_UNKNOWN("Failed to intialize SDL: ", SDL_GetError()); + + if (!(g_windowHandle = SDL_CreateWindow(g_gameFunctions.GetName(), 800, 600, SDL_WINDOW_RESIZABLE))) + THROW_UNKNOWN("Failed to create the SDL window: ", SDL_GetError()); + + SDL_SetWindowResizable(g_windowHandle, false); + + const auto gameVersion = g_gameFunctions.GetVersion(); + SDL_SetAppMetadata(g_gameFunctions.GetName(), BuildString(gameVersion).c_str(), + g_gameFunctions.GetPackageName()); + + Time::Initialize(); + Random::Initialize(); + Renderer::Initialize(); + AudioManager::Initialize(); + EventManager::Initialize(); + InputManager::Initialize(); + ResourceManager::Initialize(); + WorldManager::Initialize(); + + g_gameFunctions.OnInitialize(); + } + + VOID __Internal_Engine::Terminate() + { + g_gameFunctions.OnTerminate(); + + WorldManager::Terminate(); + ResourceManager::Terminate(); + InputManager::Terminate(); + EventManager::Terminate(); + AudioManager::Terminate(); + Renderer::Terminate(); + Random::Terminate(); + Time::Terminate(); + + SDL_DestroyWindow(g_windowHandle); + + IAE_LOG_INFO("Shutting down IAEngine"); + } + + VOID __Internal_Engine::Iterate() + { + WorldManager::Update(); + + Renderer::BeginFrame(); + WorldManager::Draw(); + Renderer::EndFrame(); + } + + VOID __Internal_Engine::ProcessEvent(IN SDL_Event *event) + { + switch (event->type) + { + case SDL_EVENT_WINDOW_RESIZED: + Engine::ResizeDisplay(event->window.data1, event->window.data2); + break; + } + InputManager::OnSDLEvent(event); + EventManager::OnSDLEvent(event); + ImGui_ImplSDL3_ProcessEvent(event); + } +} // namespace ia::iae + +BOOL ValidateGameFunctionTable(IN GameFunctionTable gameFunctionTable) +{ + if (!gameFunctionTable.OnInitialize) + return false; + if (!gameFunctionTable.OnTerminate) + return false; + if (!gameFunctionTable.OnDebugDraw) + return false; + if (!gameFunctionTable.OnFixedUpdate) + return false; + if (!gameFunctionTable.OnUpdate) + return false; + if (!gameFunctionTable.OnResize) + return false; + if (!gameFunctionTable.GetName) + return false; + if (!gameFunctionTable.GetVersion) + return false; + if (!gameFunctionTable.GetPackageName) + return false; + if (!gameFunctionTable.GetDeveloperName) + return false; + if (!gameFunctionTable.GetPublisherName) + return false; + return true; +} + +C_DECL(IAE_DLL_API INT32 IAEngine_Run(IN GameFunctionTable gameFunctionTable)) +{ + if (!ValidateGameFunctionTable(gameFunctionTable)) + { + IAE_LOG_ERROR("Invalid game function table was passed to the engine. Exiting.."); + return -1; + } + g_gameFunctions = gameFunctionTable; + + __Internal_Engine::Initialize(); + + SDL_Event event{}; + while(true) + { + SDL_PollEvent(&event); + if (event.type == SDL_EVENT_QUIT) + break; + __Internal_Engine::ProcessEvent(&event); + __Internal_Engine::Iterate(); + } + + __Internal_Engine::Terminate(); + + return 0; +} diff --git a/Engine/Src/Imp/CPP/Random.cpp b/Engine/Src/Imp/CPP/Random.cpp index e69de29..9cfd5ab 100644 --- a/Engine/Src/Imp/CPP/Random.cpp +++ b/Engine/Src/Imp/CPP/Random.cpp @@ -0,0 +1,29 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID Random::Initialize() + { + } + + VOID Random::Terminate() + { + } +} \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/DebugDraw.cpp b/Engine/Src/Imp/CPP/Renderer/DebugDraw.cpp new file mode 100644 index 0000000..a5c5ec6 --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/DebugDraw.cpp @@ -0,0 +1,110 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include +#include + +#include + +#include +#include + +namespace ia::iae +{ + EXTERN SDL_Window *g_windowHandle; + + ImGuiIO g_imGUIIO{}; + + VOID DebugDraw::Initialize() + { + const auto mainScale = SDL_GetDisplayContentScale(SDL_GetPrimaryDisplay()); + + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + g_imGUIIO = ImGui::GetIO(); + g_imGUIIO.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; + g_imGUIIO.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; + + ImGui::StyleColorsClassic(); + + ImGuiStyle &style = ImGui::GetStyle(); + style.ScaleAllSizes(mainScale); + style.FontScaleDpi = mainScale; + + ImGui_ImplSDLGPU3_InitInfo initInfo{.Device = Renderer::GetDevice(), + .ColorTargetFormat = + Renderer::GetRenderTargetFormat(), + .PresentMode = SDL_GPU_PRESENTMODE_VSYNC}; + ImGui_ImplSDL3_InitForSDLGPU(g_windowHandle); + ImGui_ImplSDLGPU3_Init(&initInfo); + } + + VOID DebugDraw::Terminate() + { + ImGui_ImplSDL3_Shutdown(); + ImGui_ImplSDLGPU3_Shutdown(); + ImGui::DestroyContext(); + } + + VOID DebugDraw::Render() + { + ImGui_ImplSDLGPU3_NewFrame(); + ImGui_ImplSDL3_NewFrame(); + ImGui::NewFrame(); + + WorldManager::DebugDraw(); + + ImGui::Render(); + } +} // namespace ia::iae + +namespace ia::iae +{ + struct State + { + ImU32 ActiveColor{0xFFFFFFFF}; + FLOAT32 ActiveStrokeWidth{1.0f}; + } g_debugDrawState{}; + + VOID Engine::DebugDraw_SetColor(IN Color color) + { + g_debugDrawState.ActiveColor = IM_COL32(color.R, color.G, color.B, color.A); + } + + VOID Engine::DebugDraw_StrokeWidth(IN FLOAT32 width) + { + g_debugDrawState.ActiveStrokeWidth = width; + } + + VOID Engine::DebugDraw_Line(IN Vec2 from, IN Vec2 to) + { + const auto drawList = ImGui::GetForegroundDrawList(); + drawList->AddLine(ImVec2(from.x, from.y), ImVec2(to.x, to.y), g_debugDrawState.ActiveColor, g_debugDrawState.ActiveStrokeWidth); + } + + VOID Engine::DebugDraw_FillRect(IN Vec2 position, IN Vec2 size) + { + const auto drawList = ImGui::GetForegroundDrawList(); + drawList->AddRectFilled(ImVec2(position.x, position.y), ImVec2(position.x + size.x, position.y + size.y), g_debugDrawState.ActiveColor); + } + + VOID Engine::DebugDraw_StrokeRect(IN Vec2 position, IN Vec2 size) + { + const auto drawList = ImGui::GetForegroundDrawList(); + drawList->AddRect(ImVec2(position.x, position.y), ImVec2(position.x + size.x, position.y + size.y), g_debugDrawState.ActiveColor, g_debugDrawState.ActiveStrokeWidth); + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/GPUResourceManager.cpp b/Engine/Src/Imp/CPP/Renderer/GPUResourceManager.cpp new file mode 100644 index 0000000..353ad3c --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/GPUResourceManager.cpp @@ -0,0 +1,148 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include +#include + +namespace ia::iae +{ + SDL_GPUSampler *g_linearClampSampler{}; + SDL_GPUSampler *g_linearRepeatSampler{}; + + VOID GPUResourceManager::Initialize() + { + { // Create Samplers + SDL_GPUSamplerCreateInfo createInfo{.min_filter = SDL_GPU_FILTER_LINEAR, + .mag_filter = SDL_GPU_FILTER_LINEAR, + .mipmap_mode = SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, + .address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + .address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + .address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + .enable_anisotropy = false}; + + g_linearClampSampler = SDL_CreateGPUSampler(Renderer::GetDevice(), &createInfo); + + createInfo.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + createInfo.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + createInfo.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + + g_linearRepeatSampler = SDL_CreateGPUSampler(Renderer::GetDevice(), &createInfo); + } + } + + VOID GPUResourceManager::Terminate() + { + SDL_ReleaseGPUSampler(Renderer::GetDevice(), g_linearClampSampler); + SDL_ReleaseGPUSampler(Renderer::GetDevice(), g_linearRepeatSampler); + } + + SDL_GPUSampler *GPUResourceManager::GetSampler_LinearClamp() + { + return g_linearClampSampler; + } + + SDL_GPUSampler *GPUResourceManager::GetSampler_LinearRepeat() + { + return g_linearRepeatSampler; + } + + SDL_GPUTexture *GPUResourceManager::CreateTexture(IN SDL_GPUTextureUsageFlags usage, IN INT32 width, + IN INT32 height, IN PCUINT8 rgbaData, + IN SDL_GPUTextureFormat format) + { + SDL_GPUTextureCreateInfo createInfo{.type = SDL_GPU_TEXTURETYPE_2D, + .format = format, + .usage = usage, + .width = (UINT32) width, + .height = (UINT32) height, + .layer_count_or_depth = 1, + .num_levels = 1, + .sample_count = SDL_GPU_SAMPLECOUNT_1}; + const auto result = SDL_CreateGPUTexture(Renderer::GetDevice(), &createInfo); + if (!result) + { + THROW_UNKNOWN("Failed to create a SDL GPU Texture: ", SDL_GetError()); + return nullptr; + } + if (rgbaData) + { + SDL_GPUTransferBufferCreateInfo stagingBufferCreateInfo{.usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + .size = (UINT32) width * (UINT32) height * 4}; + const auto stagingBuffer = SDL_CreateGPUTransferBuffer(Renderer::GetDevice(), &stagingBufferCreateInfo); + const auto mappedPtr = SDL_MapGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer, false); + SDL_memcpy(mappedPtr, rgbaData, width * height * 4); + SDL_UnmapGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer); + + const auto cmdBuffer = SDL_AcquireGPUCommandBuffer(Renderer::GetDevice()); + const auto copyPass = SDL_BeginGPUCopyPass(cmdBuffer); + + SDL_GPUTextureTransferInfo transferInfo{.transfer_buffer = stagingBuffer, .offset = 0}; + SDL_GPUTextureRegion region{.texture = result, .w = (UINT32) width, .h = (UINT32) height, .d = 1}; + SDL_UploadToGPUTexture(copyPass, &transferInfo, ®ion, false); + + SDL_EndGPUCopyPass(copyPass); + SDL_SubmitGPUCommandBuffer(cmdBuffer); + SDL_WaitForGPUIdle(Renderer::GetDevice()); + SDL_ReleaseGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer); + } + return result; + } + + SDL_GPUBuffer *GPUResourceManager::CreateDeviceLocalBuffer(IN SDL_GPUBufferUsageFlags usage, IN PCVOID data, + IN UINT32 dataSize) + { + SDL_GPUBufferCreateInfo createInfo{.usage = usage, .size = dataSize}; + const auto result = SDL_CreateGPUBuffer(Renderer::GetDevice(), &createInfo); + if (!result) + { + THROW_UNKNOWN("Failed to create a SDL GPU Buffer: ", SDL_GetError()); + return nullptr; + } + if(dataSize && dataSize) + { + SDL_GPUTransferBufferCreateInfo stagingBufferCreateInfo{.usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + .size = dataSize}; + const auto stagingBuffer = SDL_CreateGPUTransferBuffer(Renderer::GetDevice(), &stagingBufferCreateInfo); + const auto mappedPtr = SDL_MapGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer, false); + SDL_memcpy(mappedPtr, data, dataSize); + SDL_UnmapGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer); + + const auto cmdBuffer = SDL_AcquireGPUCommandBuffer(Renderer::GetDevice()); + const auto copyPass = SDL_BeginGPUCopyPass(cmdBuffer); + + SDL_GPUTransferBufferLocation src{.transfer_buffer = stagingBuffer, .offset = 0}; + SDL_GPUBufferRegion dst{.buffer = result, .offset = 0, .size = dataSize}; + SDL_UploadToGPUBuffer(copyPass, &src, &dst, false); + + SDL_EndGPUCopyPass(copyPass); + SDL_SubmitGPUCommandBuffer(cmdBuffer); + SDL_WaitForGPUIdle(Renderer::GetDevice()); + SDL_ReleaseGPUTransferBuffer(Renderer::GetDevice(), stagingBuffer); + } + return result; + } + + VOID GPUResourceManager::DestroyTexture(IN SDL_GPUTexture *handle) + { + SDL_ReleaseGPUTexture(Renderer::GetDevice(), handle); + } + + VOID GPUResourceManager::DestroyBuffer(IN SDL_GPUBuffer *handle) + { + SDL_ReleaseGPUBuffer(Renderer::GetDevice(), handle); + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/Pipeline.cpp b/Engine/Src/Imp/CPP/Renderer/Pipeline.cpp new file mode 100644 index 0000000..9dbc1b4 --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/Pipeline.cpp @@ -0,0 +1,108 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include +#include + +namespace ia::iae +{ + Pipeline::Pipeline(IN CONST StageDesc &vertexStageDesc, IN CONST StageDesc &pixelStageDesc, + IN BOOL enableVertexBuffer, IN BOOL enableDepthTest) + { + SDL_GPUShader *vertexShader{}; + SDL_GPUShader *pixelShader{}; + + SDL_GPUShaderCreateInfo shaderCreateInfo = { + .entrypoint = "main", + .format = SDL_GPU_SHADERFORMAT_SPIRV, + .num_storage_textures = 0, + .num_storage_buffers = 0, + }; + + shaderCreateInfo.stage = SDL_GPU_SHADERSTAGE_VERTEX; + shaderCreateInfo.code = vertexStageDesc.SourceData; + shaderCreateInfo.code_size = vertexStageDesc.SourceLength; + shaderCreateInfo.num_samplers = vertexStageDesc.SamplerCount; + shaderCreateInfo.num_uniform_buffers = vertexStageDesc.UniformBufferCount; + if (!(vertexShader = SDL_CreateGPUShader(Renderer::GetDevice(), &shaderCreateInfo))) + THROW_UNKNOWN("Failed to create a SDL shader: ", SDL_GetError()); + + shaderCreateInfo.stage = SDL_GPU_SHADERSTAGE_FRAGMENT; + shaderCreateInfo.code = pixelStageDesc.SourceData; + shaderCreateInfo.code_size = pixelStageDesc.SourceLength; + shaderCreateInfo.num_samplers = pixelStageDesc.SamplerCount; + shaderCreateInfo.num_uniform_buffers = pixelStageDesc.UniformBufferCount; + if (!(pixelShader = SDL_CreateGPUShader(Renderer::GetDevice(), &shaderCreateInfo))) + THROW_UNKNOWN("Failed to create a SDL shader: ", SDL_GetError()); + + SDL_GPUColorTargetDescription colorTargetDesc = { + .format = Renderer::GetRenderTargetFormat(), + }; + + SDL_GPUVertexBufferDescription vertexBufferDesc = { + .slot = 0, + .pitch = sizeof(GeometryVertex), + .input_rate = SDL_GPU_VERTEXINPUTRATE_VERTEX, + .instance_step_rate = 0, + }; + + SDL_GPUVertexAttribute vertexAttributes[] = { + {.location = 0, .buffer_slot = 0, .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, .offset = 0}, + {.location = 1, + .buffer_slot = 0, + .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + .offset = sizeof(glm::vec2)}, + {.location = 2, + .buffer_slot = 0, + .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + .offset = sizeof(glm::vec4)}, + }; + + SDL_GPUGraphicsPipelineCreateInfo createInfo = { + .vertex_shader = vertexShader, + .fragment_shader = pixelShader, + .vertex_input_state = SDL_GPUVertexInputState{.vertex_buffer_descriptions = &vertexBufferDesc, + .num_vertex_buffers = enableVertexBuffer ? (UINT32) 1 : 0, + .vertex_attributes = vertexAttributes, + .num_vertex_attributes = enableVertexBuffer ? (UINT32) 3 : 0}, + .primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + .rasterizer_state = SDL_GPURasterizerState{.fill_mode = SDL_GPU_FILLMODE_FILL, + .cull_mode = SDL_GPU_CULLMODE_NONE, + .front_face = SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE}, + .depth_stencil_state = SDL_GPUDepthStencilState{.compare_op = SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + .write_mask = 0xFF, + .enable_depth_test = enableDepthTest, + .enable_depth_write = enableDepthTest, + .enable_stencil_test = false}, + .target_info = {.color_target_descriptions = &colorTargetDesc, + .num_color_targets = 1, + .depth_stencil_format = SDL_GPU_TEXTUREFORMAT_D16_UNORM, + .has_depth_stencil_target = enableDepthTest}, + }; + + if(!(m_handle = SDL_CreateGPUGraphicsPipeline(Renderer::GetDevice(), &createInfo))) + THROW_UNKNOWN("Failed to create a SDL graphics pipeline: ", SDL_GetError()); + + SDL_ReleaseGPUShader(Renderer::GetDevice(), pixelShader); + SDL_ReleaseGPUShader(Renderer::GetDevice(), vertexShader); + } + + Pipeline::~Pipeline() + { + SDL_ReleaseGPUGraphicsPipeline(Renderer::GetDevice(), m_handle); + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/Renderer.cpp b/Engine/Src/Imp/CPP/Renderer/Renderer.cpp new file mode 100644 index 0000000..bf8ce73 --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/Renderer.cpp @@ -0,0 +1,257 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include +#include +#include + +#include +#include + +namespace ia::iae +{ + EXTERN SDL_Window *g_windowHandle; + + INT32 Renderer::s_screenWidth{}; + INT32 Renderer::s_screenHeight{}; + Renderer::State Renderer::s_state{}; + SDL_GPUDevice *Renderer::s_gpuDevice{}; + + SDL_GPUTexture *Renderer::s_renderTargetSceneColor{}; + SDL_GPUTexture *Renderer::s_renderTargetSceneDepth{}; + SDL_GPUTexture *Renderer::s_renderTargetDebugDrawColor{}; + + Pipeline *Renderer::s_geometryPipeline{}; + Pipeline *Renderer::s_postprocessPipeline{}; + + VOID Renderer::Initialize() + { + SDL_GetWindowSizeInPixels(g_windowHandle, &s_screenWidth, &s_screenHeight); + + if (!(s_gpuDevice = SDL_CreateGPUDevice(SDL_GPU_SHADERFORMAT_SPIRV, Engine::IsDebugMode(), nullptr))) + THROW_UNKNOWN("Failed to create the SDL GPU Device: ", SDL_GetError()); + + if (!SDL_ClaimWindowForGPUDevice(s_gpuDevice, g_windowHandle)) + THROW_UNKNOWN("Failed to initialize SDL GPU for the window: ", SDL_GetError()); + + SDL_SetGPUSwapchainParameters(s_gpuDevice, g_windowHandle, SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_PRESENTMODE_VSYNC); + + GPUResourceManager::Initialize(); + + // Initialize Render Targets + s_renderTargetSceneDepth = + GPUResourceManager::CreateTexture(SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, s_screenWidth, s_screenHeight, + nullptr, SDL_GPU_TEXTUREFORMAT_D16_UNORM); + s_renderTargetSceneColor = GPUResourceManager::CreateTexture( + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | SDL_GPU_TEXTUREUSAGE_SAMPLER, s_screenWidth, s_screenHeight, nullptr, + SDL_GetGPUSwapchainTextureFormat(s_gpuDevice, g_windowHandle)); + s_renderTargetDebugDrawColor = GPUResourceManager::CreateTexture( + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | SDL_GPU_TEXTUREUSAGE_SAMPLER, s_screenWidth, s_screenHeight, nullptr, + SDL_GetGPUSwapchainTextureFormat(s_gpuDevice, g_windowHandle)); + + // Initialize Pipelines + s_geometryPipeline = new Pipeline( + Pipeline::StageDesc{ + .SourceData = SHADER_SOURCE_GEOMETRY_VERT, + .SourceLength = sizeof(SHADER_SOURCE_GEOMETRY_VERT), + .SamplerCount = 0, + .UniformBufferCount = 3, + }, + Pipeline::StageDesc{ + .SourceData = SHADER_SOURCE_GEOMETRY_FRAG, + .SourceLength = sizeof(SHADER_SOURCE_GEOMETRY_FRAG), + .SamplerCount = 1, + .UniformBufferCount = 1, + }, + true, true); + s_postprocessPipeline = new Pipeline( + Pipeline::StageDesc{ + .SourceData = SHADER_SOURCE_POSTPROCESS_VERT, + .SourceLength = sizeof(SHADER_SOURCE_POSTPROCESS_VERT), + .SamplerCount = 0, + .UniformBufferCount = 0, + }, + Pipeline::StageDesc{ + .SourceData = SHADER_SOURCE_POSTPROCESS_FRAG, + .SourceLength = sizeof(SHADER_SOURCE_POSTPROCESS_FRAG), + .SamplerCount = 2, + .UniformBufferCount = 0, + }, + false, false); + + DebugDraw::Initialize(); + + s_state.ProjectionMatrix = + glm::orthoLH(0.0f, (FLOAT32) s_screenWidth, (FLOAT32) s_screenHeight, 0.0f, -2097152.0f, 2097152.0f); + + s_state.ColorTargetInfo.clear_color = SDL_FColor{0.33f, 0.33f, 0.33f, 1.0f}; + s_state.ColorTargetInfo.load_op = SDL_GPU_LOADOP_CLEAR; + s_state.ColorTargetInfo.store_op = SDL_GPU_STOREOP_STORE; + + s_state.DepthStencilTargetInfo.cycle = true; + s_state.DepthStencilTargetInfo.clear_depth = 0; + s_state.DepthStencilTargetInfo.clear_stencil = 0; + s_state.DepthStencilTargetInfo.load_op = SDL_GPU_LOADOP_CLEAR; + s_state.DepthStencilTargetInfo.store_op = SDL_GPU_STOREOP_STORE; + s_state.DepthStencilTargetInfo.stencil_load_op = SDL_GPU_LOADOP_CLEAR; + s_state.DepthStencilTargetInfo.stencil_store_op = SDL_GPU_STOREOP_STORE; + } + + VOID Renderer::Terminate() + { + SDL_WaitForGPUIdle(s_gpuDevice); + + DebugDraw::Terminate(); + + delete s_geometryPipeline; + delete s_postprocessPipeline; + + GPUResourceManager::DestroyTexture(s_renderTargetSceneDepth); + GPUResourceManager::DestroyTexture(s_renderTargetSceneColor); + GPUResourceManager::DestroyTexture(s_renderTargetDebugDrawColor); + + GPUResourceManager::Terminate(); + + SDL_ReleaseWindowFromGPUDevice(s_gpuDevice, g_windowHandle); + SDL_DestroyGPUDevice(s_gpuDevice); + } + + VOID Renderer::BeginFrame() + { + if (!(s_state.ActiveCommandBuffer = SDL_AcquireGPUCommandBuffer(s_gpuDevice))) + THROW_UNKNOWN("Failed to acquire SDL GPU command buffer: ", SDL_GetError()); + + s_state.ColorTargetInfo.texture = s_renderTargetSceneColor; + s_state.DepthStencilTargetInfo.texture = s_renderTargetSceneDepth; + s_state.ActiveRenderPass = SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1, + &s_state.DepthStencilTargetInfo); + + SDL_BindGPUGraphicsPipeline(s_state.ActiveRenderPass, s_geometryPipeline->GetHandle()); + SDL_PushGPUVertexUniformData(s_state.ActiveCommandBuffer, 0, &s_state.ProjectionMatrix, sizeof(Mat4)); + //SDL_PushGPUVertexUniformData(s_state.ActiveCommandBuffer, 1, s_state.ActiveCamera->GetMatrix(), sizeof(Mat4)); + } + + VOID Renderer::EndFrame() + { + SDL_EndGPURenderPass(s_state.ActiveRenderPass); + + DebugDraw::Render(); + const auto imDrawData = ImGui::GetDrawData(); + ImGui_ImplSDLGPU3_PrepareDrawData(imDrawData, s_state.ActiveCommandBuffer); + s_state.ColorTargetInfo.texture = s_renderTargetDebugDrawColor; + s_state.ActiveRenderPass = + SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1, nullptr); + ImGui_ImplSDLGPU3_RenderDrawData(imDrawData, s_state.ActiveCommandBuffer, s_state.ActiveRenderPass); + SDL_EndGPURenderPass(s_state.ActiveRenderPass); + + SDL_GPUTexture *swapChainTexture{}; + if (!SDL_WaitAndAcquireGPUSwapchainTexture(s_state.ActiveCommandBuffer, g_windowHandle, &swapChainTexture, + (PUINT32) &s_screenWidth, (PUINT32) &s_screenHeight)) + THROW_UNKNOWN("Failed to acquire SDL GPU Swapchain texture: ", SDL_GetError()); + + if (!swapChainTexture) + return; + + s_state.ColorTargetInfo.texture = swapChainTexture; + + s_state.ActiveRenderPass = + SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1, nullptr); + SDL_BindGPUGraphicsPipeline(s_state.ActiveRenderPass, s_postprocessPipeline->GetHandle()); + SDL_GPUTextureSamplerBinding textureBindings[2] = { + {.texture = s_renderTargetSceneColor, .sampler = GPUResourceManager::GetSampler_LinearRepeat()}, + {.texture = s_renderTargetDebugDrawColor, .sampler = GPUResourceManager::GetSampler_LinearRepeat()}, + }; + SDL_BindGPUFragmentSamplers(s_state.ActiveRenderPass, 0, textureBindings, 2); + SDL_DrawGPUPrimitives(s_state.ActiveRenderPass, 6, 1, 0, 0); + SDL_EndGPURenderPass(s_state.ActiveRenderPass); + + SDL_SubmitGPUCommandBuffer(s_state.ActiveCommandBuffer); + } + + VOID Renderer::OnScreenResize(IN INT32 newWidth, IN INT32 newHeight) + { + + } + + SDL_GPUTextureFormat Renderer::GetRenderTargetFormat() + { + return SDL_GetGPUSwapchainTextureFormat(s_gpuDevice, g_windowHandle); + } +} // namespace ia::iae + +namespace ia::iae +{ + VOID Engine::SetActiveCamera(IN ICameraComponent *cameraComponent) + { + Renderer::s_state.ActiveCamera = cameraComponent; + } + + Handle Engine::CreateGeometry(IN CONST Vector &vertices, IN CONST Vector &indices) + { + return INVALID_HANDLE; + } + + VOID Engine::DestroyGeometry(IN Handle geometry) + { + } + + VOID Engine::DrawGeometry(IN Handle handle) + { + } + + VOID Engine::SetRenderState_Scissor(IN IVec4 rect) + { + Renderer::s_state.Scissor = rect.z ? SDL_Rect{0, 0, Renderer::s_screenWidth, Renderer::s_screenHeight} + : SDL_Rect{rect.x, rect.y, rect.z, rect.w}; + } + + VOID Engine::SetRenderState_FlippedH(IN BOOL value) + { + Renderer::s_state.FlippedH = value; + } + + VOID Engine::SetRenderState_FlippedV(IN BOOL value) + { + Renderer::s_state.FlippedV = value; + } + + VOID Engine::SetRenderState_TextureOffset(IN Vec2 off) + { + Renderer::s_state.TextureOffset = off; + } + + VOID Engine::SetRenderState_ColorOverlay(IN Color color) + { + Renderer::s_state.ColorOverlay = color; + } + + VOID Engine::SetRenderState_CameraRelative(IN BOOL value) + { + Renderer::s_state.CameraRelative = value; + } + + VOID Engine::SetRenderState_Texture(IN Handle image) + { + Renderer::s_state.ActiveTexture = image; + } + + VOID Engine::SetRenderState_Transform(IN Vec2 position, IN Vec2 scale, IN FLOAT32 rotation, IN UINT8 layer, + IN INT16 sortIndex) + { + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/UIRenderer.cpp b/Engine/Src/Imp/CPP/Renderer/UIRenderer.cpp new file mode 100644 index 0000000..9bd5675 --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/UIRenderer.cpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Renderer/imgui.ini b/Engine/Src/Imp/CPP/Renderer/imgui.ini new file mode 100644 index 0000000..9930887 --- /dev/null +++ b/Engine/Src/Imp/CPP/Renderer/imgui.ini @@ -0,0 +1,4 @@ +[Window][Debug##Default] +Pos=60,60 +Size=400,400 + diff --git a/Engine/Src/Imp/CPP/ResourceManager.cpp b/Engine/Src/Imp/CPP/ResourceManager.cpp new file mode 100644 index 0000000..4b57016 --- /dev/null +++ b/Engine/Src/Imp/CPP/ResourceManager.cpp @@ -0,0 +1,65 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID ResourceManager::Initialize() + { + } + + VOID ResourceManager::Terminate() + { + } +} + +namespace ia::iae +{ + Handle Engine::CreateImage() + { + return INVALID_HANDLE; + } + + Handle Engine::CreateSound() + { + return INVALID_HANDLE; + } + + VOID Engine::DestroyImage(IN Handle image) + { + } + + VOID Engine::DestroySound(IN Handle sound) + { + } + + Vec2 Engine::GetImageExtent(IN Handle image) + { + return {}; + } + + VOID Engine::RescaleImage(IN Handle image, IN INT32 newWidth, IN INT32 newHeight) + { + } + + Handle Engine::CombineImages(IN CONST Vector &images, IN INT32 unitWidth, IN INT32 unitHeight, + IN INT32 unitCountX, IN INT32 unitCountY) + { + return INVALID_HANDLE; + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/Time.cpp b/Engine/Src/Imp/CPP/Time.cpp index e69de29..f1324a6 100644 --- a/Engine/Src/Imp/CPP/Time.cpp +++ b/Engine/Src/Imp/CPP/Time.cpp @@ -0,0 +1,29 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID Time::Initialize() + { + } + + VOID Time::Terminate() + { + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/WorldManager.cpp b/Engine/Src/Imp/CPP/WorldManager.cpp new file mode 100644 index 0000000..bc5a5ac --- /dev/null +++ b/Engine/Src/Imp/CPP/WorldManager.cpp @@ -0,0 +1,92 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +namespace ia::iae +{ + VOID WorldManager::Initialize() + { + } + + VOID WorldManager::Terminate() + { + } + + VOID WorldManager::Draw() + { + } + + VOID WorldManager::DebugDraw() + { + Engine::DebugDraw_FillRect({0.0f, 0.0f}, {100.0f, 100.0f}); + } + + VOID WorldManager::Update() + { + } +} // namespace ia::iae + +namespace ia::iae +{ + Handle Engine::CreatePhysicsBody() + { + return INVALID_HANDLE; + } + + VOID Engine::DestroyPhysicsBody(IN Handle body) + { + } + + VOID Engine::SetTimeScale(IN FLOAT32 scale) + { + } + + Handle Engine::CreateScene() + { + return INVALID_HANDLE; + } + + VOID Engine::DestroyScene(IN Handle handle) + { + } + + VOID Engine::ChangeActiveScene(IN Handle scene) + { + } + + VOID Engine::AddNodeToActiveScene(IN RefPtr node) + { + } + + INode *Engine::GetNodeFromActiveScene(IN CONST String &name) + { + return nullptr; + } + + VOID Engine::RemoveNodeFromActiveScene(IN CONST String &name) + { + } + + VOID Engine::AddNodeToScene(IN Handle scene, IN RefPtr node) + { + } + + VOID Engine::RemoveNodeFromScene(IN Handle scene, IN CONST String &name) + { + } +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/CPP/imgui.ini b/Engine/Src/Imp/CPP/imgui.ini new file mode 100644 index 0000000..9930887 --- /dev/null +++ b/Engine/Src/Imp/CPP/imgui.ini @@ -0,0 +1,4 @@ +[Window][Debug##Default] +Pos=60,60 +Size=400,400 + diff --git a/Engine/Src/Imp/HPP/AudioManager.hpp b/Engine/Src/Imp/HPP/AudioManager.hpp new file mode 100644 index 0000000..ae6ef57 --- /dev/null +++ b/Engine/Src/Imp/HPP/AudioManager.hpp @@ -0,0 +1,31 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class AudioManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/EventManager.hpp b/Engine/Src/Imp/HPP/EventManager.hpp new file mode 100644 index 0000000..bef6a56 --- /dev/null +++ b/Engine/Src/Imp/HPP/EventManager.hpp @@ -0,0 +1,33 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class EventManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC VOID OnSDLEvent(IN SDL_Event* event); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/InputManager.hpp b/Engine/Src/Imp/HPP/InputManager.hpp new file mode 100644 index 0000000..8ddc7ac --- /dev/null +++ b/Engine/Src/Imp/HPP/InputManager.hpp @@ -0,0 +1,33 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class InputManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC VOID OnSDLEvent(IN SDL_Event* event); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Engine.hpp b/Engine/Src/Imp/HPP/InternalEngine.hpp similarity index 100% rename from Engine/Src/Imp/HPP/Engine.hpp rename to Engine/Src/Imp/HPP/InternalEngine.hpp diff --git a/Engine/Src/Imp/HPP/Random.hpp b/Engine/Src/Imp/HPP/Random.hpp index e69de29..0bdc413 100644 --- a/Engine/Src/Imp/HPP/Random.hpp +++ b/Engine/Src/Imp/HPP/Random.hpp @@ -0,0 +1,31 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class Random + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp b/Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp new file mode 100644 index 0000000..7a5a66e --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp @@ -0,0 +1,32 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include +#include + +namespace ia::iae +{ + class DebugDraw + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC VOID Render(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp b/Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp new file mode 100644 index 0000000..0aa29d3 --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp @@ -0,0 +1,154 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// ---------------------------------------------------------------------- +// GENERATED FILE. DO NOT EDIT. +// ---------------------------------------------------------------------- + +#pragma once + +#include + +/* +------------------------------------------------- + Geometry.vert +------------------------------------------------- + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout (location = 0) in vec2 inPosition; +layout (location = 1) in vec2 inTexCoord; +layout (location = 2) in vec4 inVertexColor; + +layout(location = 0) out vec2 outTexCoord; +layout(location = 1) out vec4 outVertexColor; + +layout(set = 1, binding = 0) uniform UBO_Vertex_PerScene { + mat4 projection; +} uboPerScene; +layout(set = 1, binding = 1) uniform UBO_Vertex_PerFrame { + mat4 view; +} uboPerFrame; +layout(set = 1, binding = 2) uniform UBO_Vertex_PerDraw { + mat4 model; +} uboPerDraw; + +void main() +{ + gl_Position = uboPerScene.projection * uboPerFrame.view * uboPerDraw.model * vec4(inPosition, 0.0f, 1.0f); + outTexCoord = inTexCoord; + outVertexColor = inVertexColor; +} + +*/ + +/* +------------------------------------------------- + Geometry.frag +------------------------------------------------- + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 0) in vec2 inTexCoord; +layout(location = 1) in vec4 inVertexColor; + +layout(location = 0) out vec4 outColor; + +layout(set = 2, binding = 0) uniform sampler2D texSampler; +layout(set = 3, binding = 0) uniform UniformBufferObject { + bool flippedH; + bool flippedV; + vec2 uvOffset; + vec4 colorOverlay; +} ubo; + +void main() +{ + vec2 uv = inTexCoord; + uv += ubo.uvOffset; + if(ubo.flippedH) uv.x = 1.0 - uv.x; + if(ubo.flippedV) uv.y = 1.0 - uv.y; + outColor = texture(texSampler, uv) * inVertexColor * ubo.colorOverlay; + if(outColor.w < 0.1) + discard; +} + +*/ + +/* +------------------------------------------------- + PostProcess.vert +------------------------------------------------- + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 0) out vec2 outTexCoord; + +void main() +{ + outTexCoord = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); + gl_Position = vec4(outTexCoord * 2.0f - 1.0f, 0.0f, 1.0f); +} +*/ + +/* +------------------------------------------------- + PostProcess.frag +------------------------------------------------- + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 0) in vec2 inTexCoord; + +layout(set = 2, binding = 0) uniform sampler2D sceneDrawTexture; +layout(set = 2, binding = 1) uniform sampler2D debugDrawTexture; + +layout(location = 0) out vec4 outColor; + +vec4 overlay(vec4 background, vec4 foreground) { + return mix( + 2.0 * background * foreground, + 1.0 - 2.0 * (1.0 - background) * (1.0 - foreground), + step(0.5, background) + ); +} + +void main() +{ + vec2 uv = vec2(inTexCoord.x, 1.0 - inTexCoord.y); + outColor = overlay(texture(debugDrawTexture, uv), texture(sceneDrawTexture, uv)); +} +*/ + +namespace ia::iae +{ +CONSTEXPR UINT8 SHADER_SOURCE_GEOMETRY_VERT[2092] = { +0x3,0x2,0x23,0x7,0x0,0x0,0x1,0x0,0xb,0x0,0xd,0x0,0x37,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0xb,0x0,0x6,0x0,0x1,0x0,0x0,0x0,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,0x0,0x0,0x0,0x0,0xe,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xf,0x0,0xb,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x6d,0x61,0x69,0x6e,0x0,0x0,0x0,0x0,0xd,0x0,0x0,0x0,0x25,0x0,0x0,0x0,0x30,0x0,0x0,0x0,0x31,0x0,0x0,0x0,0x33,0x0,0x0,0x0,0x35,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x2,0x0,0x0,0x0,0xc2,0x1,0x0,0x0,0x4,0x0,0x9,0x0,0x47,0x4c,0x5f,0x41,0x52,0x42,0x5f,0x73,0x65,0x70,0x61,0x72,0x61,0x74,0x65,0x5f,0x73,0x68,0x61,0x64,0x65,0x72,0x5f,0x6f,0x62,0x6a,0x65,0x63,0x74,0x73,0x0,0x0,0x4,0x0,0xa,0x0,0x47,0x4c,0x5f,0x47,0x4f,0x4f,0x47,0x4c,0x45,0x5f,0x63,0x70,0x70,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5f,0x6c,0x69,0x6e,0x65,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x76,0x65,0x0,0x0,0x4,0x0,0x8,0x0,0x47,0x4c,0x5f,0x47,0x4f,0x4f,0x47,0x4c,0x45,0x5f,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x76,0x65,0x0,0x5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p/HPP/Renderer/GPUResourceManager.hpp new file mode 100644 index 0000000..47528da --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/GPUResourceManager.hpp @@ -0,0 +1,38 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include +#include + +namespace ia::iae +{ + class GPUResourceManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC SDL_GPUSampler *GetSampler_LinearClamp(); + STATIC SDL_GPUSampler *GetSampler_LinearRepeat(); + + STATIC SDL_GPUTexture *CreateTexture(IN SDL_GPUTextureUsageFlags usage, IN INT32 width, IN INT32 height, IN PCUINT8 rgbaData = nullptr, IN SDL_GPUTextureFormat format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM); + STATIC SDL_GPUBuffer *CreateDeviceLocalBuffer(IN SDL_GPUBufferUsageFlags usage, IN PCVOID data, IN UINT32 dataSize); + STATIC VOID DestroyTexture(IN SDL_GPUTexture *handle); + STATIC VOID DestroyBuffer(IN SDL_GPUBuffer *handle); + }; +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Renderer/Pipeline.hpp b/Engine/Src/Imp/HPP/Renderer/Pipeline.hpp new file mode 100644 index 0000000..3cf5663 --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/Pipeline.hpp @@ -0,0 +1,48 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class Pipeline + { + public: + struct StageDesc + { + PCUINT8 SourceData{}; + UINT64 SourceLength{}; + UINT32 SamplerCount{}; + UINT32 UniformBufferCount{}; + }; + + public: + Pipeline(IN CONST StageDesc &vertexStageDesc, IN CONST StageDesc &pixelStageDesc, IN BOOL enableVertexBuffer, IN BOOL enableDepthTest); + ~Pipeline(); + + SDL_GPUGraphicsPipeline *GetHandle() CONST + { + return m_handle; + } + + private: + SDL_GPUGraphicsPipeline *m_handle{}; + }; +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Renderer/Renderer.hpp b/Engine/Src/Imp/HPP/Renderer/Renderer.hpp new file mode 100644 index 0000000..0ace78f --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/Renderer.hpp @@ -0,0 +1,86 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include +#include + +namespace ia::iae +{ + class Renderer + { + public: + struct Mesh + { + INT32 IndexCount{}; + SDL_GPUBuffer *IndexBuffer; + SDL_GPUBuffer *VertexBuffer; + }; + + struct State + { + BOOL FlippedH{false}; + BOOL FlippedV{false}; + BOOL CameraRelative{true}; + BOOL ScissorEnabled{false}; + Color ColorOverlay{}; + Vec2 TextureOffset{0.0f, 0.0f}; + SDL_Rect Scissor{0, 0, 0, 0}; + Handle ActiveTexture{INVALID_HANDLE}; + + Mat4 ModelMatrix{1.0f}; + Mat4 ProjectionMatrix{1.0f}; + + SDL_GPURenderPass* ActiveRenderPass{}; + SDL_GPUCommandBuffer* ActiveCommandBuffer{}; + SDL_GPUColorTargetInfo ColorTargetInfo{}; + SDL_GPUDepthStencilTargetInfo DepthStencilTargetInfo{}; + + class ICameraComponent *ActiveCamera{}; + }; + + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC VOID BeginFrame(); + STATIC VOID EndFrame(); + + STATIC VOID OnScreenResize(IN INT32 newWidth, IN INT32 newHeight); + + public: + STATIC SDL_GPUTextureFormat GetRenderTargetFormat(); + + STATIC SDL_GPUDevice *GetDevice() + { + return s_gpuDevice; + } + + private: + STATIC State s_state; + STATIC INT32 s_screenWidth; + STATIC INT32 s_screenHeight; + STATIC SDL_GPUDevice *s_gpuDevice; + STATIC SDL_GPUTexture *s_renderTargetSceneColor; + STATIC SDL_GPUTexture *s_renderTargetSceneDepth; + STATIC SDL_GPUTexture *s_renderTargetDebugDrawColor; + STATIC Pipeline* s_geometryPipeline; + STATIC Pipeline* s_postprocessPipeline; + + friend class Engine; + }; +} // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp b/Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp new file mode 100644 index 0000000..e23e3f5 --- /dev/null +++ b/Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/ResourceManager.hpp b/Engine/Src/Imp/HPP/ResourceManager.hpp new file mode 100644 index 0000000..e3c919c --- /dev/null +++ b/Engine/Src/Imp/HPP/ResourceManager.hpp @@ -0,0 +1,31 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class ResourceManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/Time.hpp b/Engine/Src/Imp/HPP/Time.hpp index e69de29..be7aef9 100644 --- a/Engine/Src/Imp/HPP/Time.hpp +++ b/Engine/Src/Imp/HPP/Time.hpp @@ -0,0 +1,31 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class Time + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Imp/HPP/WorldManager.hpp b/Engine/Src/Imp/HPP/WorldManager.hpp new file mode 100644 index 0000000..b35e393 --- /dev/null +++ b/Engine/Src/Imp/HPP/WorldManager.hpp @@ -0,0 +1,36 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +#include + +namespace ia::iae +{ + class WorldManager + { + public: + STATIC VOID Initialize(); + STATIC VOID Terminate(); + + STATIC VOID Draw(); + STATIC VOID DebugDraw(); + + STATIC VOID Update(); + }; +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Base.hpp b/Engine/Src/Inc/IAEngine/Base.hpp index 5f18283..7df7556 100644 --- a/Engine/Src/Inc/IAEngine/Base.hpp +++ b/Engine/Src/Inc/IAEngine/Base.hpp @@ -16,24 +16,24 @@ #pragma once +#include #include -#include #include #include -#include +#include -#include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include #define IAE_LOG_TAG "[IAE]: " -#define IAE_LOG_INFO(...) ia::Logger::Info(IAE_LOG_TAG, __VA_ARGS__) -#define IAE_LOG_WARN(...) ia::Logger::Warn(IAE_LOG_TAG, __VA_ARGS__) +#define IAE_LOG_INFO(...) ia::Logger::Info(IAE_LOG_TAG, __VA_ARGS__) +#define IAE_LOG_WARN(...) ia::Logger::Warn(IAE_LOG_TAG, __VA_ARGS__) #define IAE_LOG_ERROR(...) ia::Logger::Error(IAE_LOG_TAG, __VA_ARGS__) namespace ia::iae @@ -44,6 +44,34 @@ namespace ia::iae using Vec2 = glm::vec2; using Vec3 = glm::vec3; using Vec4 = glm::vec4; + using IVec2 = glm::ivec2; + using IVec3 = glm::ivec3; + using IVec4 = glm::ivec4; + using Mat4 = glm::mat4; + + struct TimePeriod + { + }; + + struct ImageView + { + Handle Image{}; + Vec4 Scissor{}; + }; + + struct SoundView + { + Handle Sound{}; + INT32 LoopTimes{}; + TimePeriod LoopDelay{}; + }; + + struct GeometryVertex + { + Vec2 Position{}; + Vec2 TexCoord{}; + Vec4 Color{}; + }; struct Color { @@ -51,7 +79,235 @@ namespace ia::iae UINT8 G{0xFF}; UINT8 B{0xFF}; UINT8 A{0xFF}; + }; - + /* Adopted from SDL3 */ + enum class InputKey : UINT8 + { + UNKNOWN = 0, + A = 4, + B = 5, + C = 6, + D = 7, + E = 8, + F = 9, + G = 10, + H = 11, + I = 12, + J = 13, + K = 14, + L = 15, + M = 16, + N = 17, + O = 18, + P = 19, + Q = 20, + R = 21, + S = 22, + T = 23, + U = 24, + V = 25, + W = 26, + X = 27, + Y = 28, + Z = 29, + + N1 = 30, + N2 = 31, + N3 = 32, + N4 = 33, + N5 = 34, + N6 = 35, + N7 = 36, + N8 = 37, + N9 = 38, + N0 = 39, + + RETURN = 40, + ESCAPE = 41, + BACKSPACE = 42, + TAB = 43, + SPACE = 44, + + MINUS = 45, + EQUALS = 46, + LEFTBRACKET = 47, + RIGHTBRACKET = 48, + BACKSLASH = 49, + NONUSHASH = 50, + SEMICOLON = 51, + APOSTROPHE = 52, + GRAVE = 53, + COMMA = 54, + PERIOD = 55, + SLASH = 56, + + CAPSLOCK = 57, + + F1 = 58, + F2 = 59, + F3 = 60, + F4 = 61, + F5 = 62, + F6 = 63, + F7 = 64, + F8 = 65, + F9 = 66, + F10 = 67, + F11 = 68, + F12 = 69, + + K_PRINTSCREEN = 70, + K_SCROLLLOCK = 71, + K_PAUSE = 72, + K_INSERT = 73, + K_HOME = 74, + K_PAGEUP = 75, + K_DELETE = 76, + K_END = 77, + K_PAGEDOWN = 78, + K_RIGHT = 79, + K_LEFT = 80, + K_DOWN = 81, + K_UP = 82, + + NUMLOCKCLEAR = 83, + KP_DIVIDE = 84, + KP_MULTIPLY = 85, + KP_MINUS = 86, + KP_PLUS = 87, + KP_ENTER = 88, + KP_1 = 89, + KP_2 = 90, + KP_3 = 91, + KP_4 = 92, + KP_5 = 93, + KP_6 = 94, + KP_7 = 95, + KP_8 = 96, + KP_9 = 97, + KP_0 = 98, + KP_PERIOD = 99, + + NONUSBACKSLASH = 100, + APPLICATION = 101, + POWER = 102, + KP_EQUALS = 103, + F13 = 104, + F14 = 105, + F15 = 106, + F16 = 107, + F17 = 108, + F18 = 109, + F19 = 110, + F20 = 111, + F21 = 112, + F22 = 113, + F23 = 114, + F24 = 115, + EXECUTE = 116, + HELP = 117, + MENU = 118, + SELECT = 119, + STOP = 120, + AGAIN = 121, + UNDO = 122, + CUT = 123, + COPY = 124, + PASTE = 125, + FIND = 126, + MUTE = 127, + VOLUMEUP = 128, + VOLUMEDOWN = 129, + + KP_COMMA = 133, + KP_EQUALSAS400 = 134, + + INTERNATIONAL1 = 135, + INTERNATIONAL2 = 136, + INTERNATIONAL3 = 137, + INTERNATIONAL4 = 138, + INTERNATIONAL5 = 139, + INTERNATIONAL6 = 140, + INTERNATIONAL7 = 141, + INTERNATIONAL8 = 142, + INTERNATIONAL9 = 143, + LANG1 = 144, + LANG2 = 145, + LANG3 = 146, + LANG4 = 147, + LANG5 = 148, + LANG6 = 149, + LANG7 = 150, + LANG8 = 151, + LANG9 = 152, + + ALTERASE = 153, + SYSREQ = 154, + CANCEL = 155, + CLEAR = 156, + PRIOR = 157, + RETURN2 = 158, + SEPARATOR = 159, + OPER = 161, + CLEARAGAIN = 162, + CRSEL = 163, + EXSEL = 164, + + KP_00 = 176, + KP_000 = 177, + THOUSANDSSEPARATOR = 178, + DECIMALSEPARATOR = 179, + CURRENCYUNIT = 180, + CURRENCYSUBUNIT = 181, + KP_LEFTPAREN = 182, + KP_RIGHTPAREN = 183, + KP_LEFTBRACE = 184, + KP_RIGHTBRACE = 185, + KP_TAB = 186, + KP_BACKSPACE = 187, + KP_A = 188, + KP_B = 189, + KP_C = 190, + KP_D = 191, + KP_E = 192, + KP_F = 193, + KP_XOR = 194, + KP_POWER = 195, + KP_PERCENT = 196, + KP_LESS = 197, + KP_GREATER = 198, + KP_AMPERSAND = 199, + KP_DBLAMPERSAND = 200, + KP_VERTICALBAR = 201, + KP_DBLVERTICALBAR = 202, + KP_COLON = 203, + KP_HASH = 204, + KP_SPACE = 205, + KP_AT = 206, + KP_EXCLAM = 207, + KP_MEMSTORE = 208, + KP_MEMRECALL = 209, + KP_MEMCLEAR = 210, + KP_MEMADD = 211, + KP_MEMSUBTRACT = 212, + KP_MEMMULTIPLY = 213, + KP_MEMDIVIDE = 214, + KP_PLUSMINUS = 215, + KP_CLEAR = 216, + KP_CLEARENTRY = 217, + KP_BINARY = 218, + KP_OCTAL = 219, + KP_DECIMAL = 220, + KP_HEXADECIMAL = 221, + + LCTRL = 224, + LSHIFT = 225, + LALT = 226, + LGUI = 227, + RCTRL = 228, + RSHIFT = 229, + RALT = 230, + RGUI = 231, }; } // namespace ia::iae \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Components/CameraComponent.hpp b/Engine/Src/Inc/IAEngine/Components/CameraComponent.hpp new file mode 100644 index 0000000..1d4b7ec --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Components/CameraComponent.hpp @@ -0,0 +1,27 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + struct ICameraComponent: public IComponent + { + PURE_VIRTUAL(Mat4* GetMatrix() CONST); + }; +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Components/IComponent.hpp b/Engine/Src/Inc/IAEngine/Components/IComponent.hpp new file mode 100644 index 0000000..5828ba4 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Components/IComponent.hpp @@ -0,0 +1,29 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + class INode; + + struct IComponent + { + INode* Node{}; + }; +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Engine.hpp b/Engine/Src/Inc/IAEngine/Engine.hpp index 1ef79b0..e92248a 100644 --- a/Engine/Src/Inc/IAEngine/Engine.hpp +++ b/Engine/Src/Inc/IAEngine/Engine.hpp @@ -16,52 +16,11 @@ #pragma once -#include +#include +#include namespace ia::iae { - using InputKey = UINT8; - - struct TimePeriod - { - - }; - - struct INode - { - String Name{}; - }; - - struct IComponent - { - - }; - - struct ICameraComponent: public IComponent - { - - }; - - struct ImageView - { - Handle Image{}; - Vec4 Scissor{}; - }; - - struct SoundView - { - Handle Sound{}; - INT32 LoopTimes{}; - TimePeriod LoopDelay{}; - }; - - struct GeometryVertex - { - Vec2 Position{}; - Vec2 TexCoord{}; - Vec4 Color{}; - }; - class Engine { public: @@ -85,13 +44,12 @@ namespace ia::iae STATIC VOID ResizeDisplay(IN INT32 newWidth, IN INT32 newHeight); // Renderer State Functions - STATIC VOID SetRenderState_Scissor(IN Vec4 rect); + STATIC VOID SetRenderState_Scissor(IN IVec4 rect); STATIC VOID SetRenderState_FlippedH(IN BOOL value); STATIC VOID SetRenderState_FlippedV(IN BOOL value); STATIC VOID SetRenderState_TextureOffset(IN Vec2 off); STATIC VOID SetRenderState_ColorOverlay(IN Color color); STATIC VOID SetRenderState_CameraRelative(IN BOOL value); - STATIC VOID SetRenderState_ScissorEnabled(IN BOOL value); STATIC VOID SetRenderState_Texture(IN Handle image); STATIC VOID SetRenderState_Transform(IN Vec2 position, IN Vec2 scale, IN FLOAT32 rotation, IN UINT8 layer, IN INT16 sortIndex); @@ -151,5 +109,8 @@ namespace ia::iae STATIC INT64 GetUnixSecond(); STATIC INT64 GetUnixMillisecond(); STATIC FLOAT32 GetFrameDeltaTime(); + + // Engine Functions + STATIC BOOL IsDebugMode(); }; } \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/EngineInterface.hpp b/Engine/Src/Inc/IAEngine/EngineLibraryInterface.hpp similarity index 75% rename from Engine/Src/Inc/IAEngine/EngineInterface.hpp rename to Engine/Src/Inc/IAEngine/EngineLibraryInterface.hpp index 6713d34..494f058 100644 --- a/Engine/Src/Inc/IAEngine/EngineInterface.hpp +++ b/Engine/Src/Inc/IAEngine/EngineLibraryInterface.hpp @@ -16,7 +16,7 @@ #pragma once -#include +#include #if defined(__BUILDING_IAENGINE) && (__BUILDING_IAENGINE) #define IAE_DLL_API IA_DLL_EXPORT @@ -24,7 +24,4 @@ #define IAE_DLL_API IA_DLL_IMPORT #endif -C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnInitialize(IN GameFunctionTable gameFunctionTable)); -C_DECL(IAE_DLL_API ia::VOID IAEngine_OnTerminate()); -C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnIterate()); -C_DECL(IAE_DLL_API ia::VOID IAEngine_OnEvent(IN PVOID event)); +C_DECL(IAE_DLL_API INT32 IAEngine_Run(IN GameFunctionTable gameFunctionTable)); diff --git a/Engine/Src/Inc/IAEngine/GameInterface.hpp b/Engine/Src/Inc/IAEngine/GameLibraryInterface.hpp similarity index 100% rename from Engine/Src/Inc/IAEngine/GameInterface.hpp rename to Engine/Src/Inc/IAEngine/GameLibraryInterface.hpp diff --git a/Engine/Src/Inc/IAEngine/Nodes/INode.hpp b/Engine/Src/Inc/IAEngine/Nodes/INode.hpp new file mode 100644 index 0000000..94919f7 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/INode.hpp @@ -0,0 +1,27 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + struct INode + { + String Name{}; + }; +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/Node2D.hpp b/Engine/Src/Inc/IAEngine/Nodes/Node2D.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/Node2D.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/SpriteNode.hpp b/Engine/Src/Inc/IAEngine/Nodes/SpriteNode.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/SpriteNode.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/SpriteObjectNode.hpp b/Engine/Src/Inc/IAEngine/Nodes/SpriteObjectNode.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/SpriteObjectNode.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/TextureNode.hpp b/Engine/Src/Inc/IAEngine/Nodes/TextureNode.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/TextureNode.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/TextureObjectNode.hpp b/Engine/Src/Inc/IAEngine/Nodes/TextureObjectNode.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/TextureObjectNode.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Engine/Src/Inc/IAEngine/Nodes/UINode.hpp b/Engine/Src/Inc/IAEngine/Nodes/UINode.hpp new file mode 100644 index 0000000..0d4d965 --- /dev/null +++ b/Engine/Src/Inc/IAEngine/Nodes/UINode.hpp @@ -0,0 +1,24 @@ +// IAEngine: 2D Game Engine by IA +// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +namespace ia::iae +{ + +} \ No newline at end of file diff --git a/Runtime/Windows/Src/Imp/CPP/Main.cpp b/Runtime/Windows/Src/Imp/CPP/Main.cpp index ab4e3ab..56e7a6a 100644 --- a/Runtime/Windows/Src/Imp/CPP/Main.cpp +++ b/Runtime/Windows/Src/Imp/CPP/Main.cpp @@ -1,61 +1,34 @@ #define WIN32_LEAN_AND_MEAN #include -#define SDL_MAIN_USE_CALLBACKS - #include -#include -#include +#include -SDL_AppResult SDL_AppIterate(void *appstate) -{ - IAEngine_OnIterate(); - return SDL_APP_CONTINUE; -} - -SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) -{ - switch (event->type) { - case SDL_EVENT_QUIT: - return SDL_APP_SUCCESS; - } - IAEngine_OnEvent(event); - return SDL_APP_CONTINUE; -} - -SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) +int main(int argc, char* argv[]) { GameFunctionTable gameFunctionTable{}; const auto gameLib = LoadLibrary("Game.dll"); - if(!gameLib) + if (!gameLib) { IAE_LOG_ERROR("Failed to load the dynamic library \"Game.dll\". Please make sure it exists."); return SDL_APP_FAILURE; } - gameFunctionTable.OnInitialize = (VOID(*)())GetProcAddress(gameLib, "Game_OnInitialize"); - gameFunctionTable.OnTerminate = (VOID(*)())GetProcAddress(gameLib, "Game_OnTerminate"); - gameFunctionTable.OnDebugDraw = (VOID(*)())GetProcAddress(gameLib, "Game_OnDebugDraw"); - gameFunctionTable.OnFixedUpdate = (VOID(*)())GetProcAddress(gameLib, "Game_OnFixedUpdate"); - gameFunctionTable.OnUpdate = (VOID(*)(IN FLOAT32 deltaTime))GetProcAddress(gameLib, "Game_OnUpdate"); - gameFunctionTable.OnResize = (VOID(*)(IN INT32 newWidth, IN INT32 newHeight))GetProcAddress(gameLib, "Game_OnResize"); - - gameFunctionTable.GetName = (PCCHAR(*)())GetProcAddress(gameLib, "Game_GetName"); - gameFunctionTable.GetVersion = (UINT64(*)())GetProcAddress(gameLib, "Game_GetVersion"); - gameFunctionTable.GetPackageName = (PCCHAR(*)())GetProcAddress(gameLib, "Game_GetPackageName"); - gameFunctionTable.GetDeveloperName = (PCCHAR(*)())GetProcAddress(gameLib, "Game_GetDeveloperName"); - gameFunctionTable.GetPublisherName = (PCCHAR(*)())GetProcAddress(gameLib, "Game_GetPublisherName"); + gameFunctionTable.OnInitialize = (VOID (*)()) GetProcAddress(gameLib, "Game_OnInitialize"); + gameFunctionTable.OnTerminate = (VOID (*)()) GetProcAddress(gameLib, "Game_OnTerminate"); + gameFunctionTable.OnDebugDraw = (VOID (*)()) GetProcAddress(gameLib, "Game_OnDebugDraw"); + gameFunctionTable.OnFixedUpdate = (VOID (*)()) GetProcAddress(gameLib, "Game_OnFixedUpdate"); + gameFunctionTable.OnUpdate = (VOID (*)(IN FLOAT32 deltaTime)) GetProcAddress(gameLib, "Game_OnUpdate"); + gameFunctionTable.OnResize = + (VOID (*)(IN INT32 newWidth, IN INT32 newHeight)) GetProcAddress(gameLib, "Game_OnResize"); - if(!IAEngine_OnInitialize(gameFunctionTable)) - return SDL_APP_FAILURE; + gameFunctionTable.GetName = (PCCHAR (*)()) GetProcAddress(gameLib, "Game_GetName"); + gameFunctionTable.GetVersion = (UINT64 (*)()) GetProcAddress(gameLib, "Game_GetVersion"); + gameFunctionTable.GetPackageName = (PCCHAR (*)()) GetProcAddress(gameLib, "Game_GetPackageName"); + gameFunctionTable.GetDeveloperName = (PCCHAR (*)()) GetProcAddress(gameLib, "Game_GetDeveloperName"); + gameFunctionTable.GetPublisherName = (PCCHAR (*)()) GetProcAddress(gameLib, "Game_GetPublisherName"); - return SDL_APP_CONTINUE; -} - -void SDL_AppQuit(void *appstate, SDL_AppResult result) -{ - IAEngine_OnTerminate(); - SDL_Quit(); + return IAEngine_Run(gameFunctionTable); } \ No newline at end of file diff --git a/Samples/SpaceInvaders/Src/Imp/HPP/Game.hpp b/Samples/SpaceInvaders/Src/Imp/HPP/Game.hpp index b87c3f4..20de7b3 100644 --- a/Samples/SpaceInvaders/Src/Imp/HPP/Game.hpp +++ b/Samples/SpaceInvaders/Src/Imp/HPP/Game.hpp @@ -16,5 +16,5 @@ #pragma once -#include +#include diff --git a/Vendor/IACore b/Vendor/IACore index b38dc22..66299a7 160000 --- a/Vendor/IACore +++ b/Vendor/IACore @@ -1 +1 @@ -Subproject commit b38dc220be3948778e3c9233a42da5269aa02600 +Subproject commit 66299a7cafbda745f270a1cd9f823a6b21452703