Files
palladium/include/pd/lithium/texture.hpp
TobiD7 e04046720b Work at 3ds support and backend upgrades
- Track textures (not sure if this is done tbh)
- Add lithium formatters and move TextureID, TextureFormat and TextureFilter to lithium
- Only include gl-helper if any glDriver is included
- Add Li::Rect for UV stuff
- Add Li::Texture as Info holder (still thinking of making them to ptrs
- Add Check if textures are still loaded on exit
2026-03-18 09:31:47 +01:00

46 lines
1015 B
C++

#pragma once
#include <pd/core/core.hpp>
#include <pd/lithium/rect.hpp>
namespace PD {
using TextureID = ptr;
enum class TextureFilter {
Linear,
Nearest,
};
enum class TextureFormat {
RGBA32,
RGB24,
A8,
};
namespace Li {
class Texture {
public:
Texture() : pID(0), pSize(0, 0), pUV(fvec4(0, 0, 1, 1)) {}
Texture(TextureID id, ivec2 size)
: pID(id), pSize(size), pUV(fvec4(0, 0, 1, 1)) {}
const ivec2& GetSize() const { return pSize; }
TextureID GetID() { return pID; }
const TextureID& GetID() const { return pID; }
const Rect& GetUV() const { return pUV; }
void SetSize(int x, int y) {
pSize.x = x;
pSize.y = y;
}
void SetSize(const ivec2& size) { pSize = size; }
void SetID(TextureID id) { pID = id; }
void SetUV(const Rect& uv) { pUV = uv; }
void SetUV(const fvec4& uv) { pUV = uv; }
void SetUV(float t, float l, float b, float r) { SetUV(fvec4(t, l, b, r)); }
private:
TextureID pID;
ivec2 pSize;
Rect pUV;
};
} // namespace Li
} // namespace PD