ILightManager.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
  2. // Copyright (C) 2008-2012 Nikolaus Gebhardt
  3. // This file is part of the "Irrlicht Engine".
  4. // For conditions of distribution and use, see copyright notice in irrlicht.h
  5. #ifndef IRR_I_LIGHT_MANAGER_H_INCLUDED
  6. #define IRR_I_LIGHT_MANAGER_H_INCLUDED
  7. #include "IReferenceCounted.h"
  8. #include "irrArray.h"
  9. #include "ISceneManager.h" // for E_SCENE_NODE_RENDER_PASS, could probably move that to own header?
  10. namespace irr
  11. {
  12. namespace scene
  13. {
  14. class ISceneNode;
  15. //! ILightManager provides an interface for user applications to manipulate the list of lights in the scene.
  16. /** The light list can be trimmed or re-ordered before device/ hardware
  17. lights are created, and/or individual lights can be switched on and off
  18. before or after each scene node is rendered. It is assumed that the
  19. ILightManager implementation will store any data that it wishes to
  20. retain, i.e. the ISceneManager to which it is assigned, the lightList,
  21. the current render pass, and the current scene node.
  22. It can also be useful for shaders as it allows finding out the currently rendered SceneNode.
  23. */
  24. class ILightManager : public IReferenceCounted
  25. {
  26. public:
  27. //! Called after the scene's light list has been built, but before rendering has begun.
  28. /** As actual device/hardware lights are not created until the
  29. ESNRP_LIGHT render pass, this provides an opportunity for the
  30. light manager to trim or re-order the light list, before any
  31. device/hardware lights have actually been created.
  32. \param lightList: the Scene Manager's light list, which
  33. the light manager may modify. This reference will remain valid
  34. until OnPostRender().
  35. */
  36. virtual void OnPreRender(core::array<ISceneNode*> & lightList) {};
  37. //! Called after the last scene node is rendered.
  38. /** After this call returns, the lightList passed to OnPreRender() becomes invalid. */
  39. virtual void OnPostRender(void) {};
  40. //! Called before a render pass begins
  41. /** \param renderPass: the render pass that's about to begin */
  42. virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) {};
  43. //! Called after the render pass specified in OnRenderPassPreRender() ends
  44. /** \param[in] renderPass: the render pass that has finished */
  45. virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) {};
  46. //! Called before the given scene node is rendered
  47. /** \param[in] node: the scene node that's about to be rendered */
  48. virtual void OnNodePreRender(ISceneNode* node) {};
  49. //! Called after the the node specified in OnNodePreRender() has been rendered
  50. /** \param[in] node: the scene node that has just been rendered */
  51. virtual void OnNodePostRender(ISceneNode* node) {};
  52. };
  53. } // end namespace scene
  54. } // end namespace irr
  55. #endif