You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

61 lines
1.6 KiB

  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 "cimport.h"
  11. #import "postprocess.h"
  12. #import "scene.h"
  13. #import "types.h"
  14. #import <Cocoa/Cocoa.h>
  15. #import <OpenGL/OpenGL.h>
  16. #import <Quartz/Quartz.h>
  17. @interface MyDocument : NSPersistentDocument
  18. {
  19. CVDisplayLinkRef _displayLink;
  20. NSOpenGLContext* _glContext;
  21. NSOpenGLPixelFormat* _glPixelFormat;
  22. NSView* _view;
  23. // Assimp Stuff
  24. aiScene* _scene;
  25. aiVector3D scene_min, scene_max, scene_center;
  26. double normalizedScale;
  27. // Our array of textures.
  28. GLuint *textureIds;
  29. // only used if we use
  30. NSMutableArray* modelMeshes;
  31. BOOL builtBuffers;
  32. NSMutableDictionary* textureDictionary; // Array of Dicionaries that map image filenames to textureIds
  33. }
  34. @property (retain) IBOutlet NSView* _view;
  35. - (CVReturn)displayLinkRenderCallback:(const CVTimeStamp *)timeStamp;
  36. - (void) render;
  37. - (void) drawMeshesInContext:(CGLContextObj)cgl_ctx;
  38. - (void) createGLResourcesInContext:(CGLContextObj)cgl_ctx;
  39. - (void) deleteGLResourcesInContext:(CGLContextObj)cgl_ctx;
  40. - (void) loadTexturesInContext:(CGLContextObj)cgl_ctx withModelPath:(NSString*) modelPath;
  41. - (void) getBoundingBoxWithMinVector:(aiVector3D*) min maxVectr:(aiVector3D*) max;
  42. - (void) getBoundingBoxForNode:(const aiNode*)nd minVector:(aiVector3D*) min maxVector:(aiVector3D*) max matrix:(aiMatrix4x4*) trafo;
  43. @end