This commit is contained in:
Isuru Samarathunga
2025-10-06 17:23:17 +05:30
parent c23f5f4559
commit 0ef29f4e5f
3 changed files with 131 additions and 21 deletions

View File

@ -24,7 +24,7 @@ namespace ia::iae
class Renderer
{
public:
struct Mesh
struct Geometry
{
INT32 IndexCount{};
SDL_GPUBuffer *IndexBuffer;
@ -36,11 +36,11 @@ namespace ia::iae
BOOL FlippedH{false};
BOOL FlippedV{false};
BOOL CameraRelative{true};
BOOL ScissorEnabled{false};
BOOL YSortingEnabled{false};
Color ColorOverlay{};
Vec2 TextureOffset{0.0f, 0.0f};
SDL_Rect Scissor{0, 0, 0, 0};
Handle ActiveTexture{INVALID_HANDLE};
SDL_GPUTexture* ActiveTexture{nullptr};
Mat4 ModelMatrix{1.0f};
Mat4 ProjectionMatrix{1.0f};
@ -63,6 +63,11 @@ namespace ia::iae
STATIC VOID OnScreenResize(IN INT32 newWidth, IN INT32 newHeight);
public:
STATIC Geometry* CreateGeometry(IN CONST Vector<GeometryVertex> &vertices, IN CONST Vector<INT32> &indices);
STATIC VOID DestroyGeometry(IN Geometry* handle);
STATIC VOID DrawGeometry(IN Geometry* handle);
STATIC SDL_GPUTextureFormat GetRenderTargetFormat();
STATIC SDL_GPUDevice *GetDevice()
@ -80,6 +85,7 @@ namespace ia::iae
STATIC SDL_GPUTexture *s_renderTargetDebugDrawColor;
STATIC Pipeline* s_geometryPipeline;
STATIC Pipeline* s_postprocessPipeline;
STATIC Geometry* s_quadGeometry;
friend class Engine;
};