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