CmPrerequisites.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /*-------------------------------------------------------------------------
  2. This source file is a part of OGRE
  3. (Object-oriented Graphics Rendering Engine)
  4. For the latest info, see http://www.ogre3d.org/
  5. Copyright (c) 2000-2011 Torus Knot Software Ltd
  6. Permission is hereby granted, free of charge, to any person obtaining a copy
  7. of this software and associated documentation files (the "Software"), to deal
  8. in the Software without restriction, including without limitation the rights
  9. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the Software is
  11. furnished to do so, subject to the following conditions:
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. THE SOFTWARE
  21. -------------------------------------------------------------------------*/
  22. #ifndef __OgrePrerequisites_H__
  23. #define __OgrePrerequisites_H__
  24. #include "CmPrerequisitesUtil.h"
  25. #define CM_MAX_MULTIPLE_RENDER_TARGETS 8
  26. //----------------------------------------------------------------------------
  27. // Windows Settings
  28. #if CM_PLATFORM == CM_PLATFORM_WIN32
  29. // If we're not including this from a client build, specify that the stuff
  30. // should get exported. Otherwise, import it.
  31. # if defined( CM_STATIC_LIB )
  32. // Linux compilers don't have symbol import/export directives.
  33. # define CM_EXPORT
  34. # else
  35. # if defined( CM_EXPORTS )
  36. # define CM_EXPORT __declspec( dllexport )
  37. # else
  38. # if defined( __MINGW32__ )
  39. # define CM_EXPORT
  40. # else
  41. # define CM_EXPORT __declspec( dllimport )
  42. # endif
  43. # endif
  44. # endif
  45. // Win32 compilers use _DEBUG for specifying debug builds.
  46. // for MinGW, we set DEBUG
  47. # if defined(_DEBUG) || defined(DEBUG)
  48. # define CM_DEBUG_MODE 1
  49. # else
  50. # define CM_DEBUG_MODE 0
  51. # endif
  52. #endif // CM_PLATFORM == CM_PLATFORM_WIN32
  53. namespace CamelotEngine {
  54. // Pre-declare classes
  55. // Allows use of pointers in header files without including individual .h
  56. // so decreases dependencies between files
  57. class Camera;
  58. class Color;
  59. class GpuProgram;
  60. class GpuProgramManager;
  61. class HardwareIndexBuffer;
  62. class HardwareOcclusionQuery;
  63. class HardwareVertexBuffer;
  64. class HardwarePixelBuffer;
  65. class HighLevelGpuProgram;
  66. class HighLevelGpuProgramManager;
  67. class HighLevelGpuProgramFactory;
  68. class IndexData;
  69. class Pass;
  70. class Technique;
  71. class Shader;
  72. class Material;
  73. class RenderSystem;
  74. class RenderSystemCapabilities;
  75. class RenderTarget;
  76. class RenderTexture;
  77. class MultiRenderTexture;
  78. class RenderWindow;
  79. class DepthStencilBuffer;
  80. class RenderOperation;
  81. class StringInterface;
  82. class SamplerState;
  83. class TextureManager;
  84. class Viewport;
  85. class VertexBufferBinding;
  86. class VertexData;
  87. class VertexDeclaration;
  88. class Input;
  89. class InputHandler;
  90. class Renderable;
  91. class Renderer;
  92. class RendererFactory;
  93. class RenderCommandBuffer;
  94. class WorkQueue;
  95. class PassParameters;
  96. class AsyncOp;
  97. class HardwareBufferManagerBase;
  98. class HardwareConstantBuffer;
  99. class CommandQueue;
  100. class DeferredRenderContext;
  101. class DepthStencilState;
  102. class RenderStateManager;
  103. class RasterizerState;
  104. class BlendState;
  105. class GpuParamBlock;
  106. class GpuParams;
  107. struct GpuParamDesc;
  108. struct GpuParamMemberDesc;
  109. struct GpuParamBlockDesc;
  110. // Asset import
  111. class SpecificImporter;
  112. class Importer;
  113. // Resources
  114. class Resource;
  115. class Resources;
  116. class Texture;
  117. class Mesh;
  118. // Scene
  119. class GameObject;
  120. class Component;
  121. class SceneManager;
  122. // RTTI
  123. class MeshRTTI;
  124. // Desc structs
  125. struct SAMPLER_STATE_DESC;
  126. struct DEPTH_STENCIL_STATE_DESC;
  127. struct RASTERIZER_STATE_DESC;
  128. struct BLEND_STATE_DESC;
  129. struct RENDER_TARGET_BLEND_STATE_DESC;
  130. }
  131. /* Shared pointer typedefs*/
  132. namespace CamelotEngine
  133. {
  134. typedef std::shared_ptr<GpuProgram> GpuProgramPtr;
  135. typedef std::shared_ptr<HighLevelGpuProgram> HighLevelGpuProgramPtr;
  136. typedef std::shared_ptr<HardwarePixelBuffer> HardwarePixelBufferPtr;
  137. typedef std::shared_ptr<VertexDeclaration> VertexDeclarationPtr;
  138. typedef std::shared_ptr<Mesh> MeshPtr;
  139. typedef std::shared_ptr<Texture> TexturePtr;
  140. typedef std::shared_ptr<Resource> ResourcePtr;
  141. typedef std::shared_ptr<Camera> CameraPtr;
  142. typedef std::shared_ptr<Renderable> RenderablePtr;
  143. typedef std::shared_ptr<Technique> TechniquePtr;
  144. typedef std::shared_ptr<Pass> PassPtr;
  145. typedef std::shared_ptr<Shader> ShaderPtr;
  146. typedef std::shared_ptr<Material> MaterialPtr;
  147. typedef std::shared_ptr<Renderer> RendererPtr;
  148. typedef std::shared_ptr<RendererFactory> RendererFactoryPtr;
  149. typedef std::shared_ptr<WorkQueue> WorkQueuePtr;
  150. typedef std::shared_ptr<PassParameters> PassParametersPtr;
  151. typedef std::shared_ptr<Component> ComponentPtr;
  152. typedef std::shared_ptr<GameObject> GameObjectPtr;
  153. typedef std::shared_ptr<HardwareConstantBuffer> HardwareConstantBufferPtr;
  154. typedef std::shared_ptr<DeferredRenderContext> DeferredRenderContextPtr;
  155. typedef std::shared_ptr<SamplerState> SamplerStatePtr;
  156. typedef std::shared_ptr<DepthStencilState> DepthStencilStatePtr;
  157. typedef std::shared_ptr<RasterizerState> RasterizerStatePtr;
  158. typedef std::shared_ptr<BlendState> BlendStatePtr;
  159. typedef std::shared_ptr<RenderWindow> RenderWindowPtr;
  160. typedef std::shared_ptr<RenderTarget> RenderTargetPtr;
  161. typedef std::shared_ptr<RenderTexture> RenderTexturePtr;
  162. typedef std::shared_ptr<DepthStencilBuffer> DepthStencilBufferPtr;
  163. typedef std::shared_ptr<MultiRenderTexture> MultiRenderTexturePtr;
  164. typedef std::shared_ptr<GpuParamBlock> GpuParamBlockPtr;
  165. typedef std::shared_ptr<GpuParams> GpuParamsPtr;
  166. }
  167. // All type IDs used for RTTI
  168. namespace CamelotEngine
  169. {
  170. enum TypeID_Core
  171. {
  172. TID_Texture = 1001,
  173. TID_Mesh = 1002,
  174. TID_MeshData = 1003,
  175. TID_VertexDeclaration = 1004,
  176. TID_VertexData = 1005,
  177. TID_Component = 1006,
  178. TID_Camera = 1007,
  179. TID_Renderable = 1008,
  180. TID_ResourceHandle = 1009,
  181. TID_GpuProgram = 1010,
  182. TID_ResourceHandleData = 1011,
  183. TID_CgProgram = 1012,
  184. TID_ResourceMetaData = 1013,
  185. TID_Pass = 1014,
  186. TID_Technique = 1015,
  187. TID_Shader = 1016,
  188. TID_Material = 1017,
  189. TID_MaterialParams = 1018,
  190. TID_FloatParamKVP = 1019,
  191. TID_MaterialTexParamKVP = 1020,
  192. TID_SamplerState = 1021,
  193. TID_SamplerStateParamKVP = 1022,
  194. TID_BlendState = 1023,
  195. TID_RasterizerState = 1024,
  196. TID_DepthStencilState = 1025
  197. };
  198. }
  199. /************************************************************************/
  200. /* Resource references */
  201. /************************************************************************/
  202. #include "CmResourceHandle.h"
  203. namespace CamelotEngine
  204. {
  205. typedef ResourceHandle<Resource> BaseResourceHandle;
  206. typedef ResourceHandle<Texture> TextureHandle;
  207. typedef ResourceHandle<Mesh> MeshHandle;
  208. typedef ResourceHandle<GpuProgram> GpuProgramHandle;
  209. typedef ResourceHandle<HighLevelGpuProgram> HighLevelGpuProgramHandle;
  210. typedef ResourceHandle<Material> MaterialHandle;
  211. }
  212. #endif