Engine & Game Library Interface Update
This commit is contained in:
31
Engine/Src/Imp/HPP/AudioManager.hpp
Normal file
31
Engine/Src/Imp/HPP/AudioManager.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 <IAEngine/Base.hpp>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class AudioManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
};
|
||||
}
|
||||
33
Engine/Src/Imp/HPP/EventManager.hpp
Normal file
33
Engine/Src/Imp/HPP/EventManager.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
// 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>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class EventManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID OnSDLEvent(IN SDL_Event* event);
|
||||
};
|
||||
}
|
||||
33
Engine/Src/Imp/HPP/InputManager.hpp
Normal file
33
Engine/Src/Imp/HPP/InputManager.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
// 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>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class InputManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID OnSDLEvent(IN SDL_Event* event);
|
||||
};
|
||||
}
|
||||
@ -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 <IAEngine/Base.hpp>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class Random
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
};
|
||||
}
|
||||
32
Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp
Normal file
32
Engine/Src/Imp/HPP/Renderer/DebugDraw.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
// 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>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class DebugDraw
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID Render();
|
||||
};
|
||||
}
|
||||
154
Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp
Normal file
154
Engine/Src/Imp/HPP/Renderer/EmbeddedShader.hpp
Normal file
File diff suppressed because one or more lines are too long
38
Engine/Src/Imp/HPP/Renderer/GPUResourceManager.hpp
Normal file
38
Engine/Src/Imp/HPP/Renderer/GPUResourceManager.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
// 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>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class GPUResourceManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC SDL_GPUSampler *GetSampler_LinearClamp();
|
||||
STATIC SDL_GPUSampler *GetSampler_LinearRepeat();
|
||||
|
||||
STATIC SDL_GPUTexture *CreateTexture(IN SDL_GPUTextureUsageFlags usage, IN INT32 width, IN INT32 height, IN PCUINT8 rgbaData = nullptr, IN SDL_GPUTextureFormat format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM);
|
||||
STATIC SDL_GPUBuffer *CreateDeviceLocalBuffer(IN SDL_GPUBufferUsageFlags usage, IN PCVOID data, IN UINT32 dataSize);
|
||||
STATIC VOID DestroyTexture(IN SDL_GPUTexture *handle);
|
||||
STATIC VOID DestroyBuffer(IN SDL_GPUBuffer *handle);
|
||||
};
|
||||
} // namespace ia::iae
|
||||
48
Engine/Src/Imp/HPP/Renderer/Pipeline.hpp
Normal file
48
Engine/Src/Imp/HPP/Renderer/Pipeline.hpp
Normal file
@ -0,0 +1,48 @@
|
||||
// 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>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class Pipeline
|
||||
{
|
||||
public:
|
||||
struct StageDesc
|
||||
{
|
||||
PCUINT8 SourceData{};
|
||||
UINT64 SourceLength{};
|
||||
UINT32 SamplerCount{};
|
||||
UINT32 UniformBufferCount{};
|
||||
};
|
||||
|
||||
public:
|
||||
Pipeline(IN CONST StageDesc &vertexStageDesc, IN CONST StageDesc &pixelStageDesc, IN BOOL enableVertexBuffer, IN BOOL enableDepthTest);
|
||||
~Pipeline();
|
||||
|
||||
SDL_GPUGraphicsPipeline *GetHandle() CONST
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
private:
|
||||
SDL_GPUGraphicsPipeline *m_handle{};
|
||||
};
|
||||
} // namespace ia::iae
|
||||
86
Engine/Src/Imp/HPP/Renderer/Renderer.hpp
Normal file
86
Engine/Src/Imp/HPP/Renderer/Renderer.hpp
Normal file
@ -0,0 +1,86 @@
|
||||
// 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 <Renderer/Pipeline.hpp>
|
||||
#include <Renderer/GPUResourceManager.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class Renderer
|
||||
{
|
||||
public:
|
||||
struct Mesh
|
||||
{
|
||||
INT32 IndexCount{};
|
||||
SDL_GPUBuffer *IndexBuffer;
|
||||
SDL_GPUBuffer *VertexBuffer;
|
||||
};
|
||||
|
||||
struct State
|
||||
{
|
||||
BOOL FlippedH{false};
|
||||
BOOL FlippedV{false};
|
||||
BOOL CameraRelative{true};
|
||||
BOOL ScissorEnabled{false};
|
||||
Color ColorOverlay{};
|
||||
Vec2 TextureOffset{0.0f, 0.0f};
|
||||
SDL_Rect Scissor{0, 0, 0, 0};
|
||||
Handle ActiveTexture{INVALID_HANDLE};
|
||||
|
||||
Mat4 ModelMatrix{1.0f};
|
||||
Mat4 ProjectionMatrix{1.0f};
|
||||
|
||||
SDL_GPURenderPass* ActiveRenderPass{};
|
||||
SDL_GPUCommandBuffer* ActiveCommandBuffer{};
|
||||
SDL_GPUColorTargetInfo ColorTargetInfo{};
|
||||
SDL_GPUDepthStencilTargetInfo DepthStencilTargetInfo{};
|
||||
|
||||
class ICameraComponent *ActiveCamera{};
|
||||
};
|
||||
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID BeginFrame();
|
||||
STATIC VOID EndFrame();
|
||||
|
||||
STATIC VOID OnScreenResize(IN INT32 newWidth, IN INT32 newHeight);
|
||||
|
||||
public:
|
||||
STATIC SDL_GPUTextureFormat GetRenderTargetFormat();
|
||||
|
||||
STATIC SDL_GPUDevice *GetDevice()
|
||||
{
|
||||
return s_gpuDevice;
|
||||
}
|
||||
|
||||
private:
|
||||
STATIC State s_state;
|
||||
STATIC INT32 s_screenWidth;
|
||||
STATIC INT32 s_screenHeight;
|
||||
STATIC SDL_GPUDevice *s_gpuDevice;
|
||||
STATIC SDL_GPUTexture *s_renderTargetSceneColor;
|
||||
STATIC SDL_GPUTexture *s_renderTargetSceneDepth;
|
||||
STATIC SDL_GPUTexture *s_renderTargetDebugDrawColor;
|
||||
STATIC Pipeline* s_geometryPipeline;
|
||||
STATIC Pipeline* s_postprocessPipeline;
|
||||
|
||||
friend class Engine;
|
||||
};
|
||||
} // namespace ia::iae
|
||||
24
Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp
Normal file
24
Engine/Src/Imp/HPP/Renderer/UIRenderer.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
// 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
|
||||
{
|
||||
|
||||
}
|
||||
31
Engine/Src/Imp/HPP/ResourceManager.hpp
Normal file
31
Engine/Src/Imp/HPP/ResourceManager.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 <IAEngine/Base.hpp>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class ResourceManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
};
|
||||
}
|
||||
@ -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 <IAEngine/Base.hpp>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class Time
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
};
|
||||
}
|
||||
36
Engine/Src/Imp/HPP/WorldManager.hpp
Normal file
36
Engine/Src/Imp/HPP/WorldManager.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
// 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>
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
class WorldManager
|
||||
{
|
||||
public:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
STATIC VOID Draw();
|
||||
STATIC VOID DebugDraw();
|
||||
|
||||
STATIC VOID Update();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user