2
0

irrlicht.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /* irrlicht.h -- interface of the 'Irrlicht Engine'
  2. Copyright (C) 2002-2012 Nikolaus Gebhardt
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely, subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not
  10. claim that you wrote the original software. If you use this software
  11. in a product, an acknowledgment in the product documentation would be
  12. appreciated but is not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source distribution.
  16. Please note that the Irrlicht Engine is based in part on the work of the
  17. Independent JPEG Group, the zlib and the libPng. This means that if you use
  18. the Irrlicht Engine in your product, you must acknowledge somewhere in your
  19. documentation that you've used the IJG code. It would also be nice to mention
  20. that you use the Irrlicht Engine, the zlib and libPng. See the README files
  21. in the jpeglib, the zlib and libPng for further information.
  22. */
  23. #pragma once
  24. #include "aabbox3d.h"
  25. #include "CMeshBuffer.h"
  26. #include "coreutil.h"
  27. #include "dimension2d.h"
  28. #include "ECullingTypes.h"
  29. #include "EDebugSceneTypes.h"
  30. #include "EDriverFeatures.h"
  31. #include "EDriverTypes.h"
  32. #include "EGUIAlignment.h"
  33. #include "EGUIElementTypes.h"
  34. #include "EHardwareBufferFlags.h"
  35. #include "EMaterialProps.h"
  36. #include "EMaterialTypes.h"
  37. #include "ESceneNodeTypes.h"
  38. #include "fast_atof.h"
  39. #include "IAnimatedMesh.h"
  40. #include "IAnimatedMeshSceneNode.h"
  41. #include "IAttributes.h"
  42. #include "IBillboardSceneNode.h"
  43. #include "IBoneSceneNode.h"
  44. #include "ICameraSceneNode.h"
  45. #include "IContextManager.h"
  46. #include "ICursorControl.h"
  47. #include "IDummyTransformationSceneNode.h"
  48. #include "IEventReceiver.h"
  49. #include "IFileList.h"
  50. #include "IFileSystem.h"
  51. #include "IGPUProgrammingServices.h"
  52. #include "IGUIButton.h"
  53. #include "IGUICheckBox.h"
  54. #include "IGUIComboBox.h"
  55. #include "IGUIEditBox.h"
  56. #include "IGUIElement.h"
  57. #include "IGUIEnvironment.h"
  58. #include "IGUIFileOpenDialog.h"
  59. #include "IGUIFont.h"
  60. #include "IGUIFontBitmap.h"
  61. #include "IGUIImage.h"
  62. #include "IGUIListBox.h"
  63. #include "IGUIScrollBar.h"
  64. #include "IGUISkin.h"
  65. #include "IGUISpriteBank.h"
  66. #include "IGUIStaticText.h"
  67. #include "IGUITabControl.h"
  68. #include "IGUIToolbar.h"
  69. #include "IImage.h"
  70. #include "IImageLoader.h"
  71. #include "IImageWriter.h"
  72. #include "IIndexBuffer.h"
  73. #include "ILogger.h"
  74. #include "IMaterialRenderer.h"
  75. #include "IMaterialRendererServices.h"
  76. #include "IMesh.h"
  77. #include "IMeshBuffer.h"
  78. #include "IMeshCache.h"
  79. #include "IMeshLoader.h"
  80. #include "IMeshManipulator.h"
  81. #include "IMeshSceneNode.h"
  82. #include "IOSOperator.h"
  83. #include "IReadFile.h"
  84. #include "IReferenceCounted.h"
  85. #include "irrArray.h"
  86. #include "IRenderTarget.h"
  87. #include "IrrlichtDevice.h"
  88. #include "irrMath.h"
  89. #include "irrString.h"
  90. #include "irrTypes.h"
  91. #include "path.h"
  92. #include "ISceneCollisionManager.h"
  93. #include "ISceneManager.h"
  94. #include "ISceneNode.h"
  95. #include "IShaderConstantSetCallBack.h"
  96. #include "ISkinnedMesh.h"
  97. #include "ITexture.h"
  98. #include "ITimer.h"
  99. #include "IVertexBuffer.h"
  100. #include "IVideoDriver.h"
  101. #include "IWriteFile.h"
  102. #include "Keycodes.h"
  103. #include "line2d.h"
  104. #include "line3d.h"
  105. #include "matrix4.h"
  106. #include "plane3d.h"
  107. #include "position2d.h"
  108. #include "quaternion.h"
  109. #include "rect.h"
  110. #include "S3DVertex.h"
  111. #include "SAnimatedMesh.h"
  112. #include "SceneParameters.h"
  113. #include "SColor.h"
  114. #include "SExposedVideoData.h"
  115. #include "SIrrCreationParameters.h"
  116. #include "SMaterial.h"
  117. #include "SMesh.h"
  118. #include "SMeshBuffer.h"
  119. #include "SSkinMeshBuffer.h"
  120. #include "SVertexIndex.h"
  121. #include "SViewFrustum.h"
  122. #include "vector2d.h"
  123. #include "vector3d.h"
  124. #include "IrrCompileConfig.h" // for IRRLICHT_API and IRRCALLCONV
  125. /*! \mainpage Irrlicht Engine 1.9 API documentation
  126. *
  127. * <div align="center"><img src="logobig.png" ></div>
  128. *
  129. * \section intro Introduction
  130. *
  131. * Welcome to the Irrlicht Engine API documentation.
  132. * Here you'll find any information you'll need to develop applications with
  133. * the Irrlicht Engine. If you are looking for a tutorial on how to start, you'll
  134. * find some on the homepage of the Irrlicht Engine at
  135. * <A HREF="http://irrlicht.sourceforge.net" >irrlicht.sourceforge.net</A>
  136. * or inside the SDK in the examples directory.
  137. *
  138. * The Irrlicht Engine is intended to be an easy-to-use 3d engine, so
  139. * this documentation is an important part of it. If you have any questions or
  140. * suggestions, just send a email to the author of the engine, Nikolaus Gebhardt
  141. * (niko (at) irrlicht3d.org).
  142. *
  143. *
  144. * \section links Links
  145. *
  146. * <A HREF="namespaces.html">Namespaces</A>: A very good place to start reading
  147. * the documentation.<BR>
  148. * <A HREF="annotated.html">Class list</A>: List of all classes with descriptions.<BR>
  149. * <A HREF="functions.html">Class members</A>: Good place to find forgotten features.<BR>
  150. *
  151. * \section irrexample Short example
  152. *
  153. * A simple application, starting up the engine, loading a Quake 2 animated
  154. * model file and the corresponding texture, animating and displaying it
  155. * in front of a blue background and placing a user controlable 3d camera
  156. * would look like the following code. I think this example shows the usage
  157. * of the engine quite well:
  158. *
  159. * \code
  160. * #include <irrlicht.h>
  161. * using namespace irr;
  162. *
  163. * int main()
  164. * {
  165. * // start up the engine
  166. * IrrlichtDevice *device = createDevice(video::EDT_OPENGL,
  167. * core::dimension2d<u32>(640,480));
  168. *
  169. * video::IVideoDriver* driver = device->getVideoDriver();
  170. * scene::ISceneManager* scenemgr = device->getSceneManager();
  171. *
  172. * device->setWindowCaption(L"Hello World!");
  173. *
  174. * // load and show quake2 .md2 model
  175. * scene::ISceneNode* node = scenemgr->addAnimatedMeshSceneNode(
  176. * scenemgr->getMesh("quake2model.md2"));
  177. *
  178. * // if everything worked, add a texture and disable lighting
  179. * if (node)
  180. * {
  181. * node->setMaterialTexture(0, driver->getTexture("texture.bmp"));
  182. * node->setMaterialFlag(video::EMF_LIGHTING, false);
  183. * }
  184. *
  185. * // add a first person shooter style user controlled camera
  186. * scenemgr->addCameraSceneNodeFPS();
  187. *
  188. * // draw everything
  189. * while(device->run() && driver)
  190. * {
  191. * driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,255));
  192. * scenemgr->drawAll();
  193. * driver->endScene();
  194. * }
  195. *
  196. * // delete device
  197. * device->drop();
  198. * return 0;
  199. * }
  200. * \endcode
  201. *
  202. * Irrlicht can load a lot of file formats automatically, see irr::scene::ISceneManager::getMesh()
  203. * for a detailed list. So if you would like to replace the simple blue screen background by
  204. * a cool Quake 3 Map, optimized by an octree, just insert this code
  205. * somewhere before the while loop:
  206. *
  207. * \code
  208. * // add .pk3 archive to the file system
  209. * device->getFileSystem()->addZipFileArchive("quake3map.pk3");
  210. *
  211. * // load .bsp file and show it using an octree
  212. * scenemgr->addOctreeSceneNode(
  213. * scenemgr->getMesh("quake3map.bsp"));
  214. * \endcode
  215. *
  216. * As you can see, the engine uses namespaces. Everything in the engine is
  217. * placed into the namespace 'irr', but there are also 5 sub namespaces.
  218. * You can find a list of all namespaces with descriptions at the
  219. * <A HREF="namespaces.html"> namespaces page</A>.
  220. * This is also a good place to start reading the documentation. If you
  221. * don't want to write the namespace names all the time, just use all namespaces like
  222. * this:
  223. * \code
  224. * using namespace core;
  225. * using namespace scene;
  226. * using namespace video;
  227. * using namespace io;
  228. * using namespace gui;
  229. * \endcode
  230. *
  231. * There is a lot more the engine can do, but I hope this gave a short
  232. * overview over the basic features of the engine. For more examples, please take
  233. * a look into the examples directory of the SDK.
  234. */
  235. #include "SIrrCreationParameters.h"
  236. //! Everything in the Irrlicht Engine can be found in this namespace.
  237. namespace irr
  238. {
  239. //! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.
  240. /** If you need more parameters to be passed to the creation of the Irrlicht Engine device,
  241. use the createDeviceEx() function.
  242. \param driverType: Type of the video driver to use.
  243. \param windowSize: Size of the window or the video mode in fullscreen mode.
  244. \param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode.
  245. \param fullscreen: Should be set to true if the device should run in fullscreen. Otherwise
  246. the device runs in windowed mode.
  247. \param stencilbuffer: Specifies if the stencil buffer should be enabled. Set this to true,
  248. if you want the engine be able to draw stencil buffer shadows. Note that not all
  249. devices are able to use the stencil buffer. If they don't no shadows will be drawn.
  250. \param vsync: Specifies vertical synchronization: If set to true, the driver will wait
  251. for the vertical retrace period, otherwise not.
  252. \param receiver: A user created event receiver.
  253. \return Returns pointer to the created IrrlichtDevice or null if the
  254. device could not be created.
  255. */
  256. extern "C" IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(
  257. video::E_DRIVER_TYPE driverType = video::EDT_OPENGL,
  258. // parentheses are necessary for some compilers
  259. const core::dimension2d<u32> &windowSize = (core::dimension2d<u32>(640, 480)),
  260. u32 bits = 32,
  261. bool fullscreen = false,
  262. bool stencilbuffer = true,
  263. bool vsync = false,
  264. IEventReceiver *receiver = 0);
  265. //! Creates an Irrlicht device with the option to specify advanced parameters.
  266. /** Usually you should used createDevice() for creating an Irrlicht Engine device.
  267. Use this function only if you wish to specify advanced parameters like a window
  268. handle in which the device should be created.
  269. \param parameters: Structure containing advanced parameters for the creation of the device.
  270. See irr::SIrrlichtCreationParameters for details.
  271. \return Returns pointer to the created IrrlichtDevice or null if the
  272. device could not be created. */
  273. extern "C" IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDeviceEx(
  274. const SIrrlichtCreationParameters &parameters);
  275. // THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES
  276. // EXISTING ONLY FOR THE DOCUMENTATION SOFTWARE DOXYGEN.
  277. //! Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
  278. namespace core
  279. {
  280. }
  281. //! The gui namespace contains useful classes for easy creation of a graphical user interface.
  282. namespace gui
  283. {
  284. }
  285. //! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, ...
  286. namespace io
  287. {
  288. }
  289. //! All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees and billboards, ...
  290. namespace scene
  291. {
  292. }
  293. //! The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done here.
  294. namespace video
  295. {
  296. }
  297. }
  298. /*! \file irrlicht.h
  299. \brief Main header file of the irrlicht, the only file needed to include.
  300. */