Texture2D iPhone SDK openGL -


I am using Texture2D class in the iPhone game using OpenGL ES.

Tutorials to understand their good texture2D class?

Especially I am looking at the initWithString method for printing text. The way it is applied, when you use it, you get white text. I would like to modify the method so that I can specify RGB color of the text. Any help / pointers?

Because the class uses alpha-only textures (read code!), Whatever color glColor Will be displayed in the set. View this line in initWithData (which is called by initWithString ):

  glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, width , Height, 0, GL_ALPAAA, GL_UNSINGEEEEEET, data);  

For red text, just call glColor4ub (255, 0, 0, 255) before drawing texture.

Ensure that you enable GL_BLEND and GL_COLOR_MATERIAL before drawing.

The class is small. I recommend that you read it.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -