Back
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include <IAEngine/Components/CameraComponent.hpp>
|
||||
#include <IAEngine/Components/SoundEmitterComponent.hpp>
|
||||
|
||||
#include <IAEngine/UI.hpp>
|
||||
#include <IAEngine/Scene.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
@ -82,6 +83,8 @@ namespace ia::iae
|
||||
STATIC IAE_DLL_API VOID DestroySound(IN Handle sound);
|
||||
STATIC IAE_DLL_API IVec2 GetImageExtent(IN Handle image);
|
||||
STATIC IAE_DLL_API Handle ResizeImage(IN Handle image, IN INT32 newWidth, IN INT32 newHeight);
|
||||
STATIC IAE_DLL_API Handle ResizeImage(IN CONST String& name, IN INT32 newWidth, IN INT32 newHeight);
|
||||
STATIC IAE_DLL_API VOID RescaleAllImages(IN FLOAT32 factorX, IN FLOAT32 factorY);
|
||||
STATIC IAE_DLL_API Handle CombineImages(IN CONST Vector<Handle> &images, IN INT32 unitWidth,
|
||||
IN INT32 unitHeight, IN INT32 unitCountX, IN INT32 unitCountY);
|
||||
|
||||
@ -127,5 +130,6 @@ namespace ia::iae
|
||||
|
||||
// Engine Functions
|
||||
STATIC IAE_DLL_API BOOL IsDebugMode();
|
||||
STATIC IAE_DLL_API String GetUniqueResourceName();
|
||||
};
|
||||
} // namespace ia::iae
|
||||
@ -21,6 +21,12 @@
|
||||
using namespace ia;
|
||||
using namespace ia::iae;
|
||||
|
||||
struct GameRequestedConfig
|
||||
{
|
||||
INT32 ScreenWidth{};
|
||||
INT32 ScreenHeight{};
|
||||
};
|
||||
|
||||
#if defined(__BUILDING_IAENGINE_GAME) && (__BUILDING_IAENGINE_GAME)
|
||||
|
||||
#define GAME_LOG_TAG "[GAME]: "
|
||||
@ -28,6 +34,7 @@ using namespace ia::iae;
|
||||
#define GAME_LOG_WARN(...) ia::Logger::Warn(IAE_LOG_TAG, __VA_ARGS__)
|
||||
#define GAME_LOG_ERROR(...) ia::Logger::Error(IAE_LOG_TAG, __VA_ARGS__)
|
||||
|
||||
C_DECL(IA_DLL_EXPORT GameRequestedConfig Game_GetConfigRequest());
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnInitialize());
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnTerminate());
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnDebugDraw());
|
||||
@ -44,6 +51,8 @@ using namespace ia::iae;
|
||||
|
||||
struct GameFunctionTable
|
||||
{
|
||||
GameRequestedConfig(*GetConfigRequest)(){nullptr};
|
||||
|
||||
VOID (*OnInitialize)() {nullptr};
|
||||
VOID (*OnTerminate)() {nullptr};
|
||||
VOID (*OnDebugDraw)() {nullptr};
|
||||
|
||||
@ -32,12 +32,18 @@ namespace ia::iae
|
||||
IAE_DLL_API VOID RemoveNode(IN CONST String &name);
|
||||
|
||||
public:
|
||||
IVec2& Extent()
|
||||
{
|
||||
return m_extent;
|
||||
}
|
||||
|
||||
Color &BackgroundColor()
|
||||
{
|
||||
return m_backgroundColor;
|
||||
}
|
||||
|
||||
private:
|
||||
IVec2 m_extent{100, 100};
|
||||
Color m_backgroundColor{0, 0, 0, 255};
|
||||
Map<String, RefPtr<INode>> m_nodes;
|
||||
|
||||
|
||||
40
Engine/Src/Inc/IAEngine/UI.hpp
Normal file
40
Engine/Src/Inc/IAEngine/UI.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// 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 <IAEngine/Base.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class UI
|
||||
{
|
||||
public:
|
||||
STATIC IAE_DLL_API VOID AddFontFromFile(IN CONST String& path);
|
||||
|
||||
STATIC IAE_DLL_API VOID SetHTML(IN CONST String& source);
|
||||
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID Update();
|
||||
STATIC VOID Draw();
|
||||
|
||||
STATIC VOID OnSDLEvent(IN PVOID event);
|
||||
STATIC VOID OnScreenResize(IN INT32 newWidth, IN INT32 newHeight);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user