Created
June 16, 2012 16:35
-
-
Save KAYLukas/2941881 to your computer and use it in GitHub Desktop.
MessageDisplayer met stroking characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MessageDisplayer::draw(){ | |
glRasterPos2i(xOffset, yOffset); | |
//Loop through all messages, starting with the first added one | |
//up to the last added one | |
for(int i=0; i < 10; i++){ | |
int ai = (curr+i)%10; | |
Handle<DisplayMessage> mh = messages[ai]; | |
if(!mh) continue; | |
DisplayMessage *m = &*mh; | |
if(!m) continue; | |
string message = m->toString(); | |
glPushMatrix(); | |
glTranslatef(xOffset, yOffset + (18*i),0.0); | |
glScalef(0.15,-0.15,0); | |
for(int count=0; count < message.length(); count++){ | |
glutStrokeCharacter(GLUT_STROKE_ROMAN, message[count]); | |
} | |
glPopMatrix(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scalen lijkt me niet echt een goede optie. Dan gaan we eerst grote lijnen tekenen en ze vervolgens weer klein maken. Is er geen manier om glutStrokeCharacter kleine lijnen te laten tekeken?