void (*assertNoErrors)(const char *file, int line);
GLFont *m_font; // MUST be set!
- int m_fontHeight;
- int m_fontAscent;
- int m_fontDescent;
/// \brief Renders \p string at the current raster-position of the current context.
void drawString(const char* string) const
if(g_camwindow_globals_private.m_showStats)
{
- glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_fontDescent, 0.0f);
+ glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent(), 0.0f);
extern const char* Renderer_GetStats();
GlobalOpenGL().drawString(Renderer_GetStats());
- glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_fontDescent - GlobalOpenGL().m_fontHeight, 0.0f);
+ glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - GlobalOpenGL().m_font->getPixelDescent() - GlobalOpenGL().m_font->getPixelHeight(), 0.0f);
extern const char* Cull_GetStats();
GlobalOpenGL().drawString(Cull_GetStats());
}
#endif
GlobalOpenGL().m_font = g_font;
- GlobalOpenGL().m_fontHeight = g_font->getPixelHeight();
- GlobalOpenGL().m_fontAscent = g_font->getPixelAscent();
- GlobalOpenGL().m_fontDescent = g_font->getPixelDescent();
}
void GlobalGL_sharedContextDestroyed()
inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser)
{
- return GlobalOpenGL().m_fontHeight;
+ return GlobalOpenGL().m_font->getPixelHeight();
}
const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser)
// draw coordinate text if needed
if ( g_xywindow_globals_private.show_coordinates) {
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
- // why does this not work on windows:
- // float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_fontAscent) / m_fScale;
- float offx = m_vOrigin[nDim2] + h - 13 / m_fScale;
- float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
+ float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_font->getPixelAscent()) / m_fScale;
+ float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
for (x = xb - fmod(xb, stepx); x <= xe ; x += stepx) {
glRasterPos2f (x, offx);
sprintf (text, "%g", x);