CmRenderStateManager.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmModule.h"
  4. namespace CamelotFramework
  5. {
  6. class CM_EXPORT RenderStateManager : public Module<RenderStateManager>
  7. {
  8. public:
  9. /**
  10. * @brief Creates and initializes a new SamplerState.
  11. */
  12. SamplerStatePtr createSamplerState(const SAMPLER_STATE_DESC& desc) const;
  13. /**
  14. * @brief Creates and initializes a new DepthStencilState.
  15. */
  16. DepthStencilStatePtr createDepthStencilState(const DEPTH_STENCIL_STATE_DESC& desc) const;
  17. /**
  18. * @brief Creates and initializes a new RasterizerState.
  19. */
  20. RasterizerStatePtr createRasterizerState(const RASTERIZER_STATE_DESC& desc) const;
  21. /**
  22. * @brief Creates and initializes a new BlendState.
  23. */
  24. BlendStatePtr createBlendState(const BLEND_STATE_DESC& desc) const;
  25. /**
  26. * @brief Creates a completely empty and uninitialized SamplerState.
  27. * Should only be used for VERY specific purposes, like deserialization,
  28. * as it requires additional manual initialization that is not required normally.
  29. */
  30. SamplerStatePtr createEmptySamplerState() const;
  31. /**
  32. * @brief Creates a completely empty and uninitialized DepthStencilState.
  33. * Should only be used for VERY specific purposes, like deserialization,
  34. * as it requires additional manual initialization that is not required normally.
  35. */
  36. DepthStencilStatePtr createEmptyDepthStencilState() const;
  37. /**
  38. * @brief Creates a completely empty and uninitialized RasterizerState.
  39. * Should only be used for VERY specific purposes, like deserialization,
  40. * as it requires additional manual initialization that is not required normally.
  41. */
  42. RasterizerStatePtr createEmptyRasterizerState() const;
  43. /**
  44. * @brief Creates a completely empty and uninitialized BlendState.
  45. * Should only be used for VERY specific purposes, like deserialization,
  46. * as it requires additional manual initialization that is not required normally.
  47. */
  48. BlendStatePtr createEmptyBlendState() const;
  49. const SamplerStatePtr& getDefaultSamplerState() const;
  50. const BlendStatePtr& getDefaultBlendState() const;
  51. const RasterizerStatePtr& getDefaultRasterizerState() const;
  52. const DepthStencilStatePtr& getDefaultDepthStencilState() const;
  53. protected:
  54. virtual SamplerStatePtr createSamplerStateImpl() const;
  55. virtual BlendStatePtr createBlendStateImpl() const;
  56. virtual RasterizerStatePtr createRasterizerStateImpl() const;
  57. virtual DepthStencilStatePtr createDepthStencilStateImpl() const;
  58. private:
  59. mutable SamplerStatePtr mDefaultSamplerState;
  60. mutable BlendStatePtr mDefaultBlendState;
  61. mutable RasterizerStatePtr mDefaultRasterizerState;
  62. mutable DepthStencilStatePtr mDefaultDepthStencilState;
  63. };
  64. }