opengl es and functions

burrows111
Unregistered
 
Post: #1
Hi all, please help,

am currently in the starting process of coding an opengl es "bowling" game,

i have small but goodish experience in opengl so ES shouldn't prove so hard to get to grips with, and i know 'C' abit but sadly i am not picking up objective c as well as hoped.

simply i am using the template that the SDK provides for an openGLes app, and yes runs fine, but am planning to implement game states . such as paused, main menu , etc.

I am having huge issues trying to get to grips with functions and their calls.

the template runs immediately a bouncing box, so what i am currently trying to do is edit this so that i am switching the state of the game and run a render function accordingly.

Code:
-(void) RenderPerState

{
    switch (gameState) {
        case 1:            //paused
            //do this while paused
            break;
        case 2:            //playing
            //do this while playing
            break;
        case 3:            //main menu
            -(void) render;
            break;
        case 4:            //splash screen
            //do this at splashscreen
            break;
        default:

            break;
    }
    
}

the case 3 statement all i want to do is run a function that was working but I just simply not calling it right..

suppose all i need ask is, how do i use correct syntax to run the render function

Code:
- (void) render
{
         // do my required opengl rendering.                
}

somebody please point this noob in the right direction.

thanks Smile
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #2
Quote this message in a reply
Post Reply