1
0
Fork 0
blockofighter/src/graphics.h

49 lines
1,000 B
C
Raw Permalink Normal View History

2014-02-16 14:32:28 +00:00
#ifndef __GRAPHICS_H_INCLUDED__
#define __GRAPHICS_H_INCLUDED__
#ifdef WIN32
2015-06-03 12:29:34 +00:00
#pragma warning(disable : 4700)
2014-02-16 14:32:28 +00:00
#endif
#include "main.h"
#include "texture.h"
#include "glapi.h"
const int ID_ARRAY_INIT_SIZE = 16;
const int ID_ARRAY_GROW = 8;
#define DRUID GraphicsDruid::getInstance()
#define DIE_DRUID_DIE GraphicsDruid::destroy()
typedef unsigned char byte;
2015-06-03 12:29:34 +00:00
typedef struct jpeg_pixel {
Uint8 red;
Uint8 green;
Uint8 blue;
} jpeg_pixel;
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
class GraphicsDruid {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
static GraphicsDruid *instance;
int *idArray;
2014-02-16 14:32:28 +00:00
int textureCount;
int reserved;
GraphicsDruid(void);
~GraphicsDruid(void);
static void init(void);
static void destroy(void);
public:
static GraphicsDruid &getInstance(void);
2015-06-03 12:29:34 +00:00
int loadTexture(SDL_Surface *texture, int id = -1, int format = GL_RGB);
int loadTexture(char *path, int id = -1);
int loadTranspTexture(char *path, float *transpColor, int id = -1);
2014-02-16 14:32:28 +00:00
void freeTexture(int id);
void freeAll(void);
int getNewTextureID(int id);
};
#endif