Ok,
I now got something, but my 3D gets very weird and almost doest
shows up.
I would love to have this font rastering on while the 3D stuff is
under it.
Is it possible?
I also don’t know what is happening with that code.
This is what i got:
void renderScene(void) {
glClearColor(0.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
eyeX = sin(angle);
eyeZ = -cos(angle);
glLoadIdentity();
gluLookAt((eyeX*c.ex)zoom,c.ey+eyeY,(eyeZc.ez)*zoom,
c.cx,c.cy,c.cz,
0.0f,1.0f,0.0f);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho( 0, 640, 0, 480, 0.0, 1.0 );
glMatrixMode(GL_MODELVIEW);
// some 2d drawing like
glRasterPos2i(50, 50); // draw at position 0 100 pixel
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, ‘H’); // Will draw a H at
100 100, for more advanced text handling or if you don’t wanna link
with glut, check the opengl.org site for font rastering, SDL also
provide true type library.
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glutSwapBuffers();
}
glOrtho( 0, width, 0, height, 0.0, 1.0 );
_
Just a note to the list, I helped Nuno privately.
For reference, the error in the above code is
glMatrixMode(GL_MODELVIEW);
missing just after glClear. I usualy set the matrixMode I want to
use, that’s why I don’t restore it after my 2d “context”.
the glOrtho2d was a typo, it’s glOrtho or gluOrtho2D.
Best regardsOn 23 Nov 2006, at 02:10, Nuno Santos wrote:
Em Nov 22, 2006, ?s 6:31 PM, Sami N??t?nen escreveu:
–
Kuon
CEO - Goyman.com SA
http://www.goyman.com/
“Computers should not stop working when the users’ brain does.”
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2434 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061127/bd9900fe/attachment.bin