mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-02-20 08:14:55 -05:00
32 lines
623 B
C++
32 lines
623 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <GL/glew.h>
|
|
|
|
namespace wowee {
|
|
namespace rendering {
|
|
|
|
class Texture {
|
|
public:
|
|
Texture() = default;
|
|
~Texture();
|
|
|
|
bool loadFromFile(const std::string& path);
|
|
bool loadFromMemory(const unsigned char* data, int width, int height, int channels);
|
|
|
|
void bind(GLuint unit = 0) const;
|
|
void unbind() const;
|
|
|
|
GLuint getID() const { return textureID; }
|
|
int getWidth() const { return width; }
|
|
int getHeight() const { return height; }
|
|
|
|
private:
|
|
GLuint textureID = 0;
|
|
int width = 0;
|
|
int height = 0;
|
|
};
|
|
|
|
} // namespace rendering
|
|
} // namespace wowee
|