SwitchGame/source/EngineFrame/Render/Texture.h

30 lines
652 B
C
Raw Permalink Normal View History

2025-09-18 15:21:43 +08:00
#pragma once
#include <SDL.h>
#include <string>
2025-09-19 12:18:57 +08:00
#include "Tool/RefPtr.h"
#include "Tool/RefObject.h"
2025-09-18 15:21:43 +08:00
class Texture : public RefObject
{
private:
SDL_Texture *m_texture = nullptr;
public:
2025-09-19 12:18:57 +08:00
VecSize TextureSize = {0, 0}; // 纹理大小
VecPos TexturePos = {0, 0}; // 纹理位置
VecSize TextureFramepos = {0, 0}; // 帧域宽高
2025-09-18 15:21:43 +08:00
public:
Texture(/* args */);
2025-09-19 12:18:57 +08:00
Texture(std::string PngPath);
2025-09-18 15:21:43 +08:00
Texture(std::string imgPath, int Index);
~Texture();
public:
void SetBlendMode(SDL_BlendMode blendMode);
// 获取混合模式
SDL_BlendMode GetBlendMode();
SDL_Texture *GetTexture(); // 获取纹理
};