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:
@@ -40,6 +40,7 @@ class btTypedConstraint;
|
||||
|
||||
class DemoApplication
|
||||
{
|
||||
protected:
|
||||
void displayProfileString(int xOffset,int yStart,char* message);
|
||||
class CProfileIterator* m_profileIterator;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ subject to the following restrictions:
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
|
||||
void GLDebugDrawStringInternal(int x,int y,const char* string,const btVector3& rgb, bool enableBlend, int spacing);
|
||||
void GLDebugDrawStringInternal(int x,int y,const char* string,const btVector3& rgb);
|
||||
void GLDebugDrawString(int x,int y,const char* string);
|
||||
void GLDebugResetFont(int screenWidth,int screenHeight);
|
||||
|
||||
Reference in New Issue
Block a user