summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorpixel <pixel>2002-11-11 20:07:41 +0000
committerpixel <pixel>2002-11-11 20:07:41 +0000
commit028c7dcfa9f1920d5fa2e573790bef40c4076275 (patch)
tree3c5f2bd9e90b7d57bae84111a200ee608c9d9bc3 /includes
parent9cde21d59d7c1f9b385d334cd60ae241ce9cf49b (diff)
Still working ;-)
Diffstat (limited to 'includes')
-rw-r--r--includes/General.h5
-rw-r--r--includes/glfont.h18
-rw-r--r--includes/gltexture.h24
3 files changed, 47 insertions, 0 deletions
diff --git a/includes/General.h b/includes/General.h
index 6f423ed..2b645c9 100644
--- a/includes/General.h
+++ b/includes/General.h
@@ -4,4 +4,9 @@
#define MAX(__a,__b) ((__a)<(__b)?(__b):(__a))
#define MIN(__a,__b) ((__a)>(__b)?(__b):(__a))
+#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
+#define BX_(x) ((x) - (((x)>>1)&0x77777777) \
+ - (((x)>>2)&0x33333333) \
+ - (((x)>>3)&0x11111111))
+
#endif
diff --git a/includes/glfont.h b/includes/glfont.h
new file mode 100644
index 0000000..502ff49
--- /dev/null
+++ b/includes/glfont.h
@@ -0,0 +1,18 @@
+#ifndef __GLFONT_H__
+#define __GLFONT_H__
+
+#include "Exceptions.h"
+#include "gltexture.h"
+
+namespace mogltk {
+ class glfont : public Base {
+ public:
+ glfont();
+ virtual ~glfont();
+ void Load(const String &) throw (GeneralException);
+ private:
+ gltexture * fonttex;
+ };
+};
+
+#endif
diff --git a/includes/gltexture.h b/includes/gltexture.h
new file mode 100644
index 0000000..5ac80ad
--- /dev/null
+++ b/includes/gltexture.h
@@ -0,0 +1,24 @@
+#ifndef __GLTEXTURE_H__
+#define __GLTEXTURE_H__
+
+#include <SDL.h>
+#include "Exceptions.h"
+
+namespace mogltk {
+ class gltexture : public Base {
+ public:
+ gltexture(int = 256, int = 256, bool = true) throw (GeneralException);
+ virtual ~gltexture();
+ SDL_Surface * GetSurface() throw (GeneralException);
+ void Generate() throw (GeneralException);
+ void Bind() throw (GeneralException);
+ GLuint GetWidth();
+ GLuint GetHeight();
+ private:
+ GLuint width, height, texture;
+ SDL_Surface * surface;
+ bool planar;
+ };
+};
+
+#endif