This commit is contained in:
Isuru Samarathunga
2025-11-11 09:24:14 +05:30
parent 67cb23d589
commit 9d6f525b81
33 changed files with 654 additions and 285 deletions

View File

@ -22,9 +22,20 @@ namespace ia::iae
{
class View_Asset : public IView
{
public:
VOID Open(IN Path path);
VOID Close();
public:
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
private:
Path m_assetPath{};
};
}
} // namespace ia::iae

View File

@ -37,6 +37,10 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
private:
VOID ChangeCurrentOpenDirectory(IN CONST std::filesystem::path &path);

View File

@ -26,5 +26,9 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
};
}

View File

@ -16,29 +16,25 @@
#pragma once
#include <UI/Base.hpp>
#include <UI/UI.hpp>
namespace ia::iae
{
class IView
{
protected:
PURE_VIRTUAL(VOID OnEvent(IN SDL_Event *event));
public:
PURE_VIRTUAL(VOID Initialize());
PURE_VIRTUAL(VOID Terminate());
PURE_VIRTUAL(VOID Render());
PURE_VIRTUAL(VOID Update());
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;
}
VOID SetIcon(IN PCCHAR icon);
VOID SetName(IN CONST String &name);
VIRTUAL VOID ProcessEvent(IN SDL_Event *event);
public:
CONST String &Name() CONST
@ -66,14 +62,21 @@ namespace ia::iae
String m_name{};
PCCHAR m_icon{};
String m_iconAndName{};
public:
VIRTUAL ~IView()
{
}
};
VOID IView::PreRender()
{
m_extent = ImGui::GetWindowSize();
ImGui::BeginChild("##");
}
VOID IView::PostRender()
{
ImGui::EndChild();
}
} // namespace ia::iae

View File

@ -1,30 +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/>.
#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

View File

@ -26,5 +26,9 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
};
}

View File

@ -26,5 +26,9 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
};
}

View File

@ -26,5 +26,9 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
};
}

View File

@ -26,5 +26,18 @@ namespace ia::iae
VOID Initialize();
VOID Terminate();
VOID Render();
VOID Update();
protected:
VOID OnEvent(IN SDL_Event *event);
public:
VOID ProcessEvent(IN SDL_Event *event)
{
OnEvent(event);
}
private:
class RDC_Texture* m_gamePreviewTexture;
};
}
} // namespace ia::iae