Fixes
This commit is contained in:
@ -18,12 +18,14 @@
|
||||
|
||||
#include <UI/View/IView.hpp>
|
||||
|
||||
#include <IAEngine/Asset/IAsset.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class View_Asset : public IView
|
||||
{
|
||||
public:
|
||||
VOID Open(IN Path path);
|
||||
VOID Open(IN String assetName);
|
||||
VOID Close();
|
||||
|
||||
public:
|
||||
@ -36,6 +38,19 @@ namespace ia::iae
|
||||
VOID OnEvent(IN SDL_Event *event);
|
||||
|
||||
private:
|
||||
Path m_assetPath{};
|
||||
VOID RenderTextureAsset();
|
||||
VOID RenderSpriteAsset();
|
||||
VOID RenderTileSheetAsset();
|
||||
VOID RenderSpriteSheetAsset();
|
||||
|
||||
VOID DrawAssetTypePicker();
|
||||
VOID DrawAssetImage(IN FLOAT32 relativeWidth, IN IVec2 gridSize);
|
||||
|
||||
private:
|
||||
class IAsset *m_asset{};
|
||||
String m_assetName{};
|
||||
Handle m_assetImageHandle{};
|
||||
IVec2 m_assetImageExtent{};
|
||||
EAssetType m_assetType{};
|
||||
};
|
||||
} // namespace ia::iae
|
||||
58
Src/Editor/imp/hpp/UI/View/FilePreview.hpp
Normal file
58
Src/Editor/imp/hpp/UI/View/FilePreview.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
// 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_FilePreview : public IView
|
||||
{
|
||||
enum class EFileType
|
||||
{
|
||||
UNKNOWN,
|
||||
|
||||
TEXT,
|
||||
IMAGE,
|
||||
};
|
||||
|
||||
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:
|
||||
VOID RenderTextFile();
|
||||
VOID RenderImageFile();
|
||||
VOID RenderUnknownFile();
|
||||
|
||||
private:
|
||||
Path m_filePath{};
|
||||
EFileType m_fileType{EFileType::UNKNOWN};
|
||||
PVOID m_fileData{};
|
||||
SIZE_T m_fileDataSize{};
|
||||
IVec2 m_fileDataExtent{};
|
||||
};
|
||||
} // namespace ia::iae
|
||||
43
Src/Editor/imp/hpp/UI/View/Game.hpp
Normal file
43
Src/Editor/imp/hpp/UI/View/Game.hpp
Normal file
@ -0,0 +1,43 @@
|
||||
// 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_Game : public IView
|
||||
{
|
||||
public:
|
||||
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_gameRenderTexture;
|
||||
};
|
||||
} // namespace ia::iae
|
||||
@ -71,7 +71,7 @@ namespace ia::iae
|
||||
|
||||
VOID IView::PreRender()
|
||||
{
|
||||
m_extent = ImGui::GetWindowSize();
|
||||
m_extent = ImGui::GetContentRegionAvail();
|
||||
ImGui::BeginChild("##");
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,5 @@ namespace ia::iae
|
||||
{
|
||||
OnEvent(event);
|
||||
}
|
||||
|
||||
private:
|
||||
class RDC_Texture* m_gamePreviewTexture;
|
||||
};
|
||||
} // namespace ia::iae
|
||||
Reference in New Issue
Block a user