Fixes
This commit is contained in:
@ -1,11 +1,18 @@
|
||||
set(SRC_FILES
|
||||
"imp/cpp/UI.cpp"
|
||||
"imp/cpp/Main.cpp"
|
||||
"imp/cpp/Editor.cpp"
|
||||
|
||||
"imp/cpp/Project.cpp"
|
||||
"imp/cpp/GamePreview.cpp"
|
||||
|
||||
"imp/cpp/View/AssetBrowser.cpp"
|
||||
"imp/cpp/UI/UI.cpp"
|
||||
"imp/cpp/UI/View/Main.cpp"
|
||||
"imp/cpp/UI/View/Asset.cpp"
|
||||
"imp/cpp/UI/View/AssetBrowser.cpp"
|
||||
"imp/cpp/UI/View/Console.cpp"
|
||||
"imp/cpp/UI/View/Nodes.cpp"
|
||||
"imp/cpp/UI/View/Package.cpp"
|
||||
"imp/cpp/UI/View/Scene.cpp"
|
||||
"imp/cpp/UI/View/Properties.cpp"
|
||||
|
||||
# imgui
|
||||
"imp/cpp/Vendor/imgui/imgui.cpp"
|
||||
|
||||
@ -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, ¤tWindowPosition.x, ¤tWindowPosition.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)){}
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
0
Src/Editor/imp/cpp/UI/Popup.cpp
Normal file
0
Src/Editor/imp/cpp/UI/Popup.cpp
Normal file
66
Src/Editor/imp/cpp/UI/UI.cpp
Normal file
66
Src/Editor/imp/cpp/UI/UI.cpp
Normal 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
|
||||
@ -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
|
||||
@ -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
|
||||
37
Src/Editor/imp/cpp/UI/View/Console.cpp
Normal file
37
Src/Editor/imp/cpp/UI/View/Console.cpp
Normal 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
|
||||
161
Src/Editor/imp/cpp/UI/View/Main.cpp
Normal file
161
Src/Editor/imp/cpp/UI/View/Main.cpp
Normal 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
|
||||
37
Src/Editor/imp/cpp/UI/View/Nodes.cpp
Normal file
37
Src/Editor/imp/cpp/UI/View/Nodes.cpp
Normal 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
|
||||
37
Src/Editor/imp/cpp/UI/View/Package.cpp
Normal file
37
Src/Editor/imp/cpp/UI/View/Package.cpp
Normal 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
|
||||
@ -14,33 +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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Base.hpp>
|
||||
#include <UI/View/Properties.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class IView
|
||||
VOID View_Properties::Initialize()
|
||||
{
|
||||
public:
|
||||
PURE_VIRTUAL(VOID Initialize());
|
||||
PURE_VIRTUAL(VOID Terminate());
|
||||
PURE_VIRTUAL(VOID Render());
|
||||
|
||||
protected:
|
||||
INLINE VOID PreRender();
|
||||
INLINE VOID PostRender();
|
||||
|
||||
protected:
|
||||
ImVec2 m_extent{};
|
||||
};
|
||||
|
||||
VOID IView::PreRender()
|
||||
{
|
||||
m_extent = ImGui::GetWindowSize();
|
||||
SetName("Properties");
|
||||
SetIcon(ICON_FA_LIST);
|
||||
}
|
||||
|
||||
VOID IView::PostRender()
|
||||
VOID View_Properties::Terminate()
|
||||
{
|
||||
}
|
||||
} // namespace ia::iae::editor
|
||||
|
||||
VOID View_Properties::Render()
|
||||
{
|
||||
PreRender();
|
||||
|
||||
PostRender();
|
||||
}
|
||||
} // namespace ia::iae
|
||||
37
Src/Editor/imp/cpp/UI/View/Scene.cpp
Normal file
37
Src/Editor/imp/cpp/UI/View/Scene.cpp
Normal 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
|
||||
0
Src/Editor/imp/cpp/UI/Window.cpp
Normal file
0
Src/Editor/imp/cpp/UI/Window.cpp
Normal file
8811
Src/Editor/imp/hpp/LogoIcon.hpp
Normal file
8811
Src/Editor/imp/hpp/LogoIcon.hpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Base.hpp>
|
||||
#include <ConfigData/ConfigData.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
@ -25,7 +26,14 @@ namespace ia::iae
|
||||
public:
|
||||
STATIC RefPtr<Project> Load(IN CONST String &directory);
|
||||
|
||||
VOID Update();
|
||||
|
||||
public:
|
||||
IVec2 &WindowPosition()
|
||||
{
|
||||
return m_windowPosition;
|
||||
}
|
||||
|
||||
CONST String &Name() CONST
|
||||
{
|
||||
return m_projectName;
|
||||
@ -35,14 +43,18 @@ namespace ia::iae
|
||||
{
|
||||
return m_assetDirectory;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
IVec2 m_windowPosition{};
|
||||
|
||||
CONST String m_projectName;
|
||||
CONST String m_assetDirectory;
|
||||
CONST String m_projectAbsolutePath;
|
||||
|
||||
RefPtr<ConfigData> m_configData;
|
||||
|
||||
public:
|
||||
Project(IN CONST String &name, IN CONST String &absolutePath);
|
||||
Project(IN CONST String &name, IN CONST String &absolutePath, IN RefPtr<ConfigData>&& configData);
|
||||
~Project();
|
||||
};
|
||||
} // namespace ia::iae
|
||||
31
Src/Editor/imp/hpp/UI/Base.hpp
Normal file
31
Src/Editor/imp/hpp/UI/Base.hpp
Normal file
@ -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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Base.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
STATIC CONSTEXPR IVec2 SCENE_EDITOR_RESOULTION = {800, 604};
|
||||
|
||||
STATIC CONSTEXPR Vec2 LAYOUT_TOP_LEFT_VIEW_EXTENT = {0.275f, 0.55f};
|
||||
STATIC CONSTEXPR Vec2 LAYOUT_TOP_MIDDLE_VIEW_EXTENT = {0.45f, 0.55f};
|
||||
STATIC CONSTEXPR Vec2 LAYOUT_TOP_RIGHT_VIEW_EXTENT = {0.275f, 0.55f};
|
||||
STATIC CONSTEXPR Vec2 LAYOUT_BOTTOM_VIEW_EXTENT = {1.0f, 0.45f};
|
||||
|
||||
STATIC CONSTEXPR FLOAT32 MENUBAR_HEIGHT = 18.0f;
|
||||
} // namespace ia::iae
|
||||
0
Src/Editor/imp/hpp/UI/Popup.hpp
Normal file
0
Src/Editor/imp/hpp/UI/Popup.hpp
Normal file
@ -16,17 +16,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Base.hpp>
|
||||
#include <UI/Base.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
CONST IVec2 gamePreviewResolution = {800, 608};
|
||||
|
||||
class UI
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID Update();
|
||||
STATIC VOID Draw();
|
||||
};
|
||||
@ -16,12 +16,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Base.hpp>
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class GamePreview
|
||||
class View_Asset : public IView
|
||||
{
|
||||
public:
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <View/IView.hpp>
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
@ -29,6 +29,8 @@ namespace ia::iae
|
||||
PCCHAR Icon{""};
|
||||
String Name{};
|
||||
BOOL IsDirectory{};
|
||||
String IconAndName{};
|
||||
std::filesystem::path Path{};
|
||||
};
|
||||
|
||||
public:
|
||||
@ -42,6 +44,8 @@ namespace ia::iae
|
||||
|
||||
PCCHAR GetFileEntryIcon(IN PCCHAR extension);
|
||||
|
||||
VOID OpenAsset(IN CONST std::filesystem::path &path);
|
||||
|
||||
private:
|
||||
Vector<FileEntry> m_assetDirectoryFiles;
|
||||
std::filesystem::path m_assetDirectoryPath{};
|
||||
30
Src/Editor/imp/hpp/UI/View/Console.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Console.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Console : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
79
Src/Editor/imp/hpp/UI/View/IView.hpp
Normal file
79
Src/Editor/imp/hpp/UI/View/IView.hpp
Normal file
@ -0,0 +1,79 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/Base.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class IView
|
||||
{
|
||||
public:
|
||||
PURE_VIRTUAL(VOID Initialize());
|
||||
PURE_VIRTUAL(VOID Terminate());
|
||||
PURE_VIRTUAL(VOID Render());
|
||||
|
||||
public:
|
||||
VOID SetIcon(IN PCCHAR icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
m_iconAndName = BuildString(m_icon, " ", m_name);
|
||||
}
|
||||
|
||||
VOID SetName(IN CONST String &name)
|
||||
{
|
||||
m_name = name;
|
||||
m_iconAndName = m_icon ? BuildString(m_icon, " ", m_name) : m_name;
|
||||
}
|
||||
|
||||
public:
|
||||
CONST String &Name() CONST
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
CONST PCCHAR Icon() CONST
|
||||
{
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
CONST String &IconAndName() CONST
|
||||
{
|
||||
return m_iconAndName;
|
||||
}
|
||||
|
||||
protected:
|
||||
INLINE VOID PreRender();
|
||||
INLINE VOID PostRender();
|
||||
|
||||
protected:
|
||||
ImVec2 m_extent{};
|
||||
|
||||
String m_name{};
|
||||
PCCHAR m_icon{};
|
||||
String m_iconAndName{};
|
||||
};
|
||||
|
||||
VOID IView::PreRender()
|
||||
{
|
||||
m_extent = ImGui::GetWindowSize();
|
||||
}
|
||||
|
||||
VOID IView::PostRender()
|
||||
{
|
||||
}
|
||||
} // namespace ia::iae
|
||||
30
Src/Editor/imp/hpp/UI/View/Main.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Main.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Main : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
} // namespace ia::iae
|
||||
30
Src/Editor/imp/hpp/UI/View/Nodes.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Nodes.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Nodes : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
30
Src/Editor/imp/hpp/UI/View/Package.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Package.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Package : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
30
Src/Editor/imp/hpp/UI/View/Properties.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Properties.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Properties : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
30
Src/Editor/imp/hpp/UI/View/Scene.hpp
Normal file
30
Src/Editor/imp/hpp/UI/View/Scene.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
// 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Scene : public IView
|
||||
{
|
||||
public:
|
||||
VOID Initialize();
|
||||
VOID Terminate();
|
||||
VOID Render();
|
||||
};
|
||||
}
|
||||
0
Src/Editor/imp/hpp/UI/Window.hpp
Normal file
0
Src/Editor/imp/hpp/UI/Window.hpp
Normal file
Reference in New Issue
Block a user