One last thing, GLUT has yet another function for bitmap fonts, itsglutBitMapLengthand it computes the length in pixels of a string. The return value of this function is the sum of the widths for every character in the string. Here goes the syntax: intglutBitmapLength(void*font,char*st...
setOrthographicProjection();void*font=GLUT_BITMAP_8_BY_13; glPushMatrix(); glLoadIdentity(); renderBitmapString(30,15,0,font,(char*)"GLUT Tutorial @ Lighthouse3D"); renderBitmapString(30,30,0,font,s); renderBitmapString(30,45,0,font,(char*)"F1 - Game Mode 640x480 32 bits"); r...
# 需要导入模块: from OpenGL import GLUT [as 别名]# 或者: from OpenGL.GLUT importglutBitmapCharacter[as 别名]defdrawHud(str,color=(0,1,0)):importOpenGL.GLUTasglut# A pointer to a font style..# Fonts supported by GLUT are: GLUT_BITMAP_8_BY_13,# GLUT_BITMAP_9_BY_15, GLUT_BITMAP_...
glutAddMenuEntry("BITMAP_8_BY_13", INT_GLUT_BITMAP_8_BY_13); glutAddMenuEntry("BITMAP_9_BY_15", INT_GLUT_BITMAP_9_BY_15); glutAddMenuEntry("BITMAP_TIMES_ROMAN_10", INT_GLUT_BITMAP_TIMES_ROMAN_10); glutAddMenuEntry("BITMAP_TIMES_ROMAN_24", INT_GLUT_BITMAP_TIMES_ROMAN_24)...
GLUT_BITMAP_8_BY_13 GLUT_BITMAP_9_BY_15 GLUT_BITMAP_TIMES_ROMAN_10 GLUT_BITMAP_TIMES_ROMAN_24 GLUT_BITMAP_HELVETICA_10 GLUT_BITMAP_HELVETICA_12 GLUT_BITMAP_HELVETICA_18 有些字体名称很容易辨认,所以你应该能找到你要的,尽管如此,你会在下面的实例中的弹出菜单中尝试所有字体. ...
int glutBitmapWidth(GLUTbitmapFont font, int character); 返回一个图像字符的宽度 font是指定的图像字体,如下表所示: character为指定的字符 返回指定字符的宽度,以像素为单位 void glutStrokeCharacter(void* font, int character); 绘制一个图形字符
font=GLUT_BITMAP_8_BY_13;break;caseINT_GLUT_BITMAP_9_BY_15: font=GLUT_BITMAP_9_BY_15;break;caseINT_GLUT_BITMAP_TIMES_ROMAN_10: font=GLUT_BITMAP_TIMES_ROMAN_10;break;caseINT_GLUT_BITMAP_TIMES_ROMAN_24: font=GLUT_BITMAP_TIMES_ROMAN_24;break;caseINT_GLUT_BITMAP_HELVETICA_10: ...
int glutBitmapWidth(GLUTbitmapFont font, int character); 返回一个图像字符的宽度 font是指定的图像字体,如下表所示: character为指定的字符 返回指定字符的宽度,以像素为单位 void glutStrokeCharacter(void* font, int character); 绘制一个图形字符
int glutBitmapWidth(GLUTbitmapFont font, int character); 返回一个图像字符的宽度 font是指定的图像字体,如下表所示: character为指定的字符 返回指定字符的宽度,以像素为单位 void glutStrokeCharacter(void* font, int character); 绘制一个图形字符