2D Text in OpenGL
Hello everyone, I'm trying to get 2D Text into a 3D game using OpenGL with SDL. The team has decided to make the game platform independant to the best of our ability so I can't use any window functions. I found NeHe's tutorial (#17) helpful getting me started, but the text is transparent and changes color depending on the color bellow it. This is doesn't work for our game since it will mostly use vertex colors and shading and the text will need to be completely opaque on top of everything. Does anyone have any useful hints for getting a completely opaque fonts in OpenGL or have any links to any better tutorials? Thanks.
It seems like a nice api, but it causes a rediculous amount of errors in gl.h. Is this code compatible with all versions of openGL?
Just a thought. With NeHe's, couldn't you just push and pop the color attribute list before and after the text. And disable blending if you don't want your text to be transparent. For example.
glPushAttrib(GL_COLOR_BUFFER_BIT);//Draw your text and stuffglPopAttrib();
Quote:Original post by CurlyDanger
It seems like a nice api, but it causes a rediculous amount of errors in gl.h. Is this code compatible with all versions of openGL?
I think it's for X windows. I never used the given code but I found the tutorial most useful in writing my own font renderer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement