alpha channel texture problem

Started by
20 comments, last by Brother Bob 18 years, 1 month ago
Quote:Original post by Brother Bob
For drawing the text, no, it's not what you want.

If you insist on not using glWindowPos, this is what output should look like.
glMatrixMode(GL_PROJECTION);glPushMatrix();glLoadIdentity();glOrtho(0, window_width, 0, window_height, -1, 1);glTranslated(0.5, 0.5, 0);glMatrixMode(GL_MODLVIEW);glPushMatrix();glLoadIdentity();glRasterPos2f(x, y);// draw text hereglPopMatrix();glMatrixMode(GL_PROJECTION);glPopMatrix();glMatrixMode(GL_MODLVIEW);

Or use glWindowPos and forget about the matrices being ocrrect or not.

It gave me a lot of problem... how should i use glWindowPos ? thanks again
Advertisement
Did you read the link I poste above? The function pointer typedef you need is PFNGLWINDOWPOS2IPROC, and the function name to get is glWindowPos2i.

Define the function pointer in file scope.
PFNGLWINDOWPOS2IPROC glWindowPos2i;

Get the address when you have a rendering context.
glWindowPos2i = reinterpret_cast<PFNGLWINDOWPOS2IPROC>(wglGetProcAddress("glWindowPos2i"));


Also, make sure you disable everything that affects the redering. Disable blending and texture mapping before rendering the text. And depth testing is probably not needed either.

This topic is closed to new replies.

Advertisement