Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-14-2010, 01:08 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
Default How to stop the GLView animation and restart it ?

Hi,

I am new to OpenGL ES application. I am trying to make an animation with 3D objects in .obj format.
The problem in my application are

1. I'm not able to stop the animation.
2. When ever i call the startAnimation() function in Class A it runs for the first time, it start crashes from second time onwards. Instead of Animation If i try to call an Audio it works.

Help me to solve the two issues. Below is the code where the issues arises.

//Class A
-(IBAction)play {
CGRect rect = [[UIScreen mainScreen] bounds];
glView = [[GLView alloc] initWithFrame:rect];
GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];
glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[self.view addSubview:glView];
[glView release];
}

-(IBAction)stop {
[glView stopAnimation];
[glView release];
[self.audioPlayer stop];
}

//class GLView
- (void)startAnimation {
animationInterval = 0.0;
animationTimer = nil;
animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(drawView) userInfo:nil repeats:YES];
}


- (void)stopAnimation {
[animationTimer invalidate];
animationTimer = nil;
animationInterval = 0.0;
}
selvamca45 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 262
23 members and 239 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, glenn_sayers, HemiMG, JasonR, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:30 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0