X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=include%2Figl.h;h=35174967608d8fed17ea6aaf193f25d709b7bd43;hb=ff1b9a5bfa52164ee2229c7b8d936c5931fd3ab1;hp=b17534576788be97ac47bc78fa75d7c4f54de208;hpb=df072b781c54bd0c6ba916c3c16f9b0f2daa1836;p=xonotic%2Fnetradiant.git diff --git a/include/igl.h b/include/igl.h index b1753457..35174967 100644 --- a/include/igl.h +++ b/include/igl.h @@ -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(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(&character)); + char s[2]; + s[0] = character; + s[1] = 0; + drawString(s); } @@ -2318,8 +2317,14 @@ struct OpenGLBinding void (QGL_DLLEXPORT *m_glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); void (QGL_DLLEXPORT *m_glTexGeni)(GLenum coord, GLenum pname, GLint param); void (QGL_DLLEXPORT *m_glTexGeniv)(GLenum coord, GLenum pname, const GLint *params); +#if defined(MACVERSION) && MACVERSION > 15 + //Snow Leopard 16, Leopard 15, Tiger 14, Panther 13, ... + void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +#else void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +#endif void (QGL_DLLEXPORT *m_glTexParameterf)(GLenum target, GLenum pname, GLfloat param); void (QGL_DLLEXPORT *m_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); void (QGL_DLLEXPORT *m_glTexParameteri)(GLenum target, GLenum pname, GLint param);