diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/engine.h | 16 | ||||
-rw-r--r-- | include/glbase.h | 29 | ||||
-rw-r--r-- | include/glfont.h | 25 | ||||
-rw-r--r-- | include/gltexture.h | 26 |
4 files changed, 96 insertions, 0 deletions
diff --git a/include/engine.h b/include/engine.h new file mode 100644 index 0000000..2b8af3c --- /dev/null +++ b/include/engine.h @@ -0,0 +1,16 @@ +#ifndef __ENGINE_H__ +#define __ENGINE_H__ + +#include <IRC.h> + +namespace mogltk { + class engine : public Base { + public: + static int setup() throw(GeneralException); + static int GetInited(); + private: + static int inited; + }; +}; + +#endif diff --git a/include/glbase.h b/include/glbase.h new file mode 100644 index 0000000..1852250 --- /dev/null +++ b/include/glbase.h @@ -0,0 +1,29 @@ +#ifndef __GLBASE_H__ +#define __GLBASE_H__ + +#include <GL/gl.h> +#include <SDL.h> +#include <Exceptions.h> + +namespace mogltk { + class glbase : public Base { + public: + static int setup(int w = 640, int h = 480, int flags = 0) throw(GeneralException); + static int GetWidth(void); + static int GetHeight(void); + static int GetInited(void); + static void Enter2DMode(void); + static void Leave2DMode(void); + static void Flip(void); + static bool is2D(void); + static void glVertex(GLdouble, GLdouble, GLdouble = 0.0, GLdouble = 1.0); + static void glVertex(GLfloat, GLfloat, GLfloat = 0.0, GLfloat = 1.0); + static void glVertex(GLint, GLint, GLint = 0, GLint = 1); + static void glVertex(GLshort, GLshort, GLshort = 0, GLshort = 1); + private: + static int width, height, inited, twoD; + static SDL_Surface * surface; + }; +}; + +#endif diff --git a/include/glfont.h b/include/glfont.h new file mode 100644 index 0000000..de4ef63 --- /dev/null +++ b/include/glfont.h @@ -0,0 +1,25 @@ +#ifndef __GLFONT_H__ +#define __GLFONT_H__ + +#include <SDL.h> +#include <String.h> +#include <Color.h> +#include "gltexture.h" + +namespace mogltk { + class font : public Base { + public: + font(const String & = "font.bin"); + virtual ~font(); + void drawentry(Uint16, Color = Color(255, 255, 255), int = -1, int = -1); + + private: + Uint8 * sizes; + Uint16 nbentries, nbcT, nbT; + Uint8 flags, maxX, maxY, nbcU, nbcV; + texture ** fonttex; + Uint16 * corresp; + }; +}; + +#endif diff --git a/include/gltexture.h b/include/gltexture.h new file mode 100644 index 0000000..c18e6ec --- /dev/null +++ b/include/gltexture.h @@ -0,0 +1,26 @@ +#ifndef __GLTEXTURE_H__ +#define __GLTEXTURE_H__ + +#include <GL/gl.h> +#include <SDL.h> +#include <Exceptions.h> + +namespace mogltk { + class texture : public Base { + public: + texture(int = 256, int = 256, bool = false) throw (GeneralException); + virtual ~texture(); + SDL_Surface * GetSurface() throw (GeneralException); + void Generate() throw (GeneralException); + void Bind(bool = true) throw (GeneralException); + GLuint GetWidth(); + GLuint GetHeight(); + static void Unbind(void); + private: + GLuint width, height, tex; + SDL_Surface * surface; + bool planar; + }; +}; + +#endif |