Add Textures
This commit is contained in:
parent
78dc21fee8
commit
94a63390ef
19 changed files with 8232 additions and 29 deletions
|
@ -13,6 +13,8 @@
|
|||
#include <sys/stat.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "lodepng.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <GL/glew.h>
|
||||
#include <GL/gl.h>
|
||||
|
@ -20,6 +22,38 @@
|
|||
|
||||
bool fileExists(const std::string&);
|
||||
|
||||
class Shader;
|
||||
class Texture;
|
||||
class Image;
|
||||
|
||||
class Image{
|
||||
public:
|
||||
unsigned char* data;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
Image(unsigned char*,int,int);
|
||||
~Image();
|
||||
};
|
||||
|
||||
class Texture{
|
||||
public:
|
||||
static Texture* createTexture(const char*);
|
||||
static void destroyTexture(GLuint*);
|
||||
static void bindTexture(GLuint*);
|
||||
static void unbindTexture();
|
||||
|
||||
double ratioX;
|
||||
double ratioY;
|
||||
GLuint* id;
|
||||
|
||||
Texture(GLuint,double,double);
|
||||
~Texture();
|
||||
|
||||
private:
|
||||
static Image* loadTexture(const char*);
|
||||
};
|
||||
|
||||
class Shader{
|
||||
public:
|
||||
static std::string LoadSource(const char*);
|
||||
|
|
Reference in a new issue