• Advertisement
Sign in to follow this  

Problem display TGA texture on iPhone

This topic is 2509 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. The below project of mine works fine with OpenGL on Windows and the Mac but will not work on the iPhone simulator or physical device.

The below link is to an Xcode 4 project containing the usual SDL examples plus an extra one called Rectangles2. I can't get my font characters to appear on the screen - I just keep getting a white rectangle. The project loads a TGA file (loading seems to work but perhaps it doesn't??) and then I try to display parts of it (i.e extract font characters and render them on the screen).


Can somebody please have a look and tell me what is wrong with my project?

Please don't be critical of how its coded - I would just like to know what I'm missing to make it work.

Xcode Project

Cheers
Sparky

Share this post


Link to post
Share on other sites
Advertisement
I've just been told the problem was my parameter to the glTexImage2D function. The code I borrowed uses some literal values 3 and 4 whatever they are. Anyway, changing these to GL_RGBA has solved my problem.. so I'll have to go and read up on what this function actually does and how it works etc.

Share this post


Link to post
Share on other sites

Do you check for gl errors around the texture creation code?


No - in all honesty I cobbled together the program from various places in a short time. I made the assumption that because the TGA loading code compiled and linked that it was OK with OpenGL ES.. but obviously not.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement