Draw a string of text in an OpenGL window.
Syntax
int OpenGL_Text_DrawRasterFont(
char *str,
short size,
unsigned char r, unsigned char g, unsigned char b,
float x, float y, float z
) ;
Parameters
str
Character string to write.
size
Font size
r, g, b
Color of the text.
x, y, z
Position of the string.
Return value
This function return "0" if an error has occurred.
Remarks
You can use the following codes inside your text string to change the color or font of the text.
ex:
OpenGL_Text_DrawRasterFont( "Text: \01 Blue, \02 Black, \03 White \04 Red, \05 Yellow, \06 Green", 10, 0, 0, 0, 5, 25, 5 ) ;
OpenGL_Text_DrawRasterFont( "Text: \xF0 Normal, \xF1 Bold, \xF2 Italic", 10, 0, 0, 0, 5, 5, 5 ) ;
![]()
Requirements
Header:
sliceO_include.hpp
sliceO_OpenGL.hpp
Library:
sliceO_Structures.lib
Example
See also