2024-03-18 15:41:46 -03:00
|
|
|
#ifndef XNA_GRAPHICS_TEXTURE_HPP
|
|
|
|
#define XNA_GRAPHICS_TEXTURE_HPP
|
|
|
|
|
2024-05-04 21:07:39 -03:00
|
|
|
#include "../default.hpp"
|
2024-05-23 14:38:16 -03:00
|
|
|
#include "gresource.hpp"
|
2024-03-18 15:41:46 -03:00
|
|
|
|
|
|
|
namespace xna {
|
|
|
|
class Texture {
|
2024-05-23 14:38:16 -03:00
|
|
|
public:
|
|
|
|
~Texture() {}
|
2024-03-18 15:41:46 -03:00
|
|
|
};
|
|
|
|
|
2024-05-23 14:38:16 -03:00
|
|
|
class Texture2D : public Texture, public GraphicsResource {
|
|
|
|
public:
|
|
|
|
Texture2D();
|
|
|
|
Texture2D(sptr<GraphicsDevice> const& device);
|
|
|
|
Texture2D(sptr<GraphicsDevice> const& device, size_t width, size_t height);
|
|
|
|
Texture2D(sptr<GraphicsDevice> const& device, size_t width, size_t height, size_t mipMap, SurfaceFormat format);
|
|
|
|
~Texture2D() override;
|
|
|
|
Int Width() const;
|
|
|
|
Int Height() const;
|
|
|
|
Rectangle Bounds() const;
|
|
|
|
bool Initialize(xna_error_nullarg);
|
|
|
|
void SetData(std::vector<Color> const& data, size_t startIndex = 0, size_t elementCount = 0, xna_error_nullarg);
|
|
|
|
void SetData(std::vector<Uint> const& data, size_t startIndex = 0, size_t elementCount = 0, xna_error_nullarg);
|
|
|
|
void SetData(std::vector<Byte> const& data, size_t startIndex = 0, size_t elementCount = 0, xna_error_nullarg);
|
|
|
|
void SetData(Int level, Rectangle* rect, std::vector<Byte> const& data, size_t startIndex, size_t elementCount, xna_error_nullarg);
|
|
|
|
static sptr<Texture2D> FromStream(GraphicsDevice& device, String const& fileName, xna_error_nullarg);
|
|
|
|
static sptr<Texture2D> FromMemory(GraphicsDevice& device, std::vector<Byte> const& data, xna_error_nullarg);
|
|
|
|
|
2024-03-18 15:41:46 -03:00
|
|
|
public:
|
2024-05-23 14:38:16 -03:00
|
|
|
struct PlatformImplementation;
|
|
|
|
uptr<PlatformImplementation> impl = nullptr;
|
2024-03-18 15:41:46 -03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|