fork download
  1. #ifndef IRRLICHT_MANAGER_H
  2. #define IRRLICHT_MANAGER_H
  3.  
  4. #include "logging_priorities.h"
  5. #include <irrlicht.h>
  6. #include <IMeshCache.h>
  7. #include <vector>
  8. #include <map>
  9.  
  10. struct VideoMode
  11. {
  12. irr::core::dimension2d<irr::u32> mResolution;
  13. irr::s32 mDepth;
  14. };
  15.  
  16. struct android_app;
  17. class Config;
  18. class MeshTextureLoader;
  19.  
  20. // Interface to Irrlicht stuff
  21. // Does also handle cameras
  22. class IrrlichtManager
  23. {
  24. public:
  25. IrrlichtManager();
  26. ~IrrlichtManager();
  27.  
  28. irr::IrrlichtDevice* CreateIrrlichtDevicePC(const Config& config);
  29. irr::IrrlichtDevice* CreateIrrlichtDeviceAndroid(const Config& config, android_app * systemData);
  30.  
  31. bool Init(const Config& config);
  32. void Quit();
  33.  
  34. // shutdown eventreceiver before the rest of the app so it doesn't try handling gui-events while the gui is getting removed already
  35. void ShutDownEventReceiver();
  36.  
  37. void ForceIrrlichtUpdate();
  38.  
  39. irr::IrrlichtDevice* GetIrrlichtDevice() const { return mIrrlichtDevice; }
  40. irr::video::IVideoDriver* GetVideoDriver() const { return mVideoDriver; }
  41. irr::scene::ISceneManager* GetSceneManager() const { return mSceneManager; }
  42. irr::IEventReceiver* GetEventReceiver() const { return mEventReceiver; }
  43. irr::ITimer* GetIrrlichtTimer();
  44.  
  45. irr::scene::IAnimatedMeshSceneNode* LoadAnimatedModel(const Config& config, const irr::c8* fn_);
  46. irr::scene::ISceneNode* LoadModel(const Config& config, const irr::c8* fileModel_, irr::scene::ITriangleSelector** createSelector);
  47.  
  48. irr::scene::ICameraSceneNode* GetActiveCamera() const;
  49. irr::scene::ICameraSceneNode* GetGameCamera() const { return mCameraGame; }
  50. irr::scene::ICameraSceneNode* GetEditorCamera() const { return mCameraEditor; }
  51. irr::scene::ICameraSceneNode* GetGuiCamera() const { return mCameraGui; }
  52. void SetCameraMaya();
  53. void SetCameraFPS();
  54. void SetCameraGame();
  55. void SetCameraEditor();
  56. void SetCameraGui();
  57.  
  58. irr::scene::SMeshBuffer* CreateBoxMeshBuffer(const irr::core::aabbox3d<irr::f32> &box_);
  59. // only convex polygons or polygons where all lines from the first point to other points are within the polygon
  60. irr::scene::SMeshBuffer* CreateExtrudedPolyLineMeshBuffer(int numVertices_, const irr::core::vector3df * vertices_, const irr::core::vector3df &extrude_);
  61. irr::scene::SMeshBuffer* CreateArrowMeshBuffer(float length_, float width_, float height_);
  62. irr::scene::SMeshBuffer* CreateQuadradMeshBuffer(const irr::core::vector3df &leftTop_, const irr::core::vector3df &rightTop_, const irr::core::vector3df &leftBottom_, const irr::core::vector3df &rightBottom_);
  63.  
  64. // Set the material ambient color for this node and it's children.
  65. // Don't change the color of a material if one of it's ambient color values is set to ignore_
  66. void SetNodeAndChildsAmbientMaterial(irr::scene::ISceneNode* node_, int red_, int green_, int blue_, int ignore_=-1);
  67. void MakeGhost(irr::scene::ISceneNode* node_);
  68.  
  69. // Change materials based on texture names
  70. // label_ has just to be a part of the texture name like "alpha_blueredsky" if you search for "alpha"
  71. // label_ is not case sensitive
  72. void SetMaterialTypeByTextureName(irr::scene::IAnimatedMesh* animatedMesh_, irr::video::E_MATERIAL_TYPE type_, const char *label_);
  73. void SetEmissiveByTextureName(irr::scene::ISceneNode* node_, int red_, int green_, int blue_, const char *label_);
  74.  
  75. // set transformation and material so the draw3d-functions of the driver can be used
  76. void SetDriverDrawMode();
  77.  
  78. void SetNodeOrChildVisibleByName(irr::scene::ISceneNode* node_, const char *name_, bool visible_);
  79.  
  80. bool IsMeshInCache(const irr::io::path &path_);
  81. irr::scene::IAnimatedMesh * GetMeshInCache(const irr::io::path &path_);
  82.  
  83. const std::vector<VideoMode>& GetVideoModes() const { return mVideoModes; }
  84. int GetVideoModeIndex( unsigned int width_, unsigned int height_) const;
  85.  
  86. void LogAllTexturesInformation(LogPriority priority);
  87. void LogAllMeshInformation(LogPriority priority);
  88.  
  89. // For shaders the old materials have to be replaced by shader-materials
  90. // NOTE: This can be kicked if Irrlicht ever allows _replacing_ material renderers
  91. void SetRealMaterial(irr::video::E_MATERIAL_TYPE &type);
  92.  
  93. void SetShadersUseDynamicLight(bool enable);
  94.  
  95. MeshTextureLoader* GetStaticMeshTextureLoader() const { return mStaticMeshTextureLoader; }
  96. MeshTextureLoader* GetDynamicMeshTextureLoader() const { return mDynamicMeshTextureLoader; }
  97.  
  98. protected:
  99.  
  100. irr::u32 getMeshVertexCount(const irr::scene::IMesh* mesh) const;
  101.  
  102. void InitVideoModes(const Config& config, irr::IrrlichtDevice* device);
  103.  
  104. void AddAllES2Shaders(const Config& config, irr::video::IVideoDriver * driver, irr::scene::ISceneManager* smgr);
  105. void ClearES2Shaders();
  106. void LoadES2Shader(irr::video::IGPUProgrammingServices* gpu, const irr::c8* vertexShaderName, const irr::c8* fragmentShaderName, irr::video::IShaderConstantSetCallBack * cb, irr::video::E_MATERIAL_TYPE baseMaterial);
  107. void SetES2ShaderMaterials(irr::scene::IAnimatedMesh* animatedMesh);
  108.  
  109. irr::scene::IAnimatedMesh* LoadMesh(const Config& config, const irr::c8* filename, bool animated);
  110.  
  111. void setMaterialFlags(const Config& config, irr::scene::IAnimatedMesh* animatedMesh);
  112.  
  113. void SetSpecularMaterial(irr::scene::IAnimatedMesh* animatedMesh, int red_, int green_, int blue_, int ignore_=-1);
  114.  
  115. private:
  116. irr::IrrlichtDevice* mIrrlichtDevice;
  117. irr::video::IVideoDriver* mVideoDriver;
  118. irr::scene::ISceneManager* mSceneManager;
  119. irr::IEventReceiver* mEventReceiver;
  120. irr::scene::ICameraSceneNode* mCameraMaya;
  121. irr::scene::ICameraSceneNode* mCameraFPS;
  122. irr::scene::ICameraSceneNode* mCameraGame;
  123. irr::scene::ICameraSceneNode* mCameraEditor;
  124. irr::scene::ICameraSceneNode* mCameraGui;
  125. irr::video::SMaterial mDefaultEditorMaterial;
  126. std::vector<VideoMode> mVideoModes;
  127.  
  128. typedef std::map<irr::s32, irr::s32>::iterator ES2ShaderMaterialIter;
  129. std::map<irr::s32, irr::s32> mES2ShaderMaterials; // key is orig material id, value is shader material id
  130. typedef std::map<irr::s32, irr::video::IShaderConstantSetCallBack*>::iterator ES2ShaderIter;
  131. std::map<irr::s32, irr::video::IShaderConstantSetCallBack*> mES2Shaders; // key is shader material id
  132.  
  133. MeshTextureLoader* mStaticMeshTextureLoader;
  134. MeshTextureLoader* mDynamicMeshTextureLoader;
  135. };
  136.  
  137. #endif // IRRLICHT_MANAGER_H
  138.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:32: fatal error: logging_priorities.h: No such file or directory
 #include "logging_priorities.h"
                                ^
compilation terminated.
stdout
Standard output is empty