2023-05-01 12:55:49 +00:00
|
|
|
#ifndef ENGINE_INCLUDE_RESOURCES_TEXTURE_H_
|
|
|
|
#define ENGINE_INCLUDE_RESOURCES_TEXTURE_H_
|
2022-12-15 15:54:11 +00:00
|
|
|
|
2023-01-08 15:22:44 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-05-01 13:13:35 +00:00
|
|
|
#include "application.h"
|
|
|
|
#include "gfx_device.h"
|
2023-03-31 08:08:49 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
namespace engine {
|
2022-12-15 15:54:11 +00:00
|
|
|
|
|
|
|
class Texture {
|
2023-11-05 01:04:05 +00:00
|
|
|
public:
|
2024-02-03 00:01:01 +00:00
|
|
|
|
|
|
|
Texture(Renderer* renderer, const uint8_t* bitmap, int width, int height, gfx::SamplerInfo samplerInfo, bool srgb);
|
2023-11-05 01:04:05 +00:00
|
|
|
|
|
|
|
~Texture();
|
|
|
|
Texture(const Texture&) = delete;
|
|
|
|
Texture& operator=(const Texture&) = delete;
|
|
|
|
|
|
|
|
const gfx::Image* GetImage() { return image_; }
|
|
|
|
const gfx::Sampler* GetSampler() { return sampler_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
GFXDevice* gfx_;
|
|
|
|
const gfx::Image* image_;
|
|
|
|
const gfx::Sampler* sampler_; // not owned by Texture, owned by Renderer
|
2022-12-15 15:54:11 +00:00
|
|
|
};
|
|
|
|
|
2024-02-03 00:01:01 +00:00
|
|
|
std::unique_ptr<Texture> LoadTextureFromFile(const std::string& path, gfx::SamplerInfo samplerInfo, Renderer* renderer, bool srgb = true);
|
2023-11-05 01:04:05 +00:00
|
|
|
|
|
|
|
} // namespace engine
|
2023-05-01 12:55:49 +00:00
|
|
|
|
|
|
|
#endif
|