]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - include/igl.h
fix a compile error
[xonotic/netradiant.git] / include / igl.h
index 0662379e8323593c148a7f86c1fa314b4c1c17f3..35174967608d8fed17ea6aaf193f25d709b7bd43 100644 (file)
@@ -1976,6 +1976,7 @@ typedef unsigned int GLhandleARB;
 
 #endif
 
+#include "gtkutil/glfont.h"
 
 /// \brief A module which wraps a runtime-binding of the standard OpenGL functions.
 /// Provides convenience functions for querying availabiliy of extensions, rendering text and error-checking.
@@ -1997,23 +1998,21 @@ struct OpenGLBinding
   /// \brief Asserts that there no OpenGL errors have occurred since the last call to glGetError.
   void (*assertNoErrors)(const char *file, int line);
 
-  GLuint m_font;
-  int m_fontHeight;
-  int m_fontAscent;
-  int m_fontDescent;
+  GLFont *m_font; // MUST be set!
 
   /// \brief Renders \p string at the current raster-position of the current context.
   void drawString(const char* string) const
   {
-    m_glListBase(m_font);
-    m_glCallLists(GLsizei(strlen(string)), GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte*>(string));
+    m_font->printString(string);
   }
 
   /// \brief Renders \p character at the current raster-position of the current context.
   void drawChar(char character) const
   {
-    m_glListBase(m_font);
-    m_glCallLists(1, GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte*>(&character));
+    char s[2];
+    s[0] = character;
+    s[1] = 0;
+    drawString(s);
   }