62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
// 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 <RenderCore/Device.hpp>
|
|
|
|
namespace ia::iae
|
|
{
|
|
class RDC_Texture
|
|
{
|
|
public:
|
|
enum class EType
|
|
{
|
|
SAMPLED
|
|
};
|
|
|
|
public:
|
|
RDC_Texture(IN EType type, IN INT32 width, IN INT32 height, IN BOOL generateMipMaps = false);
|
|
~RDC_Texture();
|
|
|
|
VOID SetImageData(IN PCUINT8 rgbaData, IN INT32 stride = -1);
|
|
|
|
VOID BindAsSampler(IN SDL_GPURenderPass* renderPass, IN INT32 index, IN SDL_GPUSampler* sampler);
|
|
|
|
public:
|
|
SDL_GPUTexture *GetHandle() CONST
|
|
{
|
|
return m_handle;
|
|
}
|
|
|
|
INT32 Width() CONST
|
|
{
|
|
return m_width;
|
|
}
|
|
|
|
INT32 Height() CONST
|
|
{
|
|
return m_height;
|
|
}
|
|
|
|
private:
|
|
CONST EType m_type;
|
|
CONST INT32 m_width;
|
|
CONST INT32 m_height;
|
|
CONST UINT32 m_mipLevels;
|
|
SDL_GPUTexture *m_handle;
|
|
};
|
|
} // namespace ia::iae
|