summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/text.c b/text.c
new file mode 100644
index 0000000..cd90efe
--- /dev/null
+++ b/text.c
@@ -0,0 +1,40 @@
+
+#include <GL/glc.h>
+
+#include "text.h"
+
+static GLuint font;
+
+int
+GLPong_TextInit() {
+ GLuint context = glcGenContext();
+ glcContext(context);
+
+
+ if (!glcIsContext(context)) {
+ return -1;
+ }
+
+#ifdef DEBUG
+ count = glcGeti(GLC_CATALOG_COUNT);
+ for (i = 0; i < count; i++) {
+ printf("%s\n", (char *)glcGetListc(GLC_CATALOG_LIST, i));
+ }
+#endif
+
+ font = glcGenFontID();
+ glcNewFontFromFamily(font, "Ar");
+ glcFontFace(font, "Normal");
+ glcRenderStyle(GLC_TEXTURE);
+ glcFont(font);
+
+ return 0;
+}
+
+void
+GLPong_TextDeinit() {
+ glcDeleteFont(font);
+}
+
+void
+GLPong_TextDrawFPS(GLfloat fps) { }