2021-06-29 11:01:11 +04:30
|
|
|
#pragma once
|
|
|
|
|
2025-07-05 13:28:41 +03:30
|
|
|
#include <engine/base/base.hpp>
|
2021-06-29 11:01:11 +04:30
|
|
|
|
|
|
|
namespace Light {
|
|
|
|
|
2022-03-07 20:01:44 +03:30
|
|
|
class SharedContext;
|
2021-06-29 11:01:11 +04:30
|
|
|
|
2022-03-07 20:01:44 +03:30
|
|
|
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
|
|
|
|
);
|
2021-06-29 11:01:11 +04:30
|
|
|
|
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;
|
2021-06-29 11:01:11 +04:30
|
|
|
|
2022-03-07 20:01:44 +03:30
|
|
|
virtual ~Texture() = default;
|
2021-06-29 11:01:11 +04:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void bind(unsigned int slot = 0) = 0;
|
2021-06-29 11:01:11 +04:30
|
|
|
|
2025-07-06 14:02:50 +03:30
|
|
|
virtual auto get_texture() -> void * = 0;
|
2021-10-05 13:44:32 +03:30
|
|
|
|
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;
|
|
|
|
}
|
2021-06-29 11:01:11 +04:30
|
|
|
|
2022-03-07 20:01:44 +03:30
|
|
|
protected:
|
2025-07-05 14:23:01 +03:30
|
|
|
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);
|
2022-03-07 20:01:44 +03:30
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Light
|