1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| {
float sizeX = mFont->getSizeX(mMessage->getContent(mCharBegin, mCharEnd, mCaseMode));
float sizeY = mFont->getSizeY(mMessage->getContent(mCharBegin, mCharEnd, mCaseMode));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glColorMask(0, 0, 0, 0);
glStencilFunc(GL_ALWAYS, 0x1, 0x1);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);*/
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ZERO);
glTranslatef(mPosition[0],mPosition[1],mPosition[2]);
glRotatef(mRotation[0],1,0,0);
glRotatef(mRotation[1],0,1,0);
glRotatef(mRotation[2],0,0,1);
glColor4f(0.0, 0.0, 0.0, 1.0);
glPushAttrib(GL_LIST_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT);
mFont->draw(mMessage->getContent(mCharBegin, mCharEnd, mCaseMode));
glPopAttrib();
glBlendFunc(GL_DST_ALPHA, GL_ONE);
glColor4f(mCursorColorBefore.redF(), mCursorColorBefore.greenF(), mCursorColorBefore.blueF(), mAlpha);
glBegin(GL_QUADS);
glVertex3f(0, sizeY * 0.7, 0.0f);
glVertex3f(0, 2 * sizeY, 0.0f);
glVertex3f(mCursorEnd, 2 * sizeY, 0.0f);
glVertex3f(mCursorEnd, sizeY * 0.7, 0.0f);
glEnd();
glColor4f(mCursorColorAfter.redF(), mCursorColorAfter.greenF(), mCursorColorAfter.blueF(), mAlpha);
glBegin(GL_QUADS);
glVertex3f(mCursorEnd, sizeY * 0.7, 0.0f);
glVertex3f(mCursorEnd, 2 * sizeY, 0.0f);
glVertex3f(sizeX, 2 * sizeY, 0.0f);
glVertex3f(sizeX, sizeY * 0.7, 0.0f);
glEnd();
glPopMatrix();
} |
Partager