diff --git a/editor/Editor.cpp b/editor/Editor.cpp index b5d337f29..c4e5fe818 100644 --- a/editor/Editor.cpp +++ b/editor/Editor.cpp @@ -111,7 +111,7 @@ Editor::Editor(const vector& args) // register imgui as a third party library (will show up in the about window) spartan::Settings::RegisterThirdPartyLib("ImGui", IMGUI_VERSION, "https://github.com/ocornut/imgui"); - EditorWindows::Initialize(this); + GeneralWindows::Initialize(this); } Editor::~Editor() @@ -159,7 +159,7 @@ void Editor::Tick() ImGui::End(); // various windows that don't belnog to a certain widget - EditorWindows::Tick(); + GeneralWindows::Tick(); } } diff --git a/editor/EditorWindows.cpp b/editor/EditorWindows.cpp index 27830ad99..e52b5526f 100644 --- a/editor/EditorWindows.cpp +++ b/editor/EditorWindows.cpp @@ -40,62 +40,50 @@ namespace { Editor* editor = nullptr; - namespace introduction + namespace sponsor { - bool visible = true; + bool visible = true; + const float width = 512.0f; void window() { - const float width = 600.0f; - const float height = 240.0f; - - ImVec2 display_size = ImGui::GetIO().DisplaySize; - ImVec2 window_pos = ImVec2((display_size.x - width) * 0.15f, (display_size.y - height) * 0.45f); - ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always); - ImGui::SetNextWindowSize(ImVec2(width, height), ImGuiCond_Always); - - if (ImGui::Begin("What should you expect", &visible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)) + ImGui::SetNextWindowSize(ImVec2(width, width * 0.52f)); + if (ImGui::Begin("Support Spartan Engine", &visible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoDocking)) { - ImGui::TextWrapped("This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans looking to experiment."); + ImGui::SetNextItemWidth(width); + ImGui::TextWrapped( + "I cover the costs for Dropbox hosting and a GitHub Pro subscription for benefits like assets and package bandwidth." + "" + "If you enjoy the simplicity of running a single script and have everything just work, please consider sponsoring to help keep everything running smoothly!" + ); + ImGui::Separator(); + if (ImGuiSp::button_centered_on_line("Sponsor")) + { + spartan::FileSystem::OpenUrl("https://github.com/sponsors/PanosK92"); + } } ImGui::End(); } } - namespace sponsor + namespace introduction { - bool visible = true; + bool visible = true; + const float width = 512.0f; void window() { - const float width = 600.0f; - const float height = 240.0f; - - ImVec2 display_size = ImGui::GetIO().DisplaySize; - ImVec2 window_pos = ImVec2((display_size.x - width) * 0.15f, (display_size.y - height) * 0.3f); - ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always); - ImGui::SetNextWindowSize(ImVec2(width, height), ImGuiCond_Always); - - // set focus - if (ImGui::Begin("Support Spartan Engine", &visible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)) + ImGui::SetNextWindowSize(ImVec2(width, width * 0.36f)); + if (ImGui::Begin("What should you expect", &visible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoDocking)) { - ImGui::TextWrapped( - "I cover the costs for Dropbox hosting and a GitHub Pro subscription for benefits like assets and package bandwidth." - " " - "If you enjoy the simplicity of running a single script and have everything just work, please consider sponsoring to help keep everything running smoothly!" - ); - + ImGui::TextWrapped("This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans."); ImGui::Separator(); - - float button_width = ImGui::CalcTextSize("Sponsor").x + ImGui::GetStyle().FramePadding.x * 2.0f; - float window_width = ImGui::GetWindowSize().x; - ImGui::SetCursorPosX((window_width - button_width) * 0.5f); - - if (ImGui::Button("Sponsor")) + if (ImGuiSp::button_centered_on_line("Ok")) { - spartan::FileSystem::OpenUrl("https://github.com/sponsors/PanosK92"); + visible = false; } - } + } + ImGui::End(); } } @@ -134,14 +122,12 @@ namespace "Spartan, Panos Kolyvakis, Greece, LinkedIn, https://www.linkedin.com/in/panos-kolyvakis-66863421a/, Improved water buoyancy, N/A", "Spartan, Tri Tran, Belgium, LinkedIn, https://www.linkedin.com/in/mtrantr/, Days Gone screen space shadows, Starfield", "Spartan, Ege, Turkey, X, https://x.com/egedq, Editor theme & ability to save/load themes, N/A", - "Hoplite, Apostolos Bouzalas, Greece, LinkedIn, https://www.linkedin.com/in/apostolos-bouzalas, Provided performance reports, N/A", "Hoplite, Nikolas Pattakos, Greece, LinkedIn, https://www.linkedin.com/in/nikolaspattakos/, GCC compile fixes, N/A", "Hoplite, Sandro Mtchedlidze, Georgia, Artstation, https://www.artstation.com/sandromch, Added Nautilus tonemapper & spotted lighting/performance issues, N/A", "Hoplite, Roman Koshchei, Ukraine, X, https://x.com/roman_koshchei, Circular stack for the undo/redo system, N/A", "Hoplite, Kristi Kercyku, Albania, GitHub, https://github.com/kristiker, Identified g-buffer depth testing issue, N/A", "Hoplite, Kinjal Kishor, India, X, https://x.com/kinjalkishor, Supported with testing & technical issues, N/A", - "Patron, Kiss Tibor, Hungary, GitHub, https://github.com/kisstp2006, GitHub Sponsor, N/A" }; @@ -527,7 +513,7 @@ namespace } } -void EditorWindows::Initialize(Editor* editor_in) +void GeneralWindows::Initialize(Editor* editor_in) { editor = editor_in; @@ -540,18 +526,18 @@ void EditorWindows::Initialize(Editor* editor_in) default_worlds::visible = default_worlds::downloaded; } -void EditorWindows::Tick() +void GeneralWindows::Tick() { - // visibility + // windows { - if (introduction::visible) + if (sponsor::visible) { - introduction::window(); + sponsor::window(); } - if (sponsor::visible) + if (introduction::visible) { - sponsor::window(); + introduction::window(); } if (about::visible) @@ -576,12 +562,12 @@ void EditorWindows::Tick() } } -bool* EditorWindows::GetVisiblityWindowAbout() +bool* GeneralWindows::GetVisiblityWindowAbout() { return &about::visible; } -bool* EditorWindows::GetVisiblityWindowShortcuts() +bool* GeneralWindows::GetVisiblityWindowShortcuts() { return &shortcuts::visible; } diff --git a/editor/EditorWindows.h b/editor/EditorWindows.h index 7099b03fe..34a5ae6ef 100644 --- a/editor/EditorWindows.h +++ b/editor/EditorWindows.h @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. class Editor; -class EditorWindows +class GeneralWindows { public: static void Initialize(Editor* editor); diff --git a/editor/MenuBar.cpp b/editor/MenuBar.cpp index 9c1d4a396..6f8701ff0 100644 --- a/editor/MenuBar.cpp +++ b/editor/MenuBar.cpp @@ -155,7 +155,7 @@ namespace { if (ImGui::BeginMenu("View")) { - if (ImGui::MenuItem("Shortcuts & Input Reference", "Ctrl+P", EditorWindows::GetVisiblityWindowShortcuts())) + if (ImGui::MenuItem("Shortcuts & Input Reference", "Ctrl+P", GeneralWindows::GetVisiblityWindowShortcuts())) { } @@ -193,7 +193,7 @@ namespace { if (ImGui::BeginMenu("Help")) { - ImGui::MenuItem("About", nullptr, EditorWindows::GetVisiblityWindowAbout()); + ImGui::MenuItem("About", nullptr, GeneralWindows::GetVisiblityWindowAbout()); if (ImGui::MenuItem("Sponsor", nullptr, nullptr)) { diff --git a/readme.md b/readme.md index a3b67bd91..4adee0305 100644 --- a/readme.md +++ b/readme.md @@ -3,8 +3,7 @@

Spartan Engine is one of the most advanced one-man game engines out there, pushing the limits of real-time approaches. What started as a portfolio project has evolved into a cutting-edge project for developers to explore, learn, and contribute. -This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans -looking to experiment, not to build a game. With a thriving Discord community of over 500 members, including industry +This isn't an engine for the average user, it's designed for advanced research and experimentation, ideal for industry veterans, not for individuals to build a game. With a thriving Discord community of over 500 members, including industry veterans, and contribution perks that you won't believe when you see, it's one of the most unique projects you'll come across.

- For occasional updates regarding the project's development, you can follow me on X. diff --git a/runtime/Rendering/Mesh.cpp b/runtime/Rendering/Mesh.cpp index d2bdd2615..8d79c50b9 100644 --- a/runtime/Rendering/Mesh.cpp +++ b/runtime/Rendering/Mesh.cpp @@ -116,9 +116,9 @@ namespace spartan uint32_t Mesh::GetMemoryUsage() const { - uint32_t size = 0; - size += uint32_t(m_indices.size() * sizeof(uint32_t)); - size += uint32_t(m_vertices.size() * sizeof(RHI_Vertex_PosTexNorTan)); + uint32_t size = 0; + size += uint32_t(m_indices.size() * sizeof(uint32_t)); + size += uint32_t(m_vertices.size() * sizeof(RHI_Vertex_PosTexNorTan)); return size; }