Files
2026-11-02 19:35:36 -05:00

33 lines
713 B
C++

#ifndef TEXTURE_CLASS_H
#define TEXTURE_CLASS_H
#include <string>
#include <vector>
#include <glad/glad.h>
// A loaded image and nothing else. Game elements wear one through a SurfaceTexture,
// get these from the ResourceManager.
class Texture {
public:
GLuint ID;
std::string path;
int width = 0;
int height = 0;
std::vector<unsigned char> pixels; // RGBA, row 0 is the bottom of the image
Texture(const char* filename);
Texture(int newWidth, int newHeight); // blank white
Texture(const Texture& source); // an independent copy with its own GL texture
// Sends pixels to the GPU after they've been edited
void Upload();
void Delete();
private:
void CreateGLTexture();
};
#endif