IVideoDriver.h 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __IRR_I_VIDEO_DRIVER_H_INCLUDED__
  5. #define __IRR_I_VIDEO_DRIVER_H_INCLUDED__
  6. #include "rect.h"
  7. #include "SColor.h"
  8. #include "ITexture.h"
  9. #include "irrArray.h"
  10. #include "matrix4.h"
  11. #include "plane3d.h"
  12. #include "dimension2d.h"
  13. #include "position2d.h"
  14. #include "SMaterial.h"
  15. #include "IMeshBuffer.h"
  16. #include "triangle3d.h"
  17. #include "EDriverTypes.h"
  18. #include "EDriverFeatures.h"
  19. #include "SExposedVideoData.h"
  20. namespace irr
  21. {
  22. namespace io
  23. {
  24. class IAttributes;
  25. struct SAttributeReadWriteOptions;
  26. class IReadFile;
  27. class IWriteFile;
  28. } // end namespace io
  29. namespace scene
  30. {
  31. class IMeshBuffer;
  32. class IMesh;
  33. class IMeshManipulator;
  34. class ISceneNode;
  35. } // end namespace scene
  36. namespace video
  37. {
  38. struct S3DVertex;
  39. struct S3DVertex2TCoords;
  40. struct S3DVertexTangents;
  41. struct SLight;
  42. class IImageLoader;
  43. class IImageWriter;
  44. class IMaterialRenderer;
  45. class IGPUProgrammingServices;
  46. //! enumeration for geometry transformation states
  47. enum E_TRANSFORMATION_STATE
  48. {
  49. //! View transformation
  50. ETS_VIEW = 0,
  51. //! World transformation
  52. ETS_WORLD,
  53. //! Projection transformation
  54. ETS_PROJECTION,
  55. //! Texture transformation
  56. ETS_TEXTURE_0,
  57. //! Texture transformation
  58. ETS_TEXTURE_1,
  59. //! Texture transformation
  60. ETS_TEXTURE_2,
  61. //! Texture transformation
  62. ETS_TEXTURE_3,
  63. #if _IRR_MATERIAL_MAX_TEXTURES_>4
  64. //! Texture transformation
  65. ETS_TEXTURE_4,
  66. #if _IRR_MATERIAL_MAX_TEXTURES_>5
  67. //! Texture transformation
  68. ETS_TEXTURE_5,
  69. #if _IRR_MATERIAL_MAX_TEXTURES_>6
  70. //! Texture transformation
  71. ETS_TEXTURE_6,
  72. #if _IRR_MATERIAL_MAX_TEXTURES_>7
  73. //! Texture transformation
  74. ETS_TEXTURE_7,
  75. #endif
  76. #endif
  77. #endif
  78. #endif
  79. //! Not used
  80. ETS_COUNT
  81. };
  82. //! enumeration for signaling resources which were lost after the last render cycle
  83. /** These values can be signaled by the driver, telling the app that some resources
  84. were lost and need to be recreated. Irrlicht will sometimes recreate the actual objects,
  85. but the content needs to be recreated by the application. */
  86. enum E_LOST_RESOURCE
  87. {
  88. //! The whole device/driver is lost
  89. ELR_DEVICE = 1,
  90. //! All texture are lost, rare problem
  91. ELR_TEXTURES = 2,
  92. //! The Render Target Textures are lost, typical problem for D3D
  93. ELR_RTTS = 4,
  94. //! The HW buffers are lost, will be recreated automatically, but might require some more time this frame
  95. ELR_HW_BUFFERS = 8
  96. };
  97. //! Special render targets, which usually map to dedicated hardware
  98. /** These render targets (besides 0 and 1) need not be supported by gfx cards */
  99. enum E_RENDER_TARGET
  100. {
  101. //! Render target is the main color frame buffer
  102. ERT_FRAME_BUFFER=0,
  103. //! Render target is a render texture
  104. ERT_RENDER_TEXTURE,
  105. //! Multi-Render target textures
  106. ERT_MULTI_RENDER_TEXTURES,
  107. //! Render target is the main color frame buffer
  108. ERT_STEREO_LEFT_BUFFER,
  109. //! Render target is the right color buffer (left is the main buffer)
  110. ERT_STEREO_RIGHT_BUFFER,
  111. //! Render to both stereo buffers at once
  112. ERT_STEREO_BOTH_BUFFERS,
  113. //! Auxiliary buffer 0
  114. ERT_AUX_BUFFER0,
  115. //! Auxiliary buffer 1
  116. ERT_AUX_BUFFER1,
  117. //! Auxiliary buffer 2
  118. ERT_AUX_BUFFER2,
  119. //! Auxiliary buffer 3
  120. ERT_AUX_BUFFER3,
  121. //! Auxiliary buffer 4
  122. ERT_AUX_BUFFER4
  123. };
  124. //! Enum for the types of fog distributions to choose from
  125. enum E_FOG_TYPE
  126. {
  127. EFT_FOG_EXP=0,
  128. EFT_FOG_LINEAR,
  129. EFT_FOG_EXP2
  130. };
  131. const c8* const FogTypeNames[] =
  132. {
  133. "FogExp",
  134. "FogLinear",
  135. "FogExp2",
  136. 0
  137. };
  138. struct SOverrideMaterial
  139. {
  140. //! The Material values
  141. SMaterial Material;
  142. //! Which values are taken for override
  143. /** OR'ed values from E_MATERIAL_FLAGS. */
  144. u32 EnableFlags;
  145. //! Set in which render passes the material override is active.
  146. /** OR'ed values from E_SCENE_NODE_RENDER_PASS. */
  147. u16 EnablePasses;
  148. //! Global enable flag, overwritten by the SceneManager in each pass
  149. /** The Scenemanager uses the EnablePass array and sets Enabled to
  150. true if the Override material is enabled in the current pass. */
  151. bool Enabled;
  152. //! Default constructor
  153. SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false) {}
  154. //! Apply the enabled overrides
  155. void apply(SMaterial& material)
  156. {
  157. if (Enabled)
  158. {
  159. for (u32 i=0; i<32; ++i)
  160. {
  161. const u32 num=(1<<i);
  162. if (EnableFlags & num)
  163. {
  164. switch (num)
  165. {
  166. case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break;
  167. case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
  168. case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
  169. case EMF_LIGHTING: material.Lighting = Material.Lighting; break;
  170. case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
  171. case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
  172. case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
  173. case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
  174. case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break;
  175. case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break;
  176. case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break;
  177. case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
  178. case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
  179. case EMF_TEXTURE_WRAP:
  180. material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU;
  181. material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV;
  182. break;
  183. case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
  184. case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
  185. case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
  186. case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
  187. case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
  188. case EMF_POLYGON_OFFSET:
  189. material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
  190. material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. };
  197. struct IRenderTarget
  198. {
  199. IRenderTarget(ITexture* texture,
  200. E_COLOR_PLANE colorMask=ECP_ALL,
  201. E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
  202. E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
  203. E_BLEND_OPERATION blendOp=EBO_NONE) :
  204. RenderTexture(texture),
  205. TargetType(ERT_RENDER_TEXTURE), ColorMask(colorMask),
  206. BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
  207. BlendOp(blendOp) {}
  208. IRenderTarget(E_RENDER_TARGET target,
  209. E_COLOR_PLANE colorMask=ECP_ALL,
  210. E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
  211. E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
  212. E_BLEND_OPERATION blendOp=EBO_NONE) :
  213. RenderTexture(0),
  214. TargetType(target), ColorMask(colorMask),
  215. BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
  216. BlendOp(blendOp) {}
  217. bool operator!=(const IRenderTarget& other) const
  218. {
  219. return ((RenderTexture != other.RenderTexture) ||
  220. (TargetType != other.TargetType) ||
  221. (ColorMask != other.ColorMask) ||
  222. (BlendFuncSrc != other.BlendFuncSrc) ||
  223. (BlendFuncDst != other.BlendFuncDst) ||
  224. (BlendOp != other.BlendOp));
  225. }
  226. ITexture* RenderTexture;
  227. E_RENDER_TARGET TargetType:8;
  228. E_COLOR_PLANE ColorMask:8;
  229. E_BLEND_FACTOR BlendFuncSrc:4;
  230. E_BLEND_FACTOR BlendFuncDst:4;
  231. E_BLEND_OPERATION BlendOp:4;
  232. };
  233. //! Interface to driver which is able to perform 2d and 3d graphics functions.
  234. /** This interface is one of the most important interfaces of
  235. the Irrlicht Engine: All rendering and texture manipulation is done with
  236. this interface. You are able to use the Irrlicht Engine by only
  237. invoking methods of this interface if you like to, although the
  238. irr::scene::ISceneManager interface provides a lot of powerful classes
  239. and methods to make the programmer's life easier.
  240. */
  241. class IVideoDriver : public virtual IReferenceCounted
  242. {
  243. public:
  244. //! Applications must call this method before performing any rendering.
  245. /** This method can clear the back- and the z-buffer.
  246. \param backBuffer Specifies if the back buffer should be
  247. cleared, which means that the screen is filled with the color
  248. specified. If this parameter is false, the back buffer will
  249. not be cleared and the color parameter is ignored.
  250. \param zBuffer Specifies if the depth buffer (z buffer) should
  251. be cleared. It is not nesesarry to do so if only 2d drawing is
  252. used.
  253. \param color The color used for back buffer clearing
  254. \param videoData Handle of another window, if you want the
  255. bitmap to be displayed on another window. If this is an empty
  256. element, everything will be displayed in the default window.
  257. Note: This feature is not fully implemented for all devices.
  258. \param sourceRect Pointer to a rectangle defining the source
  259. rectangle of the area to be presented. Set to null to present
  260. everything. Note: not implemented in all devices.
  261. \return False if failed. */
  262. virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
  263. SColor color=SColor(255,0,0,0),
  264. const SExposedVideoData& videoData=SExposedVideoData(),
  265. core::rect<s32>* sourceRect=0) =0;
  266. //! Presents the rendered image to the screen.
  267. /** Applications must call this method after performing any
  268. rendering.
  269. \return False if failed and true if succeeded. */
  270. virtual bool endScene() =0;
  271. //! Queries the features of the driver.
  272. /** Returns true if a feature is available
  273. \param feature Feature to query.
  274. \return True if the feature is available, false if not. */
  275. virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0;
  276. //! Disable a feature of the driver.
  277. /** Can also be used to enable the features again. It is not
  278. possible to enable unsupported features this way, though.
  279. \param feature Feature to disable.
  280. \param flag When true the feature is disabled, otherwise it is enabled. */
  281. virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) =0;
  282. //! Get attributes of the actual video driver
  283. /** The following names can be queried for the given types:
  284. MaxTextures (int) The maximum number of simultaneous textures supported by the driver. This can be less than the supported number of textures of the driver. Use _IRR_MATERIAL_MAX_TEXTURES_ to adapt the number.
  285. MaxSupportedTextures (int) The maximum number of simultaneous textures supported by the fixed function pipeline of the (hw) driver. The actual supported number of textures supported by the engine can be lower.
  286. MaxLights (int) Number of hardware lights supported in the fixed function pipieline of the driver, typically 6-8. Use light manager or deferred shading for more.
  287. MaxAnisotropy (int) Number of anisotropy levels supported for filtering. At least 1, max is typically at 16 or 32.
  288. MaxUserClipPlanes (int) Number of additional clip planes, which can be set by the user via dedicated driver methods.
  289. MaxAuxBuffers (int) Special render buffers, which are currently not really usable inside Irrlicht. Only supported by OpenGL
  290. MaxMultipleRenderTargets (int) Number of render targets which can be bound simultaneously. Rendering to MRTs is done via shaders.
  291. MaxIndices (int) Number of indices which can be used in one render call (i.e. one mesh buffer).
  292. MaxTextureSize (int) Dimension that a texture may have, both in width and height.
  293. MaxGeometryVerticesOut (int) Number of vertices the geometry shader can output in one pass. Only OpenGL so far.
  294. MaxTextureLODBias (float) Maximum value for LOD bias. Is usually at around 16, but can be lower on some systems.
  295. Version (int) Version of the driver. Should be Major*100+Minor
  296. ShaderLanguageVersion (int) Version of the high level shader language. Should be Major*100+Minor.
  297. AntiAlias (int) Number of Samples the driver uses for each pixel. 0 and 1 means anti aliasing is off, typical values are 2,4,8,16,32
  298. */
  299. virtual const io::IAttributes& getDriverAttributes() const=0;
  300. //! Check if the driver was recently reset.
  301. /** For d3d devices you will need to recreate the RTTs if the
  302. driver was reset. Should be queried right after beginScene().
  303. */
  304. virtual bool checkDriverReset() =0;
  305. //! Sets transformation matrices.
  306. /** \param state Transformation type to be set, e.g. view,
  307. world, or projection.
  308. \param mat Matrix describing the transformation. */
  309. virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) =0;
  310. //! Returns the transformation set by setTransform
  311. /** \param state Transformation type to query
  312. \return Matrix describing the transformation. */
  313. virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const =0;
  314. //! Retrieve the number of image loaders
  315. /** \return Number of image loaders */
  316. virtual u32 getImageLoaderCount() const = 0;
  317. //! Retrieve the given image loader
  318. /** \param n The index of the loader to retrieve. This parameter is an 0-based
  319. array index.
  320. \return A pointer to the specified loader, 0 if the index is incorrect. */
  321. virtual IImageLoader* getImageLoader(u32 n) = 0;
  322. //! Retrieve the number of image writers
  323. /** \return Number of image writers */
  324. virtual u32 getImageWriterCount() const = 0;
  325. //! Retrieve the given image writer
  326. /** \param n The index of the writer to retrieve. This parameter is an 0-based
  327. array index.
  328. \return A pointer to the specified writer, 0 if the index is incorrect. */
  329. virtual IImageWriter* getImageWriter(u32 n) = 0;
  330. //! Sets a material.
  331. /** All 3d drawing functions will draw geometry using this material thereafter.
  332. \param material: Material to be used from now on. */
  333. virtual void setMaterial(const SMaterial& material) =0;
  334. //! Get access to a named texture.
  335. /** Loads the texture from disk if it is not
  336. already loaded and generates mipmap levels if desired.
  337. Texture loading can be influenced using the
  338. setTextureCreationFlag() method. The texture can be in several
  339. imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
  340. \param filename Filename of the texture to be loaded.
  341. \return Pointer to the texture, or 0 if the texture
  342. could not be loaded. This pointer should not be dropped. See
  343. IReferenceCounted::drop() for more information. */
  344. virtual ITexture* getTexture(const io::path& filename) = 0;
  345. //! Get access to a named texture.
  346. /** Loads the texture from disk if it is not
  347. already loaded and generates mipmap levels if desired.
  348. Texture loading can be influenced using the
  349. setTextureCreationFlag() method. The texture can be in several
  350. imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
  351. \param file Pointer to an already opened file.
  352. \return Pointer to the texture, or 0 if the texture
  353. could not be loaded. This pointer should not be dropped. See
  354. IReferenceCounted::drop() for more information. */
  355. virtual ITexture* getTexture(io::IReadFile* file) =0;
  356. //! Returns a texture by index
  357. /** \param index: Index of the texture, must be smaller than
  358. getTextureCount() Please note that this index might change when
  359. adding or removing textures
  360. \return Pointer to the texture, or 0 if the texture was not
  361. set or index is out of bounds. This pointer should not be
  362. dropped. See IReferenceCounted::drop() for more information. */
  363. virtual ITexture* getTextureByIndex(u32 index) =0;
  364. //! Returns amount of textures currently loaded
  365. /** \return Amount of textures currently loaded */
  366. virtual u32 getTextureCount() const = 0;
  367. //! Renames a texture
  368. /** \param texture Pointer to the texture to rename.
  369. \param newName New name for the texture. This should be a unique name. */
  370. virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
  371. //! Creates an empty texture of specified size.
  372. /** \param size: Size of the texture.
  373. \param name A name for the texture. Later calls to
  374. getTexture() with this name will return this texture
  375. \param format Desired color format of the texture. Please note
  376. that the driver may choose to create the texture in another
  377. color format.
  378. \return Pointer to the newly created texture. This pointer
  379. should not be dropped. See IReferenceCounted::drop() for more
  380. information. */
  381. virtual ITexture* addTexture(const core::dimension2d<u32>& size,
  382. const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
  383. //! Creates a texture from an IImage.
  384. /** \param name A name for the texture. Later calls of
  385. getTexture() with this name will return this texture
  386. \param image Image the texture is created from.
  387. \param mipmapData Optional pointer to a set of images which
  388. build up the whole mipmap set. Must be images of the same color
  389. type as image. If this parameter is not given, the mipmaps are
  390. derived from image.
  391. \return Pointer to the newly created texture. This pointer
  392. should not be dropped. See IReferenceCounted::drop() for more
  393. information. */
  394. virtual ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData=0) = 0;
  395. //! Adds a new render target texture to the texture cache.
  396. /** \param size Size of the texture, in pixels. Width and
  397. height should be a power of two (e.g. 64, 128, 256, 512, ...)
  398. and it should not be bigger than the backbuffer, because it
  399. shares the zbuffer with the screen buffer.
  400. \param name An optional name for the RTT.
  401. \param format The color format of the render target. Floating point formats are supported.
  402. \return Pointer to the created texture or 0 if the texture
  403. could not be created. This pointer should not be dropped. See
  404. IReferenceCounted::drop() for more information. */
  405. virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
  406. const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
  407. //! Removes a texture from the texture cache and deletes it.
  408. /** This method can free a lot of memory!
  409. Please note that after calling this, the pointer to the
  410. ITexture may no longer be valid, if it was not grabbed before
  411. by other parts of the engine for storing it longer. So it is a
  412. good idea to set all materials which are using this texture to
  413. 0 or another texture first.
  414. \param texture Texture to delete from the engine cache. */
  415. virtual void removeTexture(ITexture* texture) =0;
  416. //! Removes all textures from the texture cache and deletes them.
  417. /** This method can free a lot of memory!
  418. Please note that after calling this, the pointer to the
  419. ITexture may no longer be valid, if it was not grabbed before
  420. by other parts of the engine for storing it longer. So it is a
  421. good idea to set all materials which are using this texture to
  422. 0 or another texture first. */
  423. virtual void removeAllTextures() =0;
  424. //! Remove hardware buffer
  425. virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0;
  426. //! Remove all hardware buffers
  427. virtual void removeAllHardwareBuffers() =0;
  428. //! Create occlusion query.
  429. /** Use node for identification and mesh for occlusion test. */
  430. virtual void addOcclusionQuery(scene::ISceneNode* node,
  431. const scene::IMesh* mesh=0) =0;
  432. //! Remove occlusion query.
  433. virtual void removeOcclusionQuery(scene::ISceneNode* node) =0;
  434. //! Remove all occlusion queries.
  435. virtual void removeAllOcclusionQueries() =0;
  436. //! Run occlusion query. Draws mesh stored in query.
  437. /** If the mesh shall not be rendered visible, use
  438. overrideMaterial to disable the color and depth buffer. */
  439. virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0;
  440. //! Run all occlusion queries. Draws all meshes stored in queries.
  441. /** If the meshes shall not be rendered visible, use
  442. overrideMaterial to disable the color and depth buffer. */
  443. virtual void runAllOcclusionQueries(bool visible=false) =0;
  444. //! Update occlusion query. Retrieves results from GPU.
  445. /** If the query shall not block, set the flag to false.
  446. Update might not occur in this case, though */
  447. virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0;
  448. //! Update all occlusion queries. Retrieves results from GPU.
  449. /** If the query shall not block, set the flag to false.
  450. Update might not occur in this case, though */
  451. virtual void updateAllOcclusionQueries(bool block=true) =0;
  452. //! Return query result.
  453. /** Return value is the number of visible pixels/fragments.
  454. The value is a safe approximation, i.e. can be larger than the
  455. actual value of pixels. */
  456. virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
  457. //! Sets a boolean alpha channel on the texture based on a color key.
  458. /** This makes the texture fully transparent at the texels where
  459. this color key can be found when using for example draw2DImage
  460. with useAlphachannel==true. The alpha of other texels is not modified.
  461. \param texture Texture whose alpha channel is modified.
  462. \param color Color key color. Every texel with this color will
  463. become fully transparent as described above. Please note that the
  464. colors of a texture may be converted when loading it, so the
  465. color values may not be exactly the same in the engine and for
  466. example in picture edit programs. To avoid this problem, you
  467. could use the makeColorKeyTexture method, which takes the
  468. position of a pixel instead a color value.
  469. \param zeroTexels \deprecated If set to true, then any texels that match
  470. the color key will have their color, as well as their alpha, set to zero
  471. (i.e. black). This behavior matches the legacy (buggy) behavior prior
  472. to release 1.5 and is provided for backwards compatibility only.
  473. This parameter may be removed by Irrlicht 1.9. */
  474. virtual void makeColorKeyTexture(video::ITexture* texture,
  475. video::SColor color,
  476. bool zeroTexels = false) const =0;
  477. //! Sets a boolean alpha channel on the texture based on the color at a position.
  478. /** This makes the texture fully transparent at the texels where
  479. the color key can be found when using for example draw2DImage
  480. with useAlphachannel==true. The alpha of other texels is not modified.
  481. \param texture Texture whose alpha channel is modified.
  482. \param colorKeyPixelPos Position of a pixel with the color key
  483. color. Every texel with this color will become fully transparent as
  484. described above.
  485. \param zeroTexels \deprecated If set to true, then any texels that match
  486. the color key will have their color, as well as their alpha, set to zero
  487. (i.e. black). This behavior matches the legacy (buggy) behavior prior
  488. to release 1.5 and is provided for backwards compatibility only.
  489. This parameter may be removed by Irrlicht 1.9. */
  490. virtual void makeColorKeyTexture(video::ITexture* texture,
  491. core::position2d<s32> colorKeyPixelPos,
  492. bool zeroTexels = false) const =0;
  493. //! Creates a normal map from a height map texture.
  494. /** If the target texture has 32 bit, the height value is
  495. stored in the alpha component of the texture as addition. This
  496. value is used by the video::EMT_PARALLAX_MAP_SOLID material and
  497. similar materials.
  498. \param texture Texture whose alpha channel is modified.
  499. \param amplitude Constant value by which the height
  500. information is multiplied.*/
  501. virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
  502. //! Sets a new render target.
  503. /** This will only work if the driver supports the
  504. EVDF_RENDER_TO_TARGET feature, which can be queried with
  505. queryFeature(). Usually, rendering to textures is done in this
  506. way:
  507. \code
  508. // create render target
  509. ITexture* target = driver->addRenderTargetTexture(core::dimension2d<u32>(128,128), "rtt1");
  510. // ...
  511. driver->setRenderTarget(target); // set render target
  512. // .. draw stuff here
  513. driver->setRenderTarget(0); // set previous render target
  514. \endcode
  515. Please note that you cannot render 3D or 2D geometry with a
  516. render target as texture on it when you are rendering the scene
  517. into this render target at the same time. It is usually only
  518. possible to render into a texture between the
  519. IVideoDriver::beginScene() and endScene() method calls.
  520. \param texture New render target. Must be a texture created with
  521. IVideoDriver::addRenderTargetTexture(). If set to 0, it sets
  522. the previous render target which was set before the last
  523. setRenderTarget() call.
  524. \param clearBackBuffer Clears the backbuffer of the render
  525. target with the color parameter
  526. \param clearZBuffer Clears the zBuffer of the rendertarget.
  527. Note that because the frame buffer may share the zbuffer with
  528. the rendertarget, its zbuffer might be partially cleared too
  529. by this.
  530. \param color The background color for the render target.
  531. \return True if sucessful and false if not. */
  532. virtual bool setRenderTarget(video::ITexture* texture,
  533. bool clearBackBuffer=true, bool clearZBuffer=true,
  534. SColor color=video::SColor(0,0,0,0)) =0;
  535. //! set or reset special render targets
  536. /** This method enables access to special color buffers such as
  537. stereoscopic buffers or auxiliary buffers.
  538. \param target Enum value for the render target
  539. \param clearTarget Clears the target buffer with the color
  540. parameter
  541. \param clearZBuffer Clears the zBuffer of the rendertarget.
  542. Note that because the main frame buffer may share the zbuffer with
  543. the rendertarget, its zbuffer might be partially cleared too
  544. by this.
  545. \param color The background color for the render target.
  546. \return True if sucessful and false if not. */
  547. virtual bool setRenderTarget(E_RENDER_TARGET target, bool clearTarget=true,
  548. bool clearZBuffer=true,
  549. SColor color=video::SColor(0,0,0,0)) =0;
  550. //! Sets new multiple render targets.
  551. virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture,
  552. bool clearBackBuffer=true, bool clearZBuffer=true,
  553. SColor color=video::SColor(0,0,0,0)) =0;
  554. //! Sets a new viewport.
  555. /** Every rendering operation is done into this new area.
  556. \param area: Rectangle defining the new area of rendering
  557. operations. */
  558. virtual void setViewPort(const core::rect<s32>& area) =0;
  559. //! Gets the area of the current viewport.
  560. /** \return Rectangle of the current viewport. */
  561. virtual const core::rect<s32>& getViewPort() const =0;
  562. //! Draws a vertex primitive list
  563. /** Note that, depending on the index type, some vertices might be not
  564. accessible through the index list. The limit is at 65535 vertices for 16bit
  565. indices. Please note that currently not all primitives are available for
  566. all drivers, and some might be emulated via triangle renders.
  567. \param vertices Pointer to array of vertices.
  568. \param vertexCount Amount of vertices in the array.
  569. \param indexList Pointer to array of indices. These define the vertices used
  570. for each primitive. Depending on the pType, indices are interpreted as single
  571. objects (for point like primitives), pairs (for lines), triplets (for
  572. triangles), or quads.
  573. \param primCount Amount of Primitives
  574. \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex.
  575. \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
  576. \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */
  577. virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
  578. const void* indexList, u32 primCount,
  579. E_VERTEX_TYPE vType=EVT_STANDARD,
  580. scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,
  581. E_INDEX_TYPE iType=EIT_16BIT) =0;
  582. //! Draws a vertex primitive list in 2d
  583. /** Compared to the general (3d) version of this method, this
  584. one sets up a 2d render mode, and uses only x and y of vectors.
  585. Note that, depending on the index type, some vertices might be
  586. not accessible through the index list. The limit is at 65535
  587. vertices for 16bit indices. Please note that currently not all
  588. primitives are available for all drivers, and some might be
  589. emulated via triangle renders. This function is not available
  590. for the sw drivers.
  591. \param vertices Pointer to array of vertices.
  592. \param vertexCount Amount of vertices in the array.
  593. \param indexList Pointer to array of indices. These define the
  594. vertices used for each primitive. Depending on the pType,
  595. indices are interpreted as single objects (for point like
  596. primitives), pairs (for lines), triplets (for triangles), or
  597. quads.
  598. \param primCount Amount of Primitives
  599. \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex.
  600. \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
  601. \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */
  602. virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,
  603. const void* indexList, u32 primCount,
  604. E_VERTEX_TYPE vType=EVT_STANDARD,
  605. scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,
  606. E_INDEX_TYPE iType=EIT_16BIT) =0;
  607. //! Draws an indexed triangle list.
  608. /** Note that there may be at maximum 65536 vertices, because
  609. the index list is an array of 16 bit values each with a maximum
  610. value of 65536. If there are more than 65536 vertices in the
  611. list, results of this operation are not defined.
  612. \param vertices Pointer to array of vertices.
  613. \param vertexCount Amount of vertices in the array.
  614. \param indexList Pointer to array of indices.
  615. \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
  616. void drawIndexedTriangleList(const S3DVertex* vertices,
  617. u32 vertexCount, const u16* indexList, u32 triangleCount)
  618. {
  619. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
  620. }
  621. //! Draws an indexed triangle list.
  622. /** Note that there may be at maximum 65536 vertices, because
  623. the index list is an array of 16 bit values each with a maximum
  624. value of 65536. If there are more than 65536 vertices in the
  625. list, results of this operation are not defined.
  626. \param vertices Pointer to array of vertices.
  627. \param vertexCount Amount of vertices in the array.
  628. \param indexList Pointer to array of indices.
  629. \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
  630. void drawIndexedTriangleList(const S3DVertex2TCoords* vertices,
  631. u32 vertexCount, const u16* indexList, u32 triangleCount)
  632. {
  633. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT);
  634. }
  635. //! Draws an indexed triangle list.
  636. /** Note that there may be at maximum 65536 vertices, because
  637. the index list is an array of 16 bit values each with a maximum
  638. value of 65536. If there are more than 65536 vertices in the
  639. list, results of this operation are not defined.
  640. \param vertices Pointer to array of vertices.
  641. \param vertexCount Amount of vertices in the array.
  642. \param indexList Pointer to array of indices.
  643. \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
  644. void drawIndexedTriangleList(const S3DVertexTangents* vertices,
  645. u32 vertexCount, const u16* indexList, u32 triangleCount)
  646. {
  647. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT);
  648. }
  649. //! Draws an indexed triangle fan.
  650. /** Note that there may be at maximum 65536 vertices, because
  651. the index list is an array of 16 bit values each with a maximum
  652. value of 65536. If there are more than 65536 vertices in the
  653. list, results of this operation are not defined.
  654. \param vertices Pointer to array of vertices.
  655. \param vertexCount Amount of vertices in the array.
  656. \param indexList Pointer to array of indices.
  657. \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
  658. void drawIndexedTriangleFan(const S3DVertex* vertices,
  659. u32 vertexCount, const u16* indexList, u32 triangleCount)
  660. {
  661. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
  662. }
  663. //! Draws an indexed triangle fan.
  664. /** Note that there may be at maximum 65536 vertices, because
  665. the index list is an array of 16 bit values each with a maximum
  666. value of 65536. If there are more than 65536 vertices in the
  667. list, results of this operation are not defined.
  668. \param vertices Pointer to array of vertices.
  669. \param vertexCount Amount of vertices in the array.
  670. \param indexList Pointer to array of indices.
  671. \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
  672. void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices,
  673. u32 vertexCount, const u16* indexList, u32 triangleCount)
  674. {
  675. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
  676. }
  677. //! Draws an indexed triangle fan.
  678. /** Note that there may be at maximum 65536 vertices, because
  679. the index list is an array of 16 bit values each with a maximum
  680. value of 65536. If there are more than 65536 vertices in the
  681. list, results of this operation are not defined.
  682. \param vertices Pointer to array of vertices.
  683. \param vertexCount Amount of vertices in the array.
  684. \param indexList Pointer to array of indices.
  685. \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
  686. void drawIndexedTriangleFan(const S3DVertexTangents* vertices,
  687. u32 vertexCount, const u16* indexList, u32 triangleCount)
  688. {
  689. drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
  690. }
  691. //! Draws a 3d line.
  692. /** For some implementations, this method simply calls
  693. drawVertexPrimitiveList for some triangles.
  694. Note that the line is drawn using the current transformation
  695. matrix and material. So if you need to draw the 3D line
  696. independently of the current transformation, use
  697. \code
  698. driver->setMaterial(someMaterial);
  699. driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
  700. \endcode
  701. for some properly set up material before drawing the line.
  702. Some drivers support line thickness set in the material.
  703. \param start Start of the 3d line.
  704. \param end End of the 3d line.
  705. \param color Color of the line. */
  706. virtual void draw3DLine(const core::vector3df& start,
  707. const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
  708. //! Draws a 3d triangle.
  709. /** This method calls drawVertexPrimitiveList for some triangles.
  710. This method works with all drivers because it simply calls
  711. drawVertexPrimitiveList, but it is hence not very fast.
  712. Note that the triangle is drawn using the current
  713. transformation matrix and material. So if you need to draw it
  714. independently of the current transformation, use
  715. \code
  716. driver->setMaterial(someMaterial);
  717. driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
  718. \endcode
  719. for some properly set up material before drawing the triangle.
  720. \param triangle The triangle to draw.
  721. \param color Color of the line. */
  722. virtual void draw3DTriangle(const core::triangle3df& triangle,
  723. SColor color = SColor(255,255,255,255)) =0;
  724. //! Draws a 3d axis aligned box.
  725. /** This method simply calls draw3DLine for the edges of the
  726. box. Note that the box is drawn using the current transformation
  727. matrix and material. So if you need to draw it independently of
  728. the current transformation, use
  729. \code
  730. driver->setMaterial(someMaterial);
  731. driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
  732. \endcode
  733. for some properly set up material before drawing the box.
  734. \param box The axis aligned box to draw
  735. \param color Color to use while drawing the box. */
  736. virtual void draw3DBox(const core::aabbox3d<f32>& box,
  737. SColor color = SColor(255,255,255,255)) =0;
  738. //! Draws a 2d image without any special effects
  739. /** \param texture Pointer to texture to use.
  740. \param destPos Upper left 2d destination position where the
  741. image will be drawn. */
  742. virtual void draw2DImage(const video::ITexture* texture,
  743. const core::position2d<s32>& destPos) =0;
  744. //! Draws a 2d image using a color
  745. /** (if color is other than
  746. Color(255,255,255,255)) and the alpha channel of the texture.
  747. \param texture Texture to be drawn.
  748. \param destPos Upper left 2d destination position where the
  749. image will be drawn.
  750. \param sourceRect Source rectangle in the image.
  751. \param clipRect Pointer to rectangle on the screen where the
  752. image is clipped to.
  753. If this pointer is NULL the image is not clipped.
  754. \param color Color with which the image is drawn. If the color
  755. equals Color(255,255,255,255) it is ignored. Note that the
  756. alpha component is used: If alpha is other than 255, the image
  757. will be transparent.
  758. \param useAlphaChannelOfTexture: If true, the alpha channel of
  759. the texture is used to draw the image.*/
  760. virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
  761. const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
  762. SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
  763. //! Draws a set of 2d images, using a color and the alpha channel of the texture.
  764. /** The images are drawn beginning at pos and concatenated in
  765. one line. All drawings are clipped against clipRect (if != 0).
  766. The subtextures are defined by the array of sourceRects and are
  767. chosen by the indices given.
  768. \param texture Texture to be drawn.
  769. \param pos Upper left 2d destination position where the image
  770. will be drawn.
  771. \param sourceRects Source rectangles of the image.
  772. \param indices List of indices which choose the actual
  773. rectangle used each time.
  774. \param kerningWidth Offset to Position on X
  775. \param clipRect Pointer to rectangle on the screen where the
  776. image is clipped to.
  777. If this pointer is 0 then the image is not clipped.
  778. \param color Color with which the image is drawn.
  779. Note that the alpha component is used. If alpha is other than
  780. 255, the image will be transparent.
  781. \param useAlphaChannelOfTexture: If true, the alpha channel of
  782. the texture is used to draw the image. */
  783. virtual void draw2DImageBatch(const video::ITexture* texture,
  784. const core::position2d<s32>& pos,
  785. const core::array<core::rect<s32> >& sourceRects,
  786. const core::array<s32>& indices,
  787. s32 kerningWidth=0,
  788. const core::rect<s32>* clipRect=0,
  789. SColor color=SColor(255,255,255,255),
  790. bool useAlphaChannelOfTexture=false) =0;
  791. //! Draws a set of 2d images, using a color and the alpha channel of the texture.
  792. /** All drawings are clipped against clipRect (if != 0).
  793. The subtextures are defined by the array of sourceRects and are
  794. positioned using the array of positions.
  795. \param texture Texture to be drawn.
  796. \param positions Array of upper left 2d destinations where the
  797. images will be drawn.
  798. \param sourceRects Source rectangles of the image.
  799. \param clipRect Pointer to rectangle on the screen where the
  800. images are clipped to.
  801. If this pointer is 0 then the image is not clipped.
  802. \param color Color with which the image is drawn.
  803. Note that the alpha component is used. If alpha is other than
  804. 255, the image will be transparent.
  805. \param useAlphaChannelOfTexture: If true, the alpha channel of
  806. the texture is used to draw the image. */
  807. virtual void draw2DImageBatch(const video::ITexture* texture,
  808. const core::array<core::position2d<s32> >& positions,
  809. const core::array<core::rect<s32> >& sourceRects,
  810. const core::rect<s32>* clipRect=0,
  811. SColor color=SColor(255,255,255,255),
  812. bool useAlphaChannelOfTexture=false) =0;
  813. //! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.
  814. /** Suggested and first implemented by zola.
  815. \param texture The texture to draw from
  816. \param destRect The rectangle to draw into
  817. \param sourceRect The rectangle denoting a part of the texture
  818. \param clipRect Clips the destination rectangle (may be 0)
  819. \param colors Array of 4 colors denoting the color values of
  820. the corners of the destRect
  821. \param useAlphaChannelOfTexture True if alpha channel will be
  822. blended. */
  823. virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
  824. const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
  825. const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;
  826. //! Draws a 2d rectangle.
  827. /** \param color Color of the rectangle to draw. The alpha
  828. component will not be ignored and specifies how transparent the
  829. rectangle will be.
  830. \param pos Position of the rectangle.
  831. \param clip Pointer to rectangle against which the rectangle
  832. will be clipped. If the pointer is null, no clipping will be
  833. performed. */
  834. virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
  835. const core::rect<s32>* clip =0) =0;
  836. //! Draws a 2d rectangle with a gradient.
  837. /** \param colorLeftUp Color of the upper left corner to draw.
  838. The alpha component will not be ignored and specifies how
  839. transparent the rectangle will be.
  840. \param colorRightUp Color of the upper right corner to draw.
  841. The alpha component will not be ignored and specifies how
  842. transparent the rectangle will be.
  843. \param colorLeftDown Color of the lower left corner to draw.
  844. The alpha component will not be ignored and specifies how
  845. transparent the rectangle will be.
  846. \param colorRightDown Color of the lower right corner to draw.
  847. The alpha component will not be ignored and specifies how
  848. transparent the rectangle will be.
  849. \param pos Position of the rectangle.
  850. \param clip Pointer to rectangle against which the rectangle
  851. will be clipped. If the pointer is null, no clipping will be
  852. performed. */
  853. virtual void draw2DRectangle(const core::rect<s32>& pos,
  854. SColor colorLeftUp, SColor colorRightUp,
  855. SColor colorLeftDown, SColor colorRightDown,
  856. const core::rect<s32>* clip =0) =0;
  857. //! Draws the outline of a 2D rectangle.
  858. /** \param pos Position of the rectangle.
  859. \param color Color of the rectangle to draw. The alpha component
  860. specifies how transparent the rectangle outline will be. */
  861. virtual void draw2DRectangleOutline(const core::recti& pos,
  862. SColor color=SColor(255,255,255,255)) =0;
  863. //! Draws a 2d line. Both start and end will be included in coloring.
  864. /** \param start Screen coordinates of the start of the line
  865. in pixels.
  866. \param end Screen coordinates of the start of the line in
  867. pixels.
  868. \param color Color of the line to draw. */
  869. virtual void draw2DLine(const core::position2d<s32>& start,
  870. const core::position2d<s32>& end,
  871. SColor color=SColor(255,255,255,255)) =0;
  872. //! Draws a pixel.
  873. /** \param x The x-position of the pixel.
  874. \param y The y-position of the pixel.
  875. \param color Color of the pixel to draw. */
  876. virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
  877. //! Draws a non filled concyclic regular 2d polyon.
  878. /** This method can be used to draw circles, but also
  879. triangles, tetragons, pentagons, hexagons, heptagons, octagons,
  880. enneagons, decagons, hendecagons, dodecagon, triskaidecagons,
  881. etc. I think you'll got it now. And all this by simply
  882. specifying the vertex count. Welcome to the wonders of
  883. geometry.
  884. \param center Position of center of circle (pixels).
  885. \param radius Radius of circle in pixels.
  886. \param color Color of the circle.
  887. \param vertexCount Amount of vertices of the polygon. Specify 2
  888. to draw a line, 3 to draw a triangle, 4 for tetragons and a lot
  889. (>10) for nearly a circle. */
  890. virtual void draw2DPolygon(core::position2d<s32> center,
  891. f32 radius,
  892. video::SColor color=SColor(100,255,255,255),
  893. s32 vertexCount=10) =0;
  894. //! Draws a shadow volume into the stencil buffer.
  895. /** To draw a stencil shadow, do this: First, draw all geometry.
  896. Then use this method, to draw the shadow volume. Then, use
  897. IVideoDriver::drawStencilShadow() to visualize the shadow.
  898. Please note that the code for the opengl version of the method
  899. is based on free code sent in by Philipp Dortmann, lots of
  900. thanks go to him!
  901. \param triangles Array of 3d vectors, specifying the shadow
  902. volume.
  903. \param zfail If set to true, zfail method is used, otherwise
  904. zpass.
  905. \param debugDataVisible The debug data that is enabled for this
  906. shadow node
  907. */
  908. virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;
  909. //! Fills the stencil shadow with color.
  910. /** After the shadow volume has been drawn into the stencil
  911. buffer using IVideoDriver::drawStencilShadowVolume(), use this
  912. to draw the color of the shadow.
  913. Please note that the code for the opengl version of the method
  914. is based on free code sent in by Philipp Dortmann, lots of
  915. thanks go to him!
  916. \param clearStencilBuffer Set this to false, if you want to
  917. draw every shadow with the same color, and only want to call
  918. drawStencilShadow() once after all shadow volumes have been
  919. drawn. Set this to true, if you want to paint every shadow with
  920. its own color.
  921. \param leftUpEdge Color of the shadow in the upper left corner
  922. of screen.
  923. \param rightUpEdge Color of the shadow in the upper right
  924. corner of screen.
  925. \param leftDownEdge Color of the shadow in the lower left
  926. corner of screen.
  927. \param rightDownEdge Color of the shadow in the lower right
  928. corner of screen. */
  929. virtual void drawStencilShadow(bool clearStencilBuffer=false,
  930. video::SColor leftUpEdge = video::SColor(255,0,0,0),
  931. video::SColor rightUpEdge = video::SColor(255,0,0,0),
  932. video::SColor leftDownEdge = video::SColor(255,0,0,0),
  933. video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
  934. //! Draws a mesh buffer
  935. /** \param mb Buffer to draw */
  936. virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
  937. //! Draws normals of a mesh buffer
  938. /** \param mb Buffer to draw the normals of
  939. \param length length scale factor of the normals
  940. \param color Color the normals are rendered with
  941. */
  942. virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f, SColor color=0xffffffff) =0;
  943. //! Sets the fog mode.
  944. /** These are global values attached to each 3d object rendered,
  945. which has the fog flag enabled in its material.
  946. \param color Color of the fog
  947. \param fogType Type of fog used
  948. \param start Only used in linear fog mode (linearFog=true).
  949. Specifies where fog starts.
  950. \param end Only used in linear fog mode (linearFog=true).
  951. Specifies where fog ends.
  952. \param density Only used in exponential fog mode
  953. (linearFog=false). Must be a value between 0 and 1.
  954. \param pixelFog Set this to false for vertex fog, and true if
  955. you want per-pixel fog.
  956. \param rangeFog Set this to true to enable range-based vertex
  957. fog. The distance from the viewer is used to compute the fog,
  958. not the z-coordinate. This is better, but slower. This might not
  959. be available with all drivers and fog settings. */
  960. virtual void setFog(SColor color=SColor(0,255,255,255),
  961. E_FOG_TYPE fogType=EFT_FOG_LINEAR,
  962. f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,
  963. bool pixelFog=false, bool rangeFog=false) =0;
  964. //! Gets the fog mode.
  965. virtual void getFog(SColor& color, E_FOG_TYPE& fogType,
  966. f32& start, f32& end, f32& density,
  967. bool& pixelFog, bool& rangeFog) = 0;
  968. //! Get the current color format of the color buffer
  969. /** \return Color format of the color buffer. */
  970. virtual ECOLOR_FORMAT getColorFormat() const =0;
  971. //! Get the size of the screen or render window.
  972. /** \return Size of screen or render window. */
  973. virtual const core::dimension2d<u32>& getScreenSize() const =0;
  974. //! Get the size of the current render target
  975. /** This method will return the screen size if the driver
  976. doesn't support render to texture, or if the current render
  977. target is the screen.
  978. \return Size of render target or screen/window */
  979. virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const =0;
  980. //! Returns current frames per second value.
  981. /** This value is updated approximately every 1.5 seconds and
  982. is only intended to provide a rough guide to the average frame
  983. rate. It is not suitable for use in performing timing
  984. calculations or framerate independent movement.
  985. \return Approximate amount of frames per second drawn. */
  986. virtual s32 getFPS() const =0;
  987. //! Returns amount of primitives (mostly triangles) which were drawn in the last frame.
  988. /** Together with getFPS() very useful method for statistics.
  989. \param mode Defines if the primitives drawn are accumulated or
  990. counted per frame.
  991. \return Amount of primitives drawn in the last frame. */
  992. virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0;
  993. //! Deletes all dynamic lights which were previously added with addDynamicLight().
  994. virtual void deleteAllDynamicLights() =0;
  995. //! adds a dynamic light, returning an index to the light
  996. //! \param light: the light data to use to create the light
  997. //! \return An index to the light, or -1 if an error occurs
  998. virtual s32 addDynamicLight(const SLight& light) =0;
  999. //! Returns the maximal amount of dynamic lights the device can handle
  1000. /** \return Maximal amount of dynamic lights. */
  1001. virtual u32 getMaximalDynamicLightAmount() const =0;
  1002. //! Returns amount of dynamic lights currently set
  1003. /** \return Amount of dynamic lights currently set */
  1004. virtual u32 getDynamicLightCount() const =0;
  1005. //! Returns light data which was previously set by IVideoDriver::addDynamicLight().
  1006. /** \param idx Zero based index of the light. Must be 0 or
  1007. greater and smaller than IVideoDriver::getDynamicLightCount.
  1008. \return Light data. */
  1009. virtual const SLight& getDynamicLight(u32 idx) const =0;
  1010. //! Turns a dynamic light on or off
  1011. //! \param lightIndex: the index returned by addDynamicLight
  1012. //! \param turnOn: true to turn the light on, false to turn it off
  1013. virtual void turnLightOn(s32 lightIndex, bool turnOn) =0;
  1014. //! Gets name of this video driver.
  1015. /** \return Returns the name of the video driver, e.g. in case
  1016. of the Direct3D8 driver, it would return "Direct3D 8.1". */
  1017. virtual const wchar_t* getName() const =0;
  1018. //! Adds an external image loader to the engine.
  1019. /** This is useful if the Irrlicht Engine should be able to load
  1020. textures of currently unsupported file formats (e.g. gif). The
  1021. IImageLoader only needs to be implemented for loading this file
  1022. format. A pointer to the implementation can be passed to the
  1023. engine using this method.
  1024. \param loader Pointer to the external loader created. */
  1025. virtual void addExternalImageLoader(IImageLoader* loader) =0;
  1026. //! Adds an external image writer to the engine.
  1027. /** This is useful if the Irrlicht Engine should be able to
  1028. write textures of currently unsupported file formats (e.g
  1029. .gif). The IImageWriter only needs to be implemented for
  1030. writing this file format. A pointer to the implementation can
  1031. be passed to the engine using this method.
  1032. \param writer: Pointer to the external writer created. */
  1033. virtual void addExternalImageWriter(IImageWriter* writer) =0;
  1034. //! Returns the maximum amount of primitives
  1035. /** (mostly vertices) which the device is able to render with
  1036. one drawVertexPrimitiveList call.
  1037. \return Maximum amount of primitives. */
  1038. virtual u32 getMaximalPrimitiveCount() const =0;
  1039. //! Enables or disables a texture creation flag.
  1040. /** These flags define how textures should be created. By
  1041. changing this value, you can influence for example the speed of
  1042. rendering a lot. But please note that the video drivers take
  1043. this value only as recommendation. It could happen that you
  1044. enable the ETCF_ALWAYS_16_BIT mode, but the driver still creates
  1045. 32 bit textures.
  1046. \param flag Texture creation flag.
  1047. \param enabled Specifies if the given flag should be enabled or
  1048. disabled. */
  1049. virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true) =0;
  1050. //! Returns if a texture creation flag is enabled or disabled.
  1051. /** You can change this value using setTextureCreationFlag().
  1052. \param flag Texture creation flag.
  1053. \return The current texture creation flag enabled mode. */
  1054. virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
  1055. //! Creates a software image from a file.
  1056. /** No hardware texture will be created for this image. This
  1057. method is useful for example if you want to read a heightmap
  1058. for a terrain renderer.
  1059. \param filename Name of the file from which the image is
  1060. created.
  1061. \return The created image.
  1062. If you no longer need the image, you should call IImage::drop().
  1063. See IReferenceCounted::drop() for more information. */
  1064. virtual IImage* createImageFromFile(const io::path& filename) = 0;
  1065. //! Creates a software image from a file.
  1066. /** No hardware texture will be created for this image. This
  1067. method is useful for example if you want to read a heightmap
  1068. for a terrain renderer.
  1069. \param file File from which the image is created.
  1070. \return The created image.
  1071. If you no longer need the image, you should call IImage::drop().
  1072. See IReferenceCounted::drop() for more information. */
  1073. virtual IImage* createImageFromFile(io::IReadFile* file) =0;
  1074. //! Writes the provided image to a file.
  1075. /** Requires that there is a suitable image writer registered
  1076. for writing the image.
  1077. \param image Image to write.
  1078. \param filename Name of the file to write.
  1079. \param param Control parameter for the backend (e.g. compression
  1080. level).
  1081. \return True on successful write. */
  1082. virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0;
  1083. //! Writes the provided image to a file.
  1084. /** Requires that there is a suitable image writer registered
  1085. for writing the image.
  1086. \param image Image to write.
  1087. \param file An already open io::IWriteFile object. The name
  1088. will be used to determine the appropriate image writer to use.
  1089. \param param Control parameter for the backend (e.g. compression
  1090. level).
  1091. \return True on successful write. */
  1092. virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0;
  1093. //! Creates a software image from a byte array.
  1094. /** No hardware texture will be created for this image. This
  1095. method is useful for example if you want to read a heightmap
  1096. for a terrain renderer.
  1097. \param format Desired color format of the texture
  1098. \param size Desired size of the image
  1099. \param data A byte array with pixel color information
  1100. \param ownForeignMemory If true, the image will use the data
  1101. pointer directly and own it afterwards. If false, the memory
  1102. will by copied internally.
  1103. \param deleteMemory Whether the memory is deallocated upon
  1104. destruction.
  1105. \return The created image.
  1106. If you no longer need the image, you should call IImage::drop().
  1107. See IReferenceCounted::drop() for more information. */
  1108. virtual IImage* createImageFromData(ECOLOR_FORMAT format,
  1109. const core::dimension2d<u32>& size, void *data,
  1110. bool ownForeignMemory=false,
  1111. bool deleteMemory = true) =0;
  1112. //! Creates an empty software image.
  1113. /**
  1114. \param format Desired color format of the image.
  1115. \param size Size of the image to create.
  1116. \return The created image.
  1117. If you no longer need the image, you should call IImage::drop().
  1118. See IReferenceCounted::drop() for more information. */
  1119. virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) =0;
  1120. //! Creates a software image by converting it to given format from another image.
  1121. /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
  1122. \param format Desired color format of the image.
  1123. \param imageToCopy Image to copy to the new image.
  1124. \return The created image.
  1125. If you no longer need the image, you should call IImage::drop().
  1126. See IReferenceCounted::drop() for more information. */
  1127. _IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0;
  1128. //! Creates a software image from a part of another image.
  1129. /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
  1130. \param imageToCopy Image to copy to the new image in part.
  1131. \param pos Position of rectangle to copy.
  1132. \param size Extents of rectangle to copy.
  1133. \return The created image.
  1134. If you no longer need the image, you should call IImage::drop().
  1135. See IReferenceCounted::drop() for more information. */
  1136. _IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy,
  1137. const core::position2d<s32>& pos,
  1138. const core::dimension2d<u32>& size) =0;
  1139. //! Creates a software image from a part of a texture.
  1140. /**
  1141. \param texture Texture to copy to the new image in part.
  1142. \param pos Position of rectangle to copy.
  1143. \param size Extents of rectangle to copy.
  1144. \return The created image.
  1145. If you no longer need the image, you should call IImage::drop().
  1146. See IReferenceCounted::drop() for more information. */
  1147. virtual IImage* createImage(ITexture* texture,
  1148. const core::position2d<s32>& pos,
  1149. const core::dimension2d<u32>& size) =0;
  1150. //! Event handler for resize events. Only used by the engine internally.
  1151. /** Used to notify the driver that the window was resized.
  1152. Usually, there is no need to call this method. */
  1153. virtual void OnResize(const core::dimension2d<u32>& size) =0;
  1154. //! Adds a new material renderer to the video device.
  1155. /** Use this method to extend the VideoDriver with new material
  1156. types. To extend the engine using this method do the following:
  1157. Derive a class from IMaterialRenderer and override the methods
  1158. you need. For setting the right renderstates, you can try to
  1159. get a pointer to the real rendering device using
  1160. IVideoDriver::getExposedVideoData(). Add your class with
  1161. IVideoDriver::addMaterialRenderer(). To use an object being
  1162. displayed with your new material, set the MaterialType member of
  1163. the SMaterial struct to the value returned by this method.
  1164. If you simply want to create a new material using vertex and/or
  1165. pixel shaders it would be easier to use the
  1166. video::IGPUProgrammingServices interface which you can get
  1167. using the getGPUProgrammingServices() method.
  1168. \param renderer A pointer to the new renderer.
  1169. \param name Optional name for the material renderer entry.
  1170. \return The number of the material type which can be set in
  1171. SMaterial::MaterialType to use the renderer. -1 is returned if
  1172. an error occured. For example if you tried to add an material
  1173. renderer to the software renderer or the null device, which do
  1174. not accept material renderers. */
  1175. virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0;
  1176. //! Get access to a material renderer by index.
  1177. /** \param idx Id of the material renderer. Can be a value of
  1178. the E_MATERIAL_TYPE enum or a value which was returned by
  1179. addMaterialRenderer().
  1180. \return Pointer to material renderer or null if not existing. */
  1181. virtual IMaterialRenderer* getMaterialRenderer(u32 idx) =0;
  1182. //! Get amount of currently available material renderers.
  1183. /** \return Amount of currently available material renderers. */
  1184. virtual u32 getMaterialRendererCount() const =0;
  1185. //! Get name of a material renderer
  1186. /** This string can, e.g., be used to test if a specific
  1187. renderer already has been registered/created, or use this
  1188. string to store data about materials: This returned name will
  1189. be also used when serializing materials.
  1190. \param idx Id of the material renderer. Can be a value of the
  1191. E_MATERIAL_TYPE enum or a value which was returned by
  1192. addMaterialRenderer().
  1193. \return String with the name of the renderer, or 0 if not
  1194. exisiting */
  1195. virtual const c8* getMaterialRendererName(u32 idx) const =0;
  1196. //! Sets the name of a material renderer.
  1197. /** Will have no effect on built-in material renderers.
  1198. \param idx: Id of the material renderer. Can be a value of the
  1199. E_MATERIAL_TYPE enum or a value which was returned by
  1200. addMaterialRenderer().
  1201. \param name: New name of the material renderer. */
  1202. virtual void setMaterialRendererName(s32 idx, const c8* name) =0;
  1203. //! Creates material attributes list from a material
  1204. /** This method is useful for serialization and more.
  1205. Please note that the video driver will use the material
  1206. renderer names from getMaterialRendererName() to write out the
  1207. material type name, so they should be set before.
  1208. \param material The material to serialize.
  1209. \param options Additional options which might influence the
  1210. serialization.
  1211. \return The io::IAttributes container holding the material
  1212. properties. */
  1213. virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material,
  1214. io::SAttributeReadWriteOptions* options=0) =0;
  1215. //! Fills an SMaterial structure from attributes.
  1216. /** Please note that for setting material types of the
  1217. material, the video driver will need to query the material
  1218. renderers for their names, so all non built-in materials must
  1219. have been created before calling this method.
  1220. \param outMaterial The material to set the properties for.
  1221. \param attributes The attributes to read from. */
  1222. virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) =0;
  1223. //! Returns driver and operating system specific data about the IVideoDriver.
  1224. /** This method should only be used if the engine should be
  1225. extended without having to modify the source of the engine.
  1226. \return Collection of device dependent pointers. */
  1227. virtual const SExposedVideoData& getExposedVideoData() =0;
  1228. //! Get type of video driver
  1229. /** \return Type of driver. */
  1230. virtual E_DRIVER_TYPE getDriverType() const =0;
  1231. //! Gets the IGPUProgrammingServices interface.
  1232. /** \return Pointer to the IGPUProgrammingServices. Returns 0
  1233. if the video driver does not support this. For example the
  1234. Software driver and the Null driver will always return 0. */
  1235. virtual IGPUProgrammingServices* getGPUProgrammingServices() =0;
  1236. //! Returns a pointer to the mesh manipulator.
  1237. virtual scene::IMeshManipulator* getMeshManipulator() =0;
  1238. //! Clears the ZBuffer.
  1239. /** Note that you usually need not to call this method, as it
  1240. is automatically done in IVideoDriver::beginScene() or
  1241. IVideoDriver::setRenderTarget() if you enable zBuffer. But if
  1242. you have to render some special things, you can clear the
  1243. zbuffer during the rendering process with this method any time.
  1244. */
  1245. virtual void clearZBuffer() =0;
  1246. //! Make a screenshot of the last rendered frame.
  1247. /** \return An image created from the last rendered frame. */
  1248. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) =0;
  1249. //! Check if the image is already loaded.
  1250. /** Works similar to getTexture(), but does not load the texture
  1251. if it is not currently loaded.
  1252. \param filename Name of the texture.
  1253. \return Pointer to loaded texture, or 0 if not found. */
  1254. virtual video::ITexture* findTexture(const io::path& filename) = 0;
  1255. //! Set or unset a clipping plane.
  1256. /** There are at least 6 clipping planes available for the user
  1257. to set at will.
  1258. \param index The plane index. Must be between 0 and
  1259. MaxUserClipPlanes.
  1260. \param plane The plane itself.
  1261. \param enable If true, enable the clipping plane else disable
  1262. it.
  1263. \return True if the clipping plane is usable. */
  1264. virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0;
  1265. //! Enable or disable a clipping plane.
  1266. /** There are at least 6 clipping planes available for the user
  1267. to set at will.
  1268. \param index The plane index. Must be between 0 and
  1269. MaxUserClipPlanes.
  1270. \param enable If true, enable the clipping plane else disable
  1271. it. */
  1272. virtual void enableClipPlane(u32 index, bool enable) =0;
  1273. //! Set the minimum number of vertices for which a hw buffer will be created
  1274. /** \param count Number of vertices to set as minimum. */
  1275. virtual void setMinHardwareBufferVertexCount(u32 count) =0;
  1276. //! Get the global Material, which might override local materials.
  1277. /** Depending on the enable flags, values from this Material
  1278. are used to override those of local materials of some
  1279. meshbuffer being rendered.
  1280. \return Reference to the Override Material. */
  1281. virtual SOverrideMaterial& getOverrideMaterial() =0;
  1282. //! Get the 2d override material for altering its values
  1283. /** The 2d override materual allows to alter certain render
  1284. states of the 2d methods. Not all members of SMaterial are
  1285. honored, especially not MaterialType and Textures. Moreover,
  1286. the zbuffer is always ignored, and lighting is always off. All
  1287. other flags can be changed, though some might have to effect
  1288. in most cases.
  1289. Please note that you have to enable/disable this effect with
  1290. enableInitMaterial2D(). This effect is costly, as it increases
  1291. the number of state changes considerably. Always reset the
  1292. values when done.
  1293. \return Material reference which should be altered to reflect
  1294. the new settings.
  1295. */
  1296. virtual SMaterial& getMaterial2D() =0;
  1297. //! Enable the 2d override material
  1298. /** \param enable Flag which tells whether the material shall be
  1299. enabled or disabled. */
  1300. virtual void enableMaterial2D(bool enable=true) =0;
  1301. //! Get the graphics card vendor name.
  1302. virtual core::stringc getVendorInfo() =0;
  1303. //! Only used by the engine internally.
  1304. /** The ambient color is set in the scene manager, see
  1305. scene::ISceneManager::setAmbientLight().
  1306. \param color New color of the ambient light. */
  1307. virtual void setAmbientLight(const SColorf& color) =0;
  1308. //! Only used by the engine internally.
  1309. /** Passes the global material flag AllowZWriteOnTransparent.
  1310. Use the SceneManager attribute to set this value from your app.
  1311. \param flag Default behavior is to disable ZWrite, i.e. false. */
  1312. virtual void setAllowZWriteOnTransparent(bool flag) =0;
  1313. //! Get the maximum texture size supported.
  1314. virtual core::dimension2du getMaxTextureSize() const =0;
  1315. //! Color conversion convenience function
  1316. /** Convert an image (as array of pixels) from source to destination
  1317. array, thereby converting the color format. The pixel size is
  1318. determined by the color formats.
  1319. \param sP Pointer to source
  1320. \param sF Color format of source
  1321. \param sN Number of pixels to convert, both array must be large enough
  1322. \param dP Pointer to destination
  1323. \param dF Color format of destination
  1324. */
  1325. virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
  1326. void* dP, ECOLOR_FORMAT dF) const =0;
  1327. };
  1328. } // end namespace video
  1329. } // end namespace irr
  1330. #endif