This commit is contained in:
Isuru Samarathunga
2025-11-10 09:49:22 +05:30
parent 73d26b2f35
commit 67cb23d589
69 changed files with 9716 additions and 194 deletions

View File

@ -23,7 +23,9 @@
#include <Vendor/imgui/backends/imgui_impl_sdl3.h>
#include <Vendor/imgui/backends/imgui_impl_sdlgpu3.h>
#include <UI.hpp>
#include <UI/UI.hpp>
#include <LogoIcon.hpp>
namespace ia::iae
{
@ -40,6 +42,11 @@ namespace ia::iae
IVec2 g_windowExtent{800, 600};
RDC_Texture *g_gamePreviewTexture{};
VOID Editor::LoadProject(IN CONST String &directory)
{
m_activeProject = Project::Load(directory);
}
INT32 Editor::Run(IN INT32 argc, IN PCCHAR argv[])
{
INT32 frameCounter{0};
@ -48,13 +55,42 @@ namespace ia::iae
THROW_UNKNOWN("Failed to intialize SDL: ", SDL_GetError());
if (!(g_windowHandle = SDL_CreateWindow("IAEngine", g_windowExtent.x, g_windowExtent.y,
SDL_WINDOW_RESIZABLE | SDL_WINDOW_MAXIMIZED)))
SDL_WINDOW_RESIZABLE)))
THROW_UNKNOWN("Failed to create the SDL window: ", SDL_GetError());
LoadProject(".");
SDL_SetWindowPosition(g_windowHandle, m_activeProject->WindowPosition().x, m_activeProject->WindowPosition().y);
SDL_MaximizeWindow(g_windowHandle);
SDL_GetWindowSizeInPixels(g_windowHandle, &g_windowExtent.x, &g_windowExtent.y);
g_designViewport = gamePreviewResolution;
IAEngine::__Initialize();
SDL_Surface* iconSurface = SDL_CreateSurface(
LOGO_ICON_WIDTH,
LOGO_ICON_HEIGHT,
SDL_PIXELFORMAT_RGBA32
);
if(iconSurface)
{
for(UINT32 i = 0; i < LOGO_ICON_WIDTH * LOGO_ICON_HEIGHT * 4; i += 4)
{
STATIC UINT32 p{0xFFFFFFFF};
const auto pixel = ((PUINT8)&p);
const auto pixels = (PUINT8)iconSurface->pixels;
LOGO_ICON_GET_PIXEL(LOGO_ICON_DATA, pixel);
pixels[i + 0] = pixel[0];
pixels[i + 1] = pixel[1];
pixels[i + 2] = pixel[2];
pixels[i + 3] = 0xFF;
}
SDL_SetWindowIcon(g_windowHandle, iconSurface);
SDL_DestroySurface(iconSurface);
}
SDL_SetWindowTitle(g_windowHandle, BuildString("IAEngine - ", m_activeProject->Name()).c_str());
g_designViewport = SCENE_EDITOR_RESOULTION;
IAEngine::__Initialize(m_activeProject->AssetDirectory());
g_gamePreviewTexture = new RDC_Texture(RDC_Texture::EType::SAMPLED, g_designViewport.x, g_designViewport.y);
@ -67,8 +103,6 @@ namespace ia::iae
imGUIIO.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
imGUIIO.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
ImGui::StyleColorsClassic();
ImGuiStyle &style = ImGui::GetStyle();
style.ScaleAllSizes(mainScale);
style.FontScaleDpi = mainScale;
@ -83,6 +117,8 @@ namespace ia::iae
fontConfig.MergeMode = true;
fontConfig.PixelSnapH = true;
fontConfig.FontDataOwnedByAtlas = false;
fontConfig.GlyphOffset.y = 1.5f;
fontConfig.SizePixels = 12.0f;
static const ImWchar icon_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
imGUIIO.Fonts->AddFontDefault();
@ -149,6 +185,11 @@ namespace ia::iae
RDC_Device::WaitForIdle();
}
IVec2 currentWindowPosition{};
SDL_GetWindowPosition(g_windowHandle, &currentWindowPosition.x, &currentWindowPosition.y);
m_activeProject->WindowPosition() = currentWindowPosition;
m_activeProject->Update();
UI::Terminate();
ImGui_ImplSDL3_Shutdown();
@ -163,9 +204,16 @@ namespace ia::iae
return 0;
}
} // namespace ia::iae
VOID Editor::LoadProject(IN CONST String &directory)
{
m_activeProject = Project::Load(directory);
}
} // namespace ia::iae
#include <IAEngine/LibInterface.hpp>
C_DECL(GameRequestedConfig* Game_GetConfigRequest()){
return nullptr;
}
C_DECL(VOID Game_OnInitialize()){}
C_DECL(VOID Game_OnTerminate()){}
C_DECL(VOID Game_OnDebugDraw()){}
C_DECL(VOID Game_OnFixedUpdate()){}
C_DECL(VOID Game_OnUpdate(IN FLOAT32 deltaTime)){}
C_DECL(VOID Game_OnResize(IN INT32 newWidth, IN INT32 newHeight)){}

View File

@ -15,21 +15,39 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <Project.hpp>
#include <ConfigData/ConfigData.hpp>
#include <filesystem>
namespace ia::iae
{
RefPtr<Project> Project::Load(IN CONST String &directory)
{
const auto config = ConfigData::LoadFromFile(BuildString(directory, "/", "Project.iae"));
return MakeRefPtr<Project>(config->Name(), std::filesystem::canonical(directory.c_str()).string().c_str());
auto config = ConfigData::LoadFromFile(BuildString(directory, "/", "Project.iae"));
return MakeRefPtr<Project>(config->Name(), std::filesystem::canonical(directory.c_str()).string().c_str(), IA_MOVE(config));
}
Project::Project(IN CONST String& name, IN CONST String& absolutePath):
m_projectName(name), m_projectAbsolutePath(absolutePath), m_assetDirectory(BuildString(absolutePath, "/Assets/"))
VOID Project::Update()
{
// Update Window Position
const auto windowNode = m_configData->Property("Window");
windowNode.attribute("x").set_value(m_windowPosition.x);
windowNode.attribute("y").set_value(m_windowPosition.y);
m_configData->WriteChangesToDisk();
}
Project::Project(IN CONST String &name, IN CONST String &absolutePath, IN RefPtr<ConfigData> &&configData)
: m_projectName(name), m_projectAbsolutePath(absolutePath),
m_assetDirectory(BuildString(absolutePath, "/Assets/")), m_configData(IA_MOVE(configData))
{
IA_ASSERT(std::filesystem::exists(m_assetDirectory.c_str()));
const auto windowNode = m_configData->Property("Window");
if(windowNode && windowNode.attribute("x") && windowNode.attribute("y"))
{
m_windowPosition.x = windowNode.attribute("x").as_int();
m_windowPosition.y = windowNode.attribute("y").as_int();
}
}
Project::~Project()

View File

@ -1,87 +0,0 @@
// 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 <https://www.gnu.org/licenses/>.
#include <IAEngine/IAEngine.hpp>
#include <RenderCore/RenderCore.hpp>
#include <SDL3/SDL.h>
#include <Vendor/imgui/backends/imgui_impl_sdl3.h>
#include <Vendor/imgui/backends/imgui_impl_sdlgpu3.h>
#include <UI.hpp>
#include <View/AssetBrowser.hpp>
namespace ia::iae
{
EXTERN IVec2 g_windowExtent;
EXTERN RDC_Texture *g_gamePreviewTexture;
View_AssetBrowser g_assetBrowserView;
VOID UI::Initialize()
{
g_assetBrowserView.Initialize();
}
VOID UI::Terminate()
{
g_assetBrowserView.Terminate();
}
VOID UI::Update()
{
}
VOID UI::Draw()
{
ImVec2 gamePreviewViewSize = {(FLOAT32) gamePreviewResolution.x, (FLOAT32) gamePreviewResolution.y};
{ // Scene Nodes View
ImGui::Begin("Nodes", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);
ImGui::SetWindowPos({0.0f, 0.0f});
ImGui::SetWindowSize({g_windowExtent.x / 2.0f - gamePreviewViewSize.x / 2.0f, gamePreviewViewSize.y + 35});
ImGui::End();
}
{ // Scene View
ImGui::Begin("Scene", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);
ImGui::SetWindowPos({g_windowExtent.x / 2.0f - gamePreviewViewSize.x / 2.0f, 0.0f});
ImGui::Image(g_gamePreviewTexture->GetHandle(), gamePreviewViewSize);
ImGui::End();
}
{ // Properties View
ImGui::Begin("Properties", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);
ImGui::SetWindowSize(
{g_windowExtent.x / 2.0f - gamePreviewViewSize.x / 2.0f - 15.0f, gamePreviewViewSize.y + 35});
ImGui::SetWindowPos({g_windowExtent.x - ImGui::GetWindowSize().x, 0.0f});
ImGui::End();
}
{ // Asset Browser View
ImGui::Begin("Asset Browser", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);
ImGui::SetWindowPos({0.0f, gamePreviewViewSize.y + 35});
ImGui::SetWindowSize({(FLOAT32) g_windowExtent.x, (FLOAT32) g_windowExtent.y - gamePreviewViewSize.y - 35});
g_assetBrowserView.Render();
ImGui::End();
}
}
} // namespace ia::iae::editor

View File

View File

@ -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 <https://www.gnu.org/licenses/>.
#include <IAEngine/IAEngine.hpp>
#include <RenderCore/RenderCore.hpp>
#include <UI/UI.hpp>
#include <UI/View/Main.hpp>
namespace ia::iae
{
View_Main g_mainView{};
VOID UI::Initialize()
{
g_mainView.Initialize();
}
VOID UI::Terminate()
{
g_mainView.Terminate();
}
VOID UI::Update()
{
}
VOID UI::Draw()
{
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("New Scene", nullptr, nullptr))
{
}
//padY();
if (ImGui::MenuItem("Open Scene", nullptr, nullptr))
{
}
//padY();
ImGui::Separator();
//padY();
if (ImGui::MenuItem("Exit", nullptr, nullptr))
SDL_Quit();
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}
g_mainView.Render();
}
} // namespace ia::iae

View File

@ -14,41 +14,24 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <GamePreview.hpp>
#include <RenderCore/RenderCore.hpp>
#include <UI/View/Asset.hpp>
namespace ia::iae
{
}
VOID View_Asset::Initialize()
{
SetName("Asset");
SetIcon(ICON_FA_STAR);
}
#include <IAEngine/LibInterface.hpp>
VOID View_Asset::Terminate()
{
}
C_DECL(GameRequestedConfig *Game_GetConfigRequest())
{
return nullptr;
}
VOID View_Asset::Render()
{
PreRender();
C_DECL(VOID Game_OnInitialize())
{
}
C_DECL(VOID Game_OnTerminate())
{
}
C_DECL(VOID Game_OnDebugDraw())
{
}
C_DECL(VOID Game_OnFixedUpdate())
{
}
C_DECL(VOID Game_OnUpdate(IN FLOAT32 deltaTime))
{
}
C_DECL(VOID Game_OnResize(IN INT32 newWidth, IN INT32 newHeight))
{
}
PostRender();
}
} // namespace ia::iae

View File

@ -14,12 +14,15 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <View/AssetBrowser.hpp>
#include <UI/View/AssetBrowser.hpp>
namespace ia::iae
{
VOID View_AssetBrowser::Initialize()
{
SetName("Asset Browser");
SetIcon(ICON_FA_BOX_OPEN);
if (!std::filesystem::exists("Assets"))
THROW_INVALID_DATA("Not a valid IAEngine project directory");
m_assetDirectoryPath = std::filesystem::current_path() / "Assets/";
@ -35,30 +38,49 @@ namespace ia::iae
{
PreRender();
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{7.5f, 7.5f});
if (ImGui::BeginTable("root", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingStretchProp))
{
ImGui::TableSetupColumn("Navigation", ImGuiTableColumnFlags_WidthStretch, 0.25f);
ImGui::TableSetupColumn("Asset Browser", ImGuiTableColumnFlags_WidthStretch, 0.75f);
ImGui::TableSetupColumn("Navigation", ImGuiTableColumnFlags_WidthStretch, 0.15f);
ImGui::TableSetupColumn("Asset Browser", ImGuiTableColumnFlags_WidthStretch, 0.85f);
ImGui::TableNextColumn();
if (ImGui::BeginChild("Navigation", ImVec2(0, -FLT_MIN)))
if (ImGui::BeginChild("Navigation", ImVec2(0, -FLT_MIN), ImGuiChildFlags_AlwaysUseWindowPadding))
{
for (const auto &t : m_assetDirectoryFiles)
{
ImGui::Text("%s %s", t.Icon, t.Name.c_str());
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 1.75f);
if (ImGui::Selectable(t.IconAndName.c_str()) && t.IsDirectory)
ChangeCurrentOpenDirectory(t.Path);
}
}
ImGui::EndChild();
ImGui::TableNextColumn();
if (ImGui::BeginChild("Asset Browser", ImVec2(0, -FLT_MIN)))
if (ImGui::BeginChild("Asset Browser", ImVec2(0, -FLT_MIN), ImGuiChildFlags_AlwaysUseWindowPadding))
{
for (const auto &t : m_currentOpenDirectoryFiles)
{
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 1.75f);
if (ImGui::Selectable(t.IconAndName.c_str()))
{
if (t.IsDirectory)
{
ChangeCurrentOpenDirectory(t.Path);
break;
}
OpenAsset(t.Path);
}
}
}
ImGui::EndChild();
ImGui::EndTable();
}
ImGui::PopStyleVar();
PostRender();
}
@ -66,17 +88,25 @@ namespace ia::iae
{
m_currentOpenDirectoryPath = path;
std::filesystem::current_path(m_currentOpenDirectoryPath);
FillFileEntries(m_currentOpenDirectoryPath, m_currentOpenDirectoryFiles);
if (path == m_assetDirectoryPath)
m_currentOpenDirectoryFiles.clear();
else
FillFileEntries(m_currentOpenDirectoryPath, m_currentOpenDirectoryFiles);
}
VOID View_AssetBrowser::FillFileEntries(IN CONST std::filesystem::path &path, IN Vector<FileEntry> &fileEntries)
{
fileEntries.clear();
for (const auto &t : std::filesystem::directory_iterator(path))
{
if (!t.is_directory())
continue;
fileEntries.pushBack(
{.Icon = ICON_FA_FOLDER, .Name = t.path().filename().string().c_str(), .IsDirectory = true});
fileEntries.pushBack({.Icon = ICON_FA_FOLDER,
.Name = t.path().filename().string().c_str(),
.IsDirectory = true,
.Path = t.path()});
fileEntries.back().IconAndName = BuildString(fileEntries.back().Icon, " ", fileEntries.back().Name);
}
for (const auto &t : std::filesystem::directory_iterator(path))
{
@ -84,14 +114,23 @@ namespace ia::iae
continue;
fileEntries.pushBack({.Icon = GetFileEntryIcon(t.path().extension().string().c_str()),
.Name = t.path().filename().string().c_str(),
.IsDirectory = false});
.IsDirectory = false,
.Path = t.path()});
fileEntries.back().IconAndName = BuildString(fileEntries.back().Icon, " ", fileEntries.back().Name);
}
}
PCCHAR View_AssetBrowser::GetFileEntryIcon(IN PCCHAR extension)
{
if(!strcmp(extension, ".xml"))
if (!strcmp(extension, ".xml"))
return ICON_FA_CODE;
return "";
if (!strcmp(extension, ".png") || !strcmp(extension, ".jpg"))
return ICON_FA_IMAGE;
return ICON_FA_FILE;
}
} // namespace ia::iae::editor
VOID View_AssetBrowser::OpenAsset(IN CONST std::filesystem::path &path)
{
}
} // namespace ia::iae

View File

@ -0,0 +1,37 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/Console.hpp>
namespace ia::iae
{
VOID View_Console::Initialize()
{
SetName("Console");
SetIcon(ICON_FA_TERMINAL);
}
VOID View_Console::Terminate()
{
}
VOID View_Console::Render()
{
PreRender();
PostRender();
}
} // namespace ia::iae

View File

@ -0,0 +1,161 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/AssetBrowser.hpp>
#include <UI/View/Main.hpp>
#include <UI/View/Scene.hpp>
#include <UI/View/Asset.hpp>
#include <UI/View/Console.hpp>
#include <UI/View/Nodes.hpp>
#include <UI/View/Package.hpp>
#include <UI/View/Properties.hpp>
namespace ia::iae
{
EXTERN IVec2 g_windowExtent;
View_Scene g_sceneView;
View_Asset g_assetView;
View_Console g_consoleView;
View_Nodes g_nodesView;
View_Package g_packageView;
View_Properties g_propertiesView;
View_AssetBrowser g_assetBrowserView;
Vector<IView *> g_bViews = {&g_assetBrowserView, &g_consoleView};
Vector<IView *> g_tlViews = {&g_nodesView, &g_packageView};
Vector<IView *> g_tmViews = {&g_sceneView};
Vector<IView *> g_trViews = {&g_propertiesView, &g_assetView};
VOID View_Main::Initialize()
{
for (const auto &v : g_bViews)
v->Initialize();
for (const auto &v : g_tlViews)
v->Initialize();
for (const auto &v : g_tmViews)
v->Initialize();
for (const auto &v : g_trViews)
v->Initialize();
}
VOID View_Main::Terminate()
{
for (const auto &v : g_bViews)
v->Terminate();
for (const auto &v : g_tlViews)
v->Terminate();
for (const auto &v : g_tmViews)
v->Terminate();
for (const auto &v : g_trViews)
v->Terminate();
}
VOID View_Main::Render()
{
PreRender();
{ // Top Left Window
ImGui::Begin("TL_Window", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoTitleBar);
ImGui::SetWindowPos({0.0f, MENUBAR_HEIGHT});
ImGui::SetWindowSize(
{g_windowExtent.x * LAYOUT_TOP_LEFT_VIEW_EXTENT.x, g_windowExtent.y * LAYOUT_TOP_LEFT_VIEW_EXTENT.y});
ImGui::BeginTabBar("TL_TabBar");
for (const auto &v : g_tlViews)
{
if (ImGui::BeginTabItem(v->IconAndName().c_str()))
{
v->Render();
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
ImGui::End();
}
{ // Top Middle Window
ImGui::Begin("TM_Window", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoTitleBar);
ImGui::SetWindowPos({g_windowExtent.x * LAYOUT_TOP_LEFT_VIEW_EXTENT.x, MENUBAR_HEIGHT});
ImGui::SetWindowSize({g_windowExtent.x * LAYOUT_TOP_MIDDLE_VIEW_EXTENT.x,
g_windowExtent.y * LAYOUT_TOP_MIDDLE_VIEW_EXTENT.y});
ImGui::BeginTabBar("TM_TabBar");
for (const auto &v : g_tmViews)
{
if (ImGui::BeginTabItem(v->IconAndName().c_str()))
{
v->Render();
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
ImGui::End();
}
{ // Top Right Window
ImGui::Begin("TR_Window", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoTitleBar);
ImGui::SetWindowPos({g_windowExtent.x * (1.0f - LAYOUT_TOP_RIGHT_VIEW_EXTENT.x), MENUBAR_HEIGHT});
ImGui::SetWindowSize(
{g_windowExtent.x * LAYOUT_TOP_RIGHT_VIEW_EXTENT.x, g_windowExtent.y * LAYOUT_TOP_RIGHT_VIEW_EXTENT.y});
ImGui::BeginTabBar("TR_TabBar");
for (const auto &v : g_trViews)
{
if (ImGui::BeginTabItem(v->IconAndName().c_str()))
{
v->Render();
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
ImGui::End();
}
{ // Bottom Window
ImGui::Begin("B_Window", nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoTitleBar);
ImGui::SetWindowPos({0.0f, LAYOUT_TOP_MIDDLE_VIEW_EXTENT.y * g_windowExtent.y + MENUBAR_HEIGHT});
ImGui::SetWindowSize(
{g_windowExtent.x * LAYOUT_BOTTOM_VIEW_EXTENT.x, g_windowExtent.y * LAYOUT_BOTTOM_VIEW_EXTENT.y - MENUBAR_HEIGHT});
ImGui::BeginTabBar("B_TabBar");
for (const auto &v : g_bViews)
{
if (ImGui::BeginTabItem(v->IconAndName().c_str()))
{
v->Render();
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
ImGui::End();
}
PostRender();
}
} // namespace ia::iae

View File

@ -0,0 +1,37 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/Nodes.hpp>
namespace ia::iae
{
VOID View_Nodes::Initialize()
{
SetName("Nodes");
SetIcon(ICON_FA_CIRCLE_NODES);
}
VOID View_Nodes::Terminate()
{
}
VOID View_Nodes::Render()
{
PreRender();
PostRender();
}
} // namespace ia::iae

View File

@ -0,0 +1,37 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/Package.hpp>
namespace ia::iae
{
VOID View_Package::Initialize()
{
SetName("Package");
SetIcon(ICON_FA_BOX_ARCHIVE);
}
VOID View_Package::Terminate()
{
}
VOID View_Package::Render()
{
PreRender();
PostRender();
}
} // namespace ia::iae

View File

@ -0,0 +1,37 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/Properties.hpp>
namespace ia::iae
{
VOID View_Properties::Initialize()
{
SetName("Properties");
SetIcon(ICON_FA_LIST);
}
VOID View_Properties::Terminate()
{
}
VOID View_Properties::Render()
{
PreRender();
PostRender();
}
} // namespace ia::iae

View File

@ -0,0 +1,37 @@
// 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 <https://www.gnu.org/licenses/>.
#include <UI/View/Scene.hpp>
namespace ia::iae
{
VOID View_Scene::Initialize()
{
SetName("Scene");
SetIcon(ICON_FA_HASHTAG);
}
VOID View_Scene::Terminate()
{
}
VOID View_Scene::Render()
{
PreRender();
PostRender();
}
} // namespace ia::iae

View File