summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/glfont.h19
-rw-r--r--mogltk/glbase.cpp4
2 files changed, 17 insertions, 6 deletions
diff --git a/includes/glfont.h b/includes/glfont.h
index 502ff49..831da5e 100644
--- a/includes/glfont.h
+++ b/includes/glfont.h
@@ -1,17 +1,24 @@
#ifndef __GLFONT_H__
#define __GLFONT_H__
-#include "Exceptions.h"
+#include <SDL.h>
+#include "String.h"
#include "gltexture.h"
+#include "Color.h"
namespace mogltk {
- class glfont : public Base {
+ class font : public Base {
public:
- glfont();
- virtual ~glfont();
- void Load(const String &) throw (GeneralException);
+ font(const String & = "font.bin");
+ virtual ~font();
+ void drawentry(Uint16, Color = Color(255, 255, 255), int = -1, int = -1);
+
private:
- gltexture * fonttex;
+ Uint8 * sizes;
+ Uint16 nbentries, nbcT, nbT;
+ Uint8 flags, maxX, maxY, nbcU, nbcV;
+ texture ** fonttex;
+ Uint16 * corresp;
};
};
diff --git a/mogltk/glbase.cpp b/mogltk/glbase.cpp
index dabf28a..11d15ae 100644
--- a/mogltk/glbase.cpp
+++ b/mogltk/glbase.cpp
@@ -62,6 +62,9 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ Flip();
+
return 0;
}
@@ -115,6 +118,7 @@ void mogltk::glbase::Leave2DMode(void) {
void mogltk::glbase::Flip() {
SDL_GL_SwapBuffers();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
bool mogltk::glbase::is2D() {