fork(1) download
  1. #import "WWSViewController.h"
  2.  
  3. @implementation WWSViewController {
  4. IrrlichtDevice *device;
  5. }
  6.  
  7. - (void)viewDidLoad
  8. {
  9. [super viewDidLoad];
  10.  
  11. device = createDevice( video::EDT_OGLES1, dimension2d<u32>(640, 480), 16, false, false, false, 0);
  12.  
  13. NSString *oBunPath = [[NSBundle mainBundle] bundlePath];
  14. device->getFileSystem()->changeWorkingDirectoryTo([oBunPath cStringUsingEncoding:NSASCIIStringEncoding]);
  15. }
  16.  
  17. - (void)clickedFirstScene:(id)sender
  18. {
  19. if (!device)
  20. return;
  21.  
  22. device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
  23.  
  24. IVideoDriver* driver = device->getVideoDriver();
  25. ISceneManager* smgr = device->getSceneManager();
  26. IGUIEnvironment* guienv = device->getGUIEnvironment();
  27.  
  28. guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
  29. rect<s32>(10,10,260,22), true);
  30.  
  31. IAnimatedMesh* mesh = smgr->getMesh("Ressources/media/sydney.md2");
  32. if (!mesh) {
  33. device->drop();
  34. return;
  35. }
  36. IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
  37.  
  38. if (node) {
  39. node->setMaterialFlag(EMF_LIGHTING, false);
  40. node->setMD2Animation(scene::EMAT_STAND);
  41. node->setMaterialTexture( 0, driver->getTexture("Ressources/media/sydney.bmp") );
  42. }
  43.  
  44. smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
  45.  
  46. CADisplayLink *displayLink = [[UIScreen mainScreen] displayLinkWithTarget:self selector:@selector(updateDisplay)];
  47. [displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
  48. }
  49.  
  50. - (void)updateDisplay
  51. {
  52. if (device != nil) {
  53. SExposedVideoData viewData((__bridge void*)firstSceneView);
  54.  
  55. device->getVideoDriver()->beginScene(true, true, SColor(255, 100, 101, 140), viewData);
  56. device->getSceneManager()->drawAll();
  57. device->getGUIEnvironment()->drawAll();
  58.  
  59. device->getVideoDriver()->endScene();
  60. }
  61. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.m:1:30: fatal error: WWSViewController.h: No such file or directory
compilation terminated.
stdout
Standard output is empty