diff --git a/api/txf_util.cpp b/api/txf_util.cpp index c6591b8e2a..961a231f15 100644 --- a/api/txf_util.cpp +++ b/api/txf_util.cpp @@ -54,6 +54,7 @@ void txf_load_fonts(char* dir) { } } + void txf_render_string( float alpha_value, // reference value to which incoming alpha values are compared. @@ -63,7 +64,10 @@ void txf_render_string( GLfloat * col, // colour int i, // font index see texfont.h char * s, // string ptr - float fRotation // optional rotation angle in degrees + float fRotAngle, // optional rotation angle + float fRotX, // optional rotation vector for X + float fRotY, // optional rotation vector for Y + float fRotZ // optional rotation vector for Z ){ glPushMatrix(); glEnable(GL_TEXTURE_2D); @@ -72,8 +76,8 @@ void txf_render_string( glTranslated(x, y, z); glScalef(1/fscale, 1/fscale, 1/fscale); - if (fRotation != 0.0f) { // we want to rotate around Z, which keeps our text in 2D plane - glRotatef(fRotation, 0.0f, 0.0f, 1.0f); + if (fRotAngle != 0.0f) { // we want to rotate around Z y default, which keeps our text in 2D plane + glRotatef(fRotAngle, fRotX, fRotY, fRotZ); } glEnable(GL_ALPHA_TEST); // use .1 and .5 for a dark and bright background respectively @@ -87,6 +91,7 @@ void txf_render_string( glPopMatrix(); } + #if 0 int main (){ // usage: diff --git a/api/txf_util.h b/api/txf_util.h index 444d38f217..93a159904e 100644 --- a/api/txf_util.h +++ b/api/txf_util.h @@ -35,7 +35,10 @@ extern void txf_render_string( GLfloat * col, // colour int i, // font index see texfont.h char * s, // string ptr - float fRotation = 0.0f // optional rotation angle + float fRotAngle = 0.0f, // optional rotation angle + float fRotX = 0.0f, // optional rotation vector for X + float fRotY = 0.0f, // optional rotation vector for Y + float fRotZ = 1.0f // optional rotation vector for Z ); #ifdef __cplusplus