light/modules/engine/include/engine/graphics/texture.hpp

43 lines
739 B
C++
Raw Normal View History

#pragma once
2025-07-05 13:28:41 +03:30
#include <engine/base/base.hpp>
namespace Light {
class SharedContext;
class Texture
{
public:
2025-07-05 16:07:51 +03:30
static Ref<Texture> create(
unsigned int width,
unsigned int height,
unsigned int components,
unsigned char *pixels,
2025-07-06 16:52:50 +03:30
const Ref<SharedContext>& sharedContext,
2025-07-05 16:07:51 +03:30
const std::string &filePath
);
2025-07-05 16:07:51 +03:30
Texture(const Texture &) = delete;
2025-07-06 14:02:50 +03:30
auto operator=(const Texture &) -> Texture & = delete;
virtual ~Texture() = default;
virtual void bind(unsigned int slot = 0) = 0;
2025-07-06 14:02:50 +03:30
virtual auto get_texture() -> void * = 0;
2025-07-06 16:52:50 +03:30
[[nodiscard]] auto GetFilePath() const -> const std::string &
2025-07-05 16:07:51 +03:30
{
return m_file_path;
}
protected:
std::string m_file_path;
2025-07-05 16:07:51 +03:30
2025-07-06 16:52:50 +03:30
Texture(std::string filePath);
};
} // namespace Light