Box2DAppDelegate.mm
上传用户:gb3593
上传日期:2022-01-07
资源大小:3028k
文件大小:1k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. //
  2. //  Box2DAppDelegate.m
  3. //  Box2D
  4. //
  5. //  Box2D iPhone port by Simon Oliver - http://www.simonoliver.com - http://www.handcircus.com
  6. //
  7. #import <UIKit/UIKit.h>
  8. #import "Box2DAppDelegate.h"
  9. #import "Box2DView.h"
  10. @implementation Box2DAppDelegate
  11. @synthesize window;
  12. @synthesize glView;
  13. - (void)applicationDidFinishLaunching:(UIApplication *)application {
  14.     [application setStatusBarHidden:true];
  15. [glView removeFromSuperview];
  16. glView.animationInterval = 1.0 / 60.0;
  17. testEntriesView=[[TestEntriesViewController alloc] initWithStyle:UITableViewStylePlain];
  18. [testEntriesView setDelegate:self];
  19. [glView setDelegate:self];
  20. [window addSubview:[testEntriesView view]];
  21. }
  22. -(void) selectTest:(int) testIndex
  23. {
  24. [[testEntriesView view] removeFromSuperview];
  25. [window addSubview:glView];
  26. [glView startAnimation];
  27. [glView selectTestEntry:testIndex];
  28. }
  29. -(void) leaveTest
  30. {
  31. [glView stopAnimation];
  32. [glView removeFromSuperview];
  33. [window addSubview:[testEntriesView view]];
  34. }
  35. - (void)applicationWillResignActive:(UIApplication *)application {
  36. glView.animationInterval = 1.0 / 5.0;
  37. }
  38. - (void)applicationDidBecomeActive:(UIApplication *)application {
  39. glView.animationInterval = 1.0 / 60.0;
  40. }
  41. - (void)dealloc {
  42. [window release];
  43. [glView release];
  44. [super dealloc];
  45. }
  46. @end