minor addition to GLDebugFont for non-blender text rendering (better readable on top of existing graphics)
Use GLDebugDrawStringInternal(xcoord,ycoord,text,rgb_color,use_blending,character_spacing);
This commit is contained in:
@@ -81,6 +81,11 @@ void GLDebugResetFont(int screenWidth,int screenHeight)
|
||||
#define USE_ARRAYS 1
|
||||
|
||||
void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3& rgb)
|
||||
{
|
||||
GLDebugDrawStringInternal(x,y,string,rgb,true,10);
|
||||
}
|
||||
|
||||
void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3& rgb, bool enableBlend, int spacing)
|
||||
{
|
||||
|
||||
if (!sTexturesInitialized)
|
||||
@@ -104,7 +109,14 @@ void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3&
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (enableBlend)
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
} else
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glBindTexture(GL_TEXTURE_2D, sTexture);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
@@ -178,7 +190,7 @@ void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3&
|
||||
glEnd();
|
||||
#endif
|
||||
|
||||
glTranslatef(10,0,0);
|
||||
glTranslatef(spacing,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user