diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-02 07:14:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-02 07:14:38 +0400 |
commit | a0229b21cb5cfc6e263cc2396d5b1e8530d9d38d (patch) | |
tree | 1f1c5e6401d0fe14458db6762886ba31fe1129f8 /source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | |
parent | 32b2b1f544661f6dee4a81428b562fe7a3bc3f13 (diff) |
text display (debug info) in the game engine working again & other minor changes.
Diffstat (limited to 'source/gameengine/BlenderRoutines/KX_BlenderGL.cpp')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 5cf696fe146..dba6d1113c9 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -103,6 +103,8 @@ void BL_SwapBuffers(wmWindow *win) void DisableForText() { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */ + if(glIsEnabled(GL_BLEND)) glDisable(GL_BLEND); if(glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST); @@ -135,32 +137,25 @@ void DisableForText() } } -void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height) +void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height) { /* gl prepping */ DisableForText(); - //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - - glOrtho(0, width, - 0, height, 0, 1); - + + glOrtho(0, width, 0, height, -100, 100); + glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); /* the actual drawing */ glColor3ub(255, 255, 255); - BLF_draw_default(xco, height-yco, 0.0f, text); + BLF_draw_default(xco, height-yco, 0.0f, (char *)text); - glMatrixMode(GL_TEXTURE); - glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); @@ -168,36 +163,29 @@ void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height glEnable(GL_DEPTH_TEST); } -void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height) +void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height) { /* This is a rather important line :( The gl-mode hasn't been left * behind quite as neatly as we'd have wanted to. I don't know * what cause it, though :/ .*/ DisableForText(); - //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, width, - 0, height, 0, 1); + glOrtho(0, width, 0, height, -100, 100); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); /* draw in black first*/ glColor3ub(0, 0, 0); - BLF_draw_default(xco+1, height-yco-1, 0.0f, text); + BLF_draw_default(xco+2, height-yco-2, 0.0f, (char *)text); glColor3ub(255, 255, 255); - BLF_draw_default(xco, height-yco, 0.0f, text); + BLF_draw_default(xco, height-yco, 0.0f, (char *)text); - glMatrixMode(GL_TEXTURE); - glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); |