Sign in to follow this  
SparkyNZ

Problem display TGA texture on iPhone

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.

[url="http://www.mediafire.com/?23006zdftz3se1j"]Xcode Project[/url]

Cheers
Sparky

Share this post


Link to post
Share on other sites
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
[quote name='Hodgman' timestamp='1302342106' post='4796265']
Do you check for gl errors around the texture creation code?
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this