Sprite displaying problems
I'm completely new to iPhone development and am trying to write a simple game in Quartz2D. I'm stuck at the first hurdle, displaying the sprite on the screen.
I've worked out how to load my .png image and have successfully displayed it in a UIImage, so I know it's loading OK. But when I try to draw it to the screen using CGContextDrawImage nothing shows.
Here's my Code:-
I've put it in the main ViewController of my app.
UIImage *sprite = [UIImage imageNamed:@"icon.png"];
CGRect imageRect = CGRectMake(curX, curY, 320.0, 480.0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, imageRect, sprite.CGImage);
I've kept the code really simple so I don't see where I could be going wrong. Has anyone got any ideas?