37 lines
615 B
C++
37 lines
615 B
C++
#pragma once
|
|
|
|
#include <asset.hpp>
|
|
#include <utility.hpp>
|
|
|
|
class Texture : public Asset
|
|
{
|
|
public:
|
|
Texture(const std::string& path)
|
|
{
|
|
filepath = path;
|
|
}
|
|
|
|
void Load(Renderer* renderer) override;
|
|
void Unload(Renderer* renderer) override;
|
|
|
|
std::string GetName() override
|
|
{
|
|
return Utility::GetFilename(filepath);
|
|
}
|
|
|
|
std::string GetPath() override
|
|
{
|
|
return filepath;
|
|
}
|
|
|
|
std::type_index GetType() override
|
|
{
|
|
return typeid(Texture);
|
|
}
|
|
|
|
unsigned char* pixels;
|
|
int height, width, channels;
|
|
|
|
private:
|
|
std::string filepath;
|
|
};
|