MyDocument.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // MyDocument.h
  3. // DisplayLinkAsyncMoviePlayer
  4. //
  5. // Created by vade on 10/26/10.
  6. // Copyright __MyCompanyName__ 2010 . All rights reserved.
  7. //
  8. #import "ModelLoaderHelperClasses.h"
  9. // assimp include files. These three are usually needed.
  10. #import "assimp.h"
  11. #import "aiPostProcess.h"
  12. #import "aiScene.h"
  13. #import <Cocoa/Cocoa.h>
  14. #import <OpenGL/OpenGL.h>
  15. #import <Quartz/Quartz.h>
  16. @interface MyDocument : NSPersistentDocument
  17. {
  18. CVDisplayLinkRef _displayLink;
  19. NSOpenGLContext* _glContext;
  20. NSOpenGLPixelFormat* _glPixelFormat;
  21. NSView* _view;
  22. // Assimp Stuff
  23. aiScene* _scene;
  24. struct aiVector3D scene_min, scene_max, scene_center;
  25. double normalizedScale;
  26. // Our array of textures.
  27. GLuint *textureIds;
  28. // only used if we use
  29. NSMutableArray* modelMeshes;
  30. BOOL builtBuffers;
  31. NSMutableDictionary* textureDictionary; // Array of Dicionaries that map image filenames to textureIds
  32. }
  33. @property (retain) IBOutlet NSView* _view;
  34. - (CVReturn)displayLinkRenderCallback:(const CVTimeStamp *)timeStamp;
  35. - (void) render;
  36. - (void) drawMeshesInContext:(CGLContextObj)cgl_ctx;
  37. - (void) createGLResourcesInContext:(CGLContextObj)cgl_ctx;
  38. - (void) deleteGLResourcesInContext:(CGLContextObj)cgl_ctx;
  39. - (void) loadTexturesInContext:(CGLContextObj)cgl_ctx withModelPath:(NSString*) modelPath;
  40. - (void) getBoundingBoxWithMinVector:(struct aiVector3D*) min maxVectr:(struct aiVector3D*) max;
  41. - (void) getBoundingBoxForNode:(const struct aiNode*)nd minVector:(struct aiVector3D*) min maxVector:(struct aiVector3D*) max matrix:(struct aiMatrix4x4*) trafo;
  42. @end