Image class won't render

iPhone Discussions

Image class won't render

Postby stefanhacko » Sun Aug 21, 2011 10:07 pm

I am using new Xcode 4 template and in method draw frame I try putting in method renderAtPoint but it just clears the screen to stetted clear color. What do I have to change to get the class working?

PLS Help...
stefanhacko
 
Posts: 2
Joined: Sun Aug 21, 2011 10:01 pm

Re: Image class won't render

Postby IME » Mon Aug 22, 2011 12:52 am

I have encountered the same problem. It seems like it has something to do with the
xcode 4 template and We need to use some other method to get it working.
Help would Be Appreciated :!: :!: :!:
IME
 
Posts: 29
Joined: Sat May 07, 2011 10:56 pm

Re: Image class won't render

Postby stefanhacko » Mon Aug 22, 2011 2:09 pm

Hello,

Solved the problem. Here are the thing you have to do:

1.Force template to use OpenGL ES 1.1 (tutorial 14).
2.In awakeFromNib method add these lines of code
Code: Select all
   

CGRect rect = [[UIScreen mainScreen] bounds];
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrthof(0, rect.size.width, 0, rect.size.height, -1, 1);
    glMatrixMode(GL_MODELVIEW);
    glViewport(0, 0, rect.size.width, rect.size.height);


3. Use Texture2D class from Mike's book
4. In drawFrame methode put your render code.

Hope this helps.
stefanhacko
 
Posts: 2
Joined: Sun Aug 21, 2011 10:01 pm

Re: Image class won't render

Postby IME » Tue Aug 23, 2011 6:35 am

Thanx that code really helped!!!
IME
 
Posts: 29
Joined: Sat May 07, 2011 10:56 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron