]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CNullDriver.h
CNullDriver: store real size for dummy textures
[irrlicht.git] / source / Irrlicht / CNullDriver.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 __C_VIDEO_NULL_H_INCLUDED__\r
6 #define __C_VIDEO_NULL_H_INCLUDED__\r
7 \r
8 #include "IVideoDriver.h"\r
9 #include "IFileSystem.h"\r
10 #include "IImagePresenter.h"\r
11 #include "IGPUProgrammingServices.h"\r
12 #include "irrArray.h"\r
13 #include "irrString.h"\r
14 #include "irrMap.h"\r
15 #include "IAttributes.h"\r
16 #include "IMesh.h"\r
17 #include "IMeshBuffer.h"\r
18 #include "IMeshSceneNode.h"\r
19 #include "CFPSCounter.h"\r
20 #include "S3DVertex.h"\r
21 #include "SVertexIndex.h"\r
22 #include "SLight.h"\r
23 #include "SExposedVideoData.h"\r
24 \r
25 #ifdef _MSC_VER\r
26 #pragma warning( disable: 4996)\r
27 #endif\r
28 \r
29 namespace irr\r
30 {\r
31 namespace io\r
32 {\r
33         class IWriteFile;\r
34         class IReadFile;\r
35 } // end namespace io\r
36 namespace video\r
37 {\r
38         class IImageLoader;\r
39         class IImageWriter;\r
40 \r
41         class CNullDriver : public IVideoDriver, public IGPUProgrammingServices\r
42         {\r
43         public:\r
44 \r
45                 //! constructor\r
46                 CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize);\r
47 \r
48                 //! destructor\r
49                 virtual ~CNullDriver();\r
50 \r
51                 virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,\r
52                         const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;\r
53 \r
54                 virtual bool endScene() _IRR_OVERRIDE_;\r
55 \r
56                 //! Disable a feature of the driver.\r
57                 virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) _IRR_OVERRIDE_;\r
58 \r
59                 //! queries the features of the driver, returns true if feature is available\r
60                 virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_;\r
61 \r
62                 //! Get attributes of the actual video driver\r
63                 virtual const io::IAttributes& getDriverAttributes() const _IRR_OVERRIDE_;\r
64 \r
65                 //! sets transformation\r
66                 virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_;\r
67 \r
68                 //! Retrieve the number of image loaders\r
69                 virtual u32 getImageLoaderCount() const _IRR_OVERRIDE_;\r
70 \r
71                 //! Retrieve the given image loader\r
72                 virtual IImageLoader* getImageLoader(u32 n) _IRR_OVERRIDE_;\r
73 \r
74                 //! Retrieve the number of image writers\r
75                 virtual u32 getImageWriterCount() const _IRR_OVERRIDE_;\r
76 \r
77                 //! Retrieve the given image writer\r
78                 virtual IImageWriter* getImageWriter(u32 n) _IRR_OVERRIDE_;\r
79 \r
80                 //! sets a material\r
81                 virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;\r
82 \r
83                 //! loads a Texture\r
84                 virtual ITexture* getTexture(const io::path& filename) _IRR_OVERRIDE_;\r
85 \r
86                 //! loads a Texture\r
87                 virtual ITexture* getTexture(io::IReadFile* file) _IRR_OVERRIDE_;\r
88 \r
89                 //! Returns a texture by index\r
90                 virtual ITexture* getTextureByIndex(u32 index) _IRR_OVERRIDE_;\r
91 \r
92                 //! Returns amount of textures currently loaded\r
93                 virtual u32 getTextureCount() const _IRR_OVERRIDE_;\r
94 \r
95                 //! Renames a texture\r
96                 virtual void renameTexture(ITexture* texture, const io::path& newName) _IRR_OVERRIDE_;\r
97 \r
98                 virtual ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;\r
99 \r
100                 virtual ITexture* addTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_;\r
101 \r
102                 virtual ITexture* addTextureCubemap(const io::path& name, IImage* imagePosX, IImage* imageNegX, IImage* imagePosY,\r
103                         IImage* imageNegY, IImage* imagePosZ, IImage* imageNegZ) _IRR_OVERRIDE_;\r
104 \r
105                 virtual ITexture* addTextureCubemap(const irr::u32 sideLen, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;\r
106 \r
107                 virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),\r
108                         f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;\r
109 \r
110                 virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),\r
111                         f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;\r
112 \r
113                 //! sets a viewport\r
114                 virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;\r
115 \r
116                 //! gets the area of the current viewport\r
117                 virtual const core::rect<s32>& getViewPort() const _IRR_OVERRIDE_;\r
118 \r
119                 //! draws a vertex primitive list\r
120                 virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
121                                 const void* indexList, u32 primitiveCount,\r
122                                 E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,\r
123                                 E_INDEX_TYPE iType=EIT_16BIT) _IRR_OVERRIDE_;\r
124 \r
125                 //! draws a vertex primitive list in 2d\r
126                 virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
127                                 const void* indexList, u32 primitiveCount,\r
128                                 E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,\r
129                                 E_INDEX_TYPE iType=EIT_16BIT) _IRR_OVERRIDE_;\r
130 \r
131                 //! Draws a 3d line.\r
132                 virtual void draw3DLine(const core::vector3df& start,\r
133                         const core::vector3df& end, SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
134 \r
135                 //! Draws a 3d triangle.\r
136                 virtual void draw3DTriangle(const core::triangle3df& triangle,\r
137                         SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
138 \r
139                 //! Draws a 3d axis aligned box.\r
140                 virtual void draw3DBox(const core::aabbox3d<f32>& box,\r
141                         SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
142 \r
143                 //! draws an 2d image\r
144                 virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture) _IRR_OVERRIDE_;\r
145 \r
146                 //! draws a set of 2d images, using a color and the alpha\r
147                 /** channel of the texture if desired. The images are drawn\r
148                 beginning at pos and concatenated in one line. All drawings\r
149                 are clipped against clipRect (if != 0).\r
150                 The subtextures are defined by the array of sourceRects\r
151                 and are chosen by the indices given.\r
152                 \param texture: Texture to be drawn.\r
153                 \param pos: Upper left 2d destination position where the image will be drawn.\r
154                 \param sourceRects: Source rectangles of the image.\r
155                 \param indices: List of indices which choose the actual rectangle used each time.\r
156                 \param kerningWidth: offset on position\r
157                 \param clipRect: Pointer to rectangle on the screen where the image is clipped to.\r
158                 This pointer can be 0. Then the image is not clipped.\r
159                 \param color: Color with which the image is colored.\r
160                 Note that the alpha component is used: If alpha is other than 255, the image will be transparent.\r
161                 \param useAlphaChannelOfTexture: If true, the alpha channel of the texture is\r
162                 used to draw the image. */\r
163                 virtual void draw2DImageBatch(const video::ITexture* texture,\r
164                                 const core::position2d<s32>& pos,\r
165                                 const core::array<core::rect<s32> >& sourceRects,\r
166                                 const core::array<s32>& indices,\r
167                                 s32 kerningWidth = 0,\r
168                                 const core::rect<s32>* clipRect = 0,\r
169                                 SColor color=SColor(255,255,255,255),\r
170                                 bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
171 \r
172                 //! Draws a set of 2d images, using a color and the alpha channel of the texture.\r
173                 /** All drawings are clipped against clipRect (if != 0).\r
174                 The subtextures are defined by the array of sourceRects and are\r
175                 positioned using the array of positions.\r
176                 \param texture Texture to be drawn.\r
177                 \param pos Array of upper left 2d destinations where the images\r
178                 will be drawn.\r
179                 \param sourceRects Source rectangles of the image.\r
180                 \param clipRect Pointer to rectangle on the screen where the\r
181                 images are clipped to.\r
182                 If this pointer is 0 then the image is not clipped.\r
183                 \param color Color with which the image is drawn.\r
184                 Note that the alpha component is used. If alpha is other than\r
185                 255, the image will be transparent.\r
186                 \param useAlphaChannelOfTexture: If true, the alpha channel of\r
187                 the texture is used to draw the image. */\r
188                 virtual void draw2DImageBatch(const video::ITexture* texture,\r
189                                 const core::array<core::position2d<s32> >& positions,\r
190                                 const core::array<core::rect<s32> >& sourceRects,\r
191                                 const core::rect<s32>* clipRect=0,\r
192                                 SColor color=SColor(255,255,255,255),\r
193                                 bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
194 \r
195                 //! Draws a 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.\r
196                 virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,\r
197                         const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,\r
198                         SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
199 \r
200                 //! Draws a part of the texture into the rectangle.\r
201                 virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,\r
202                         const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,\r
203                         const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
204 \r
205                 //! Draws a 2d rectangle\r
206                 virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip = 0) _IRR_OVERRIDE_;\r
207 \r
208                 //! Draws a 2d rectangle with a gradient.\r
209                 virtual void draw2DRectangle(const core::rect<s32>& pos,\r
210                         SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown,\r
211                         const core::rect<s32>* clip = 0) _IRR_OVERRIDE_;\r
212 \r
213                 //! Draws the outline of a 2d rectangle\r
214                 virtual void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
215 \r
216                 //! Draws a 2d line.\r
217                 virtual void draw2DLine(const core::position2d<s32>& start,\r
218                                         const core::position2d<s32>& end,\r
219                                         SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
220 \r
221                 //! Draws a pixel\r
222                 virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_;\r
223 \r
224                 //! Draws a non filled concyclic reqular 2d polygon.\r
225                 virtual void draw2DPolygon(core::position2d<s32> center,\r
226                         f32 radius, video::SColor Color, s32 vertexCount) _IRR_OVERRIDE_;\r
227 \r
228                 virtual void setFog(SColor color=SColor(0,255,255,255),\r
229                                 E_FOG_TYPE fogType=EFT_FOG_LINEAR,\r
230                                 f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,\r
231                                 bool pixelFog=false, bool rangeFog=false) _IRR_OVERRIDE_;\r
232 \r
233                 virtual void getFog(SColor& color, E_FOG_TYPE& fogType,\r
234                                 f32& start, f32& end, f32& density,\r
235                                 bool& pixelFog, bool& rangeFog) _IRR_OVERRIDE_;\r
236 \r
237                 //! get color format of the current color buffer\r
238                 virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;\r
239 \r
240                 //! get screen size\r
241                 virtual const core::dimension2d<u32>& getScreenSize() const _IRR_OVERRIDE_;\r
242 \r
243                 //! get current render target\r
244                 IRenderTarget* getCurrentRenderTarget() const;\r
245 \r
246                 //! get render target size\r
247                 virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;\r
248 \r
249                 // get current frames per second value\r
250                 virtual s32 getFPS() const _IRR_OVERRIDE_;\r
251 \r
252                 //! returns amount of primitives (mostly triangles) were drawn in the last frame.\r
253                 //! very useful method for statistics.\r
254                 virtual u32 getPrimitiveCountDrawn( u32 param = 0 ) const _IRR_OVERRIDE_;\r
255 \r
256                 //! deletes all dynamic lights there are\r
257                 virtual void deleteAllDynamicLights() _IRR_OVERRIDE_;\r
258 \r
259                 //! adds a dynamic light, returning an index to the light\r
260                 //! \param light: the light data to use to create the light\r
261                 //! \return An index to the light, or -1 if an error occurs\r
262                 virtual s32 addDynamicLight(const SLight& light) _IRR_OVERRIDE_;\r
263 \r
264                 //! Turns a dynamic light on or off\r
265                 //! \param lightIndex: the index returned by addDynamicLight\r
266                 //! \param turnOn: true to turn the light on, false to turn it off\r
267                 virtual void turnLightOn(s32 lightIndex, bool turnOn) _IRR_OVERRIDE_;\r
268 \r
269                 //! returns the maximal amount of dynamic lights the device can handle\r
270                 virtual u32 getMaximalDynamicLightAmount() const _IRR_OVERRIDE_;\r
271 \r
272                 //! \return Returns the name of the video driver. Example: In case of the DIRECT3D8\r
273                 //! driver, it would return "Direct3D8.1".\r
274                 virtual const wchar_t* getName() const _IRR_OVERRIDE_;\r
275 \r
276                 //! Sets the dynamic ambient light color. The default color is\r
277                 //! (0,0,0,0) which means it is dark.\r
278                 //! \param color: New color of the ambient light.\r
279                 virtual void setAmbientLight(const SColorf& color) _IRR_OVERRIDE_;\r
280 \r
281                 //! Get the global ambient light currently used by the driver\r
282                 virtual const SColorf& getAmbientLight() const _IRR_OVERRIDE_;\r
283 \r
284                 //! Adds an external image loader to the engine.\r
285                 virtual void addExternalImageLoader(IImageLoader* loader) _IRR_OVERRIDE_;\r
286 \r
287                 //! Adds an external image writer to the engine.\r
288                 virtual void addExternalImageWriter(IImageWriter* writer) _IRR_OVERRIDE_;\r
289 \r
290                 //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do\r
291                 //! this: First, draw all geometry. Then use this method, to draw the shadow\r
292                 //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.\r
293                 virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles,\r
294                         bool zfail=true, u32 debugDataVisible=0) _IRR_OVERRIDE_;\r
295 \r
296                 //! Fills the stencil shadow with color. After the shadow volume has been drawn\r
297                 //! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this\r
298                 //! to draw the color of the shadow.\r
299                 virtual void drawStencilShadow(bool clearStencilBuffer=false,\r
300                         video::SColor leftUpEdge = video::SColor(0,0,0,0),\r
301                         video::SColor rightUpEdge = video::SColor(0,0,0,0),\r
302                         video::SColor leftDownEdge = video::SColor(0,0,0,0),\r
303                         video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_;\r
304 \r
305                 //! Returns current amount of dynamic lights set\r
306                 //! \return Current amount of dynamic lights set\r
307                 virtual u32 getDynamicLightCount() const _IRR_OVERRIDE_;\r
308 \r
309                 //! Returns light data which was previously set with IVideDriver::addDynamicLight().\r
310                 //! \param idx: Zero based index of the light. Must be greater than 0 and smaller\r
311                 //! than IVideoDriver()::getDynamicLightCount.\r
312                 //! \return Light data.\r
313                 virtual const SLight& getDynamicLight(u32 idx) const _IRR_OVERRIDE_;\r
314 \r
315                 //! Removes a texture from the texture cache and deletes it, freeing lot of\r
316                 //! memory.\r
317                 virtual void removeTexture(ITexture* texture) _IRR_OVERRIDE_;\r
318 \r
319                 //! Removes all texture from the texture cache and deletes them, freeing lot of\r
320                 //! memory.\r
321                 virtual void removeAllTextures() _IRR_OVERRIDE_;\r
322 \r
323                 //! Creates a render target texture.\r
324                 virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,\r
325                         const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;\r
326 \r
327                 //! Creates a render target texture for a cubemap\r
328                 ITexture* addRenderTargetTextureCubemap(const irr::u32 sideLen,\r
329                                 const io::path& name, const ECOLOR_FORMAT format) _IRR_OVERRIDE_;\r
330 \r
331                 //! Creates an 1bit alpha channel of the texture based of an color key.\r
332                 virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color, bool zeroTexels) const _IRR_OVERRIDE_;\r
333 \r
334                 //! Creates an 1bit alpha channel of the texture based of an color key position.\r
335                 virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d<s32> colorKeyPixelPos,\r
336                         bool zeroTexels) const _IRR_OVERRIDE_;\r
337 \r
338                 //! Creates a normal map from a height map texture.\r
339                 //! \param amplitude: Constant value by which the height information is multiplied.\r
340                 virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const _IRR_OVERRIDE_;\r
341 \r
342                 //! Returns the maximum amount of primitives (mostly vertices) which\r
343                 //! the device is able to render with one drawIndexedTriangleList\r
344                 //! call.\r
345                 virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_;\r
346 \r
347                 //! Enables or disables a texture creation flag.\r
348                 virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) _IRR_OVERRIDE_;\r
349 \r
350                 //! Returns if a texture creation flag is enabled or disabled.\r
351                 virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const _IRR_OVERRIDE_;\r
352 \r
353                 virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;\r
354 \r
355                 virtual core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;\r
356 \r
357                 //! Creates a software image from a byte array.\r
358                 /** \param useForeignMemory: If true, the image will use the data pointer\r
359                 directly and own it from now on, which means it will also try to delete [] the\r
360                 data when the image will be destructed. If false, the memory will by copied. */\r
361                 virtual IImage* createImageFromData(ECOLOR_FORMAT format,\r
362                         const core::dimension2d<u32>& size, void *data, bool ownForeignMemory = false,\r
363                         bool deleteMemory = true) _IRR_OVERRIDE_;\r
364 \r
365                 //! Creates an empty software image.\r
366                 virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
367 \r
368                 //! Creates a software image from another image.\r
369                 virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) _IRR_OVERRIDE_;\r
370 \r
371                 //! Creates a software image from part of another image.\r
372                 virtual IImage* createImage(IImage* imageToCopy,\r
373                                 const core::position2d<s32>& pos,\r
374                                 const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
375 \r
376                 //! Creates a software image from part of a texture.\r
377                 virtual IImage* createImage(ITexture* texture,\r
378                                 const core::position2d<s32>& pos,\r
379                                 const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
380 \r
381                 //! Draws a mesh buffer\r
382                 virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) _IRR_OVERRIDE_;\r
383 \r
384                 //! Draws the normals of a mesh buffer\r
385                 virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f,\r
386                         SColor color=0xffffffff) _IRR_OVERRIDE_;\r
387 \r
388                 //! Check if the driver supports creating textures with the given color format\r
389                 virtual bool queryTextureFormat(ECOLOR_FORMAT format) const _IRR_OVERRIDE_\r
390                 {\r
391                         return false;\r
392                 }\r
393 \r
394         protected:\r
395                 struct SHWBufferLink\r
396                 {\r
397                         SHWBufferLink(const scene::IMeshBuffer *_MeshBuffer)\r
398                                 :MeshBuffer(_MeshBuffer),\r
399                                 ChangedID_Vertex(0),ChangedID_Index(0),LastUsed(0),\r
400                                 Mapped_Vertex(scene::EHM_NEVER),Mapped_Index(scene::EHM_NEVER)\r
401                         {\r
402                                 if (MeshBuffer)\r
403                                         MeshBuffer->grab();\r
404                         }\r
405 \r
406                         virtual ~SHWBufferLink()\r
407                         {\r
408                                 if (MeshBuffer)\r
409                                         MeshBuffer->drop();\r
410                         }\r
411 \r
412                         const scene::IMeshBuffer *MeshBuffer;\r
413                         u32 ChangedID_Vertex;\r
414                         u32 ChangedID_Index;\r
415                         u32 LastUsed;\r
416                         scene::E_HARDWARE_MAPPING Mapped_Vertex;\r
417                         scene::E_HARDWARE_MAPPING Mapped_Index;\r
418                 };\r
419 \r
420                 //! Gets hardware buffer link from a meshbuffer (may create or update buffer)\r
421                 virtual SHWBufferLink *getBufferLink(const scene::IMeshBuffer* mb);\r
422 \r
423                 //! updates hardware buffer if needed  (only some drivers can)\r
424                 virtual bool updateHardwareBuffer(SHWBufferLink *HWBuffer) {return false;}\r
425 \r
426                 //! Draw hardware buffer (only some drivers can)\r
427                 virtual void drawHardwareBuffer(SHWBufferLink *HWBuffer) {}\r
428 \r
429                 //! Delete hardware buffer\r
430                 virtual void deleteHardwareBuffer(SHWBufferLink *HWBuffer);\r
431 \r
432                 //! Create hardware buffer from mesh (only some drivers can)\r
433                 virtual SHWBufferLink *createHardwareBuffer(const scene::IMeshBuffer* mb) {return 0;}\r
434 \r
435         public:\r
436                 //! Remove hardware buffer\r
437                 virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) _IRR_OVERRIDE_;\r
438 \r
439                 //! Remove all hardware buffers\r
440                 virtual void removeAllHardwareBuffers() _IRR_OVERRIDE_;\r
441 \r
442                 //! Update all hardware buffers, remove unused ones\r
443                 virtual void updateAllHardwareBuffers();\r
444 \r
445                 //! is vbo recommended on this mesh?\r
446                 virtual bool isHardwareBufferRecommend(const scene::IMeshBuffer* mb);\r
447 \r
448                 //! Create occlusion query.\r
449                 /** Use node for identification and mesh for occlusion test. */\r
450                 virtual void addOcclusionQuery(scene::ISceneNode* node,\r
451                                 const scene::IMesh* mesh=0) _IRR_OVERRIDE_;\r
452 \r
453                 //! Remove occlusion query.\r
454                 virtual void removeOcclusionQuery(scene::ISceneNode* node) _IRR_OVERRIDE_;\r
455 \r
456                 //! Remove all occlusion queries.\r
457                 virtual void removeAllOcclusionQueries() _IRR_OVERRIDE_;\r
458 \r
459                 //! Run occlusion query. Draws mesh stored in query.\r
460                 /** If the mesh shall not be rendered visible, use\r
461                 overrideMaterial to disable the color and depth buffer. */\r
462                 virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) _IRR_OVERRIDE_;\r
463 \r
464                 //! Run all occlusion queries. Draws all meshes stored in queries.\r
465                 /** If the meshes shall not be rendered visible, use\r
466                 overrideMaterial to disable the color and depth buffer. */\r
467                 virtual void runAllOcclusionQueries(bool visible=false) _IRR_OVERRIDE_;\r
468 \r
469                 //! Update occlusion query. Retrieves results from GPU.\r
470                 /** If the query shall not block, set the flag to false.\r
471                 Update might not occur in this case, though */\r
472                 virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) _IRR_OVERRIDE_;\r
473 \r
474                 //! Update all occlusion queries. Retrieves results from GPU.\r
475                 /** If the query shall not block, set the flag to false.\r
476                 Update might not occur in this case, though */\r
477                 virtual void updateAllOcclusionQueries(bool block=true) _IRR_OVERRIDE_;\r
478 \r
479                 //! Return query result.\r
480                 /** Return value is the number of visible pixels/fragments.\r
481                 The value is a safe approximation, i.e. can be larger than the\r
482                 actual value of pixels. */\r
483                 virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_;\r
484 \r
485                 //! Create render target.\r
486                 virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;\r
487 \r
488                 //! Remove render target.\r
489                 virtual void removeRenderTarget(IRenderTarget* renderTarget) _IRR_OVERRIDE_;\r
490 \r
491                 //! Remove all render targets.\r
492                 virtual void removeAllRenderTargets() _IRR_OVERRIDE_;\r
493 \r
494                 //! Only used by the engine internally.\r
495                 /** Used to notify the driver that the window was resized. */\r
496                 virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
497 \r
498                 //! Adds a new material renderer to the video device.\r
499                 virtual s32 addMaterialRenderer(IMaterialRenderer* renderer,\r
500                                 const char* name = 0) _IRR_OVERRIDE_;\r
501 \r
502                 //! Returns driver and operating system specific data about the IVideoDriver.\r
503                 virtual const SExposedVideoData& getExposedVideoData() _IRR_OVERRIDE_;\r
504 \r
505                 //! Returns type of video driver\r
506                 virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_;\r
507 \r
508                 //! Returns the transformation set by setTransform\r
509                 virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_;\r
510 \r
511                 //! Returns pointer to the IGPUProgrammingServices interface.\r
512                 virtual IGPUProgrammingServices* getGPUProgrammingServices() _IRR_OVERRIDE_;\r
513 \r
514                 //! Adds a new material renderer to the VideoDriver, using pixel and/or\r
515                 //! vertex shaders to render geometry.\r
516                 virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,\r
517                         const c8* pixelShaderProgram = 0,\r
518                         IShaderConstantSetCallBack* callback = 0,\r
519                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
520                         s32 userData=0) _IRR_OVERRIDE_;\r
521 \r
522                 //! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the\r
523                 //! programs from files.\r
524                 virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram = 0,\r
525                         io::IReadFile* pixelShaderProgram = 0,\r
526                         IShaderConstantSetCallBack* callback = 0,\r
527                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
528                         s32 userData=0) _IRR_OVERRIDE_;\r
529 \r
530                 //! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the\r
531                 //! programs from files.\r
532                 virtual s32 addShaderMaterialFromFiles(const io::path& vertexShaderProgramFileName,\r
533                         const io::path& pixelShaderProgramFileName,\r
534                         IShaderConstantSetCallBack* callback = 0,\r
535                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
536                         s32 userData=0) _IRR_OVERRIDE_;\r
537 \r
538                 //! Returns pointer to material renderer or null\r
539                 virtual IMaterialRenderer* getMaterialRenderer(u32 idx) const _IRR_OVERRIDE_;\r
540 \r
541                 //! Returns amount of currently available material renderers.\r
542                 virtual u32 getMaterialRendererCount() const _IRR_OVERRIDE_;\r
543 \r
544                 //! Returns name of the material renderer\r
545                 virtual const char* getMaterialRendererName(u32 idx) const _IRR_OVERRIDE_;\r
546 \r
547                 //! Adds a new material renderer to the VideoDriver, based on a high level shading\r
548                 //! language. Currently only HLSL in D3D9 is supported.\r
549                 virtual s32 addHighLevelShaderMaterial(\r
550                         const c8* vertexShaderProgram,\r
551                         const c8* vertexShaderEntryPointName = 0,\r
552                         E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,\r
553                         const c8* pixelShaderProgram = 0,\r
554                         const c8* pixelShaderEntryPointName = 0,\r
555                         E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,\r
556                         const c8* geometryShaderProgram = 0,\r
557                         const c8* geometryShaderEntryPointName = "main",\r
558                         E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,\r
559                         scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,\r
560                         scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,\r
561                         u32 verticesOut = 0,\r
562                         IShaderConstantSetCallBack* callback = 0,\r
563                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
564                         s32 userData = 0) _IRR_OVERRIDE_;\r
565 \r
566                 //! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),\r
567                 //! but tries to load the programs from files.\r
568                 virtual s32 addHighLevelShaderMaterialFromFiles(\r
569                         const io::path& vertexShaderProgramFile,\r
570                         const c8* vertexShaderEntryPointName = "main",\r
571                         E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,\r
572                         const io::path& pixelShaderProgramFile = "",\r
573                         const c8* pixelShaderEntryPointName = "main",\r
574                         E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,\r
575                         const io::path& geometryShaderProgramFileName="",\r
576                         const c8* geometryShaderEntryPointName = "main",\r
577                         E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,\r
578                         scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,\r
579                         scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,\r
580                         u32 verticesOut = 0,\r
581                         IShaderConstantSetCallBack* callback = 0,\r
582                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
583                         s32 userData = 0) _IRR_OVERRIDE_;\r
584 \r
585                 //! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),\r
586                 //! but tries to load the programs from files.\r
587                 virtual s32 addHighLevelShaderMaterialFromFiles(\r
588                         io::IReadFile* vertexShaderProgram,\r
589                         const c8* vertexShaderEntryPointName = "main",\r
590                         E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,\r
591                         io::IReadFile* pixelShaderProgram = 0,\r
592                         const c8* pixelShaderEntryPointName = "main",\r
593                         E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,\r
594                         io::IReadFile* geometryShaderProgram= 0,\r
595                         const c8* geometryShaderEntryPointName = "main",\r
596                         E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,\r
597                         scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,\r
598                         scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,\r
599                         u32 verticesOut = 0,\r
600                         IShaderConstantSetCallBack* callback = 0,\r
601                         E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
602                         s32 userData = 0) _IRR_OVERRIDE_;\r
603 \r
604                 //! Returns a pointer to the mesh manipulator.\r
605                 virtual scene::IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_;\r
606 \r
607                 virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;\r
608 \r
609                 //! Returns an image created from the last rendered frame.\r
610                 virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;\r
611 \r
612                 //! Writes the provided image to disk file\r
613                 virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) _IRR_OVERRIDE_;\r
614 \r
615                 //! Writes the provided image to a file.\r
616                 virtual bool writeImageToFile(IImage* image, io::IWriteFile * file, u32 param = 0) _IRR_OVERRIDE_;\r
617 \r
618                 //! Sets the name of a material renderer.\r
619                 virtual void setMaterialRendererName(s32 idx, const char* name) _IRR_OVERRIDE_;\r
620 \r
621                 //! Swap the material renderers used for certain id's\r
622                 virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames) _IRR_OVERRIDE_;\r
623 \r
624                 //! Creates material attributes list from a material, usable for serialization and more.\r
625                 virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material,\r
626                         io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_;\r
627 \r
628                 //! Fills an SMaterial structure from attributes.\r
629                 virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) _IRR_OVERRIDE_;\r
630 \r
631                 //! looks if the image is already loaded\r
632                 virtual video::ITexture* findTexture(const io::path& filename) _IRR_OVERRIDE_;\r
633 \r
634                 //! Set/unset a clipping plane.\r
635                 //! There are at least 6 clipping planes available for the user to set at will.\r
636                 //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.\r
637                 //! \param plane: The plane itself.\r
638                 //! \param enable: If true, enable the clipping plane else disable it.\r
639                 virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) _IRR_OVERRIDE_;\r
640 \r
641                 //! Enable/disable a clipping plane.\r
642                 //! There are at least 6 clipping planes available for the user to set at will.\r
643                 //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.\r
644                 //! \param enable: If true, enable the clipping plane else disable it.\r
645                 virtual void enableClipPlane(u32 index, bool enable) _IRR_OVERRIDE_;\r
646 \r
647                 //! Returns the graphics card vendor name.\r
648                 virtual core::stringc getVendorInfo() _IRR_OVERRIDE_ {return "Not available on this driver.";}\r
649 \r
650                 //! Set the minimum number of vertices for which a hw buffer will be created\r
651                 /** \param count Number of vertices to set as minimum. */\r
652                 virtual void setMinHardwareBufferVertexCount(u32 count) _IRR_OVERRIDE_;\r
653 \r
654                 //! Get the global Material, which might override local materials.\r
655                 /** Depending on the enable flags, values from this Material\r
656                 are used to override those of local materials of some\r
657                 meshbuffer being rendered. */\r
658                 virtual SOverrideMaterial& getOverrideMaterial() _IRR_OVERRIDE_;\r
659 \r
660                 //! Get the 2d override material for altering its values\r
661                 virtual SMaterial& getMaterial2D() _IRR_OVERRIDE_;\r
662 \r
663                 //! Enable the 2d override material\r
664                 virtual void enableMaterial2D(bool enable=true) _IRR_OVERRIDE_;\r
665 \r
666                 //! Only used by the engine internally.\r
667                 virtual void setAllowZWriteOnTransparent(bool flag) _IRR_OVERRIDE_\r
668                 { AllowZWriteOnTransparent=flag; }\r
669 \r
670                 //! Returns the maximum texture size supported.\r
671                 virtual core::dimension2du getMaxTextureSize() const _IRR_OVERRIDE_;\r
672 \r
673                 //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass\r
674                 virtual bool needsTransparentRenderPass(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;\r
675 \r
676                 //! Color conversion convenience function\r
677                 /** Convert an image (as array of pixels) from source to destination\r
678                 array, thereby converting the color format. The pixel size is\r
679                 determined by the color formats.\r
680                 \param sP Pointer to source\r
681                 \param sF Color format of source\r
682                 \param sN Number of pixels to convert, both array must be large enough\r
683                 \param dP Pointer to destination\r
684                 \param dF Color format of destination\r
685                 */\r
686                 virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,\r
687                                 void* dP, ECOLOR_FORMAT dF) const _IRR_OVERRIDE_;\r
688 \r
689                 //! deprecated method\r
690                 virtual ITexture* createRenderTargetTexture(const core::dimension2d<u32>& size,\r
691                                 const c8* name=0);\r
692 \r
693                 virtual bool checkDriverReset() _IRR_OVERRIDE_ {return false;}\r
694         protected:\r
695 \r
696                 //! deletes all textures\r
697                 void deleteAllTextures();\r
698 \r
699                 //! opens the file and loads it into the surface\r
700                 ITexture* loadTextureFromFile(io::IReadFile* file, const io::path& hashName = "");\r
701 \r
702                 //! adds a surface, not loaded or created by the Irrlicht Engine\r
703                 void addTexture(ITexture* surface);\r
704                 \r
705                 virtual ITexture* createDeviceDependentTexture(const io::path& name, IImage* image);\r
706 \r
707                 virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image);\r
708 \r
709                 //! checks triangle count and print warning if wrong\r
710                 bool checkPrimitiveCount(u32 prmcnt) const;\r
711 \r
712                 bool checkImage(const core::array<IImage*>& image) const;\r
713 \r
714                 // adds a material renderer and drops it afterwards. To be used for internal creation\r
715                 s32 addAndDropMaterialRenderer(IMaterialRenderer* m);\r
716 \r
717                 //! deletes all material renderers\r
718                 void deleteMaterialRenders();\r
719 \r
720                 // prints renderer version\r
721                 void printVersion();\r
722 \r
723                 //! normal map lookup 32 bit version\r
724                 inline f32 nml32(int x, int y, int pitch, int height, s32 *p) const\r
725                 {\r
726                         if (x < 0)\r
727                                 x = pitch-1;\r
728                         if (x >= pitch)\r
729                                 x = 0;\r
730                         if (y < 0)\r
731                                 y = height-1;\r
732                         if (y >= height)\r
733                                 y = 0;\r
734                         return (f32)(((p[(y * pitch) + x])>>16) & 0xff);\r
735                 }\r
736 \r
737                 //! normal map lookup 16 bit version\r
738                 inline f32 nml16(int x, int y, int pitch, int height, s16 *p) const\r
739                 {\r
740                         if (x < 0)\r
741                                 x = pitch-1;\r
742                         if (x >= pitch)\r
743                                 x = 0;\r
744                         if (y < 0)\r
745                                 y = height-1;\r
746                         if (y >= height)\r
747                                 y = 0;\r
748 \r
749                         return (f32) getAverage ( p[(y * pitch) + x] );\r
750                 }\r
751 \r
752                 inline bool getWriteZBuffer(const SMaterial& material) const\r
753                 {\r
754                         switch ( material.ZWriteEnable )\r
755                         {\r
756                                 case video::EZW_OFF:\r
757                                         return false;\r
758                                 case video::EZW_AUTO:\r
759                                         return AllowZWriteOnTransparent || ! needsTransparentRenderPass(material);\r
760                                 case video::EZW_ON:\r
761                                         return true;\r
762                         }\r
763                         return true; // never should get here, but some compilers don't know and complain\r
764                 }\r
765 \r
766                 struct SSurface\r
767                 {\r
768                         video::ITexture* Surface;\r
769 \r
770                         bool operator < (const SSurface& other) const\r
771                         {\r
772                                 return Surface->getName() < other.Surface->getName();\r
773                         }\r
774                 };\r
775 \r
776                 struct SMaterialRenderer\r
777                 {\r
778                         core::stringc Name;\r
779                         IMaterialRenderer* Renderer;\r
780                 };\r
781 \r
782                 struct SDummyTexture : public ITexture\r
783                 {\r
784                         SDummyTexture(const io::path& name, E_TEXTURE_TYPE type) : ITexture(name, type) {};\r
785 \r
786                         void setSize(const core::dimension2d<u32>& size) { Size = OriginalSize = size; }\r
787 \r
788                         virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) _IRR_OVERRIDE_ { return 0; }\r
789                         virtual void unlock()_IRR_OVERRIDE_ {}\r
790                         virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ {}\r
791                 };\r
792                 core::array<SSurface> Textures;\r
793 \r
794                 struct SOccQuery\r
795                 {\r
796                         SOccQuery(scene::ISceneNode* node, const scene::IMesh* mesh=0) : Node(node), Mesh(mesh), PID(0), Result(0xffffffff), Run(0xffffffff)\r
797                         {\r
798                                 if (Node)\r
799                                         Node->grab();\r
800                                 if (Mesh)\r
801                                         Mesh->grab();\r
802                         }\r
803 \r
804                         SOccQuery(const SOccQuery& other) : Node(other.Node), Mesh(other.Mesh), PID(other.PID), Result(other.Result), Run(other.Run)\r
805                         {\r
806                                 if (Node)\r
807                                         Node->grab();\r
808                                 if (Mesh)\r
809                                         Mesh->grab();\r
810                         }\r
811 \r
812                         ~SOccQuery()\r
813                         {\r
814                                 if (Node)\r
815                                         Node->drop();\r
816                                 if (Mesh)\r
817                                         Mesh->drop();\r
818                         }\r
819 \r
820                         SOccQuery& operator=(const SOccQuery& other)\r
821                         {\r
822                                 Node=other.Node;\r
823                                 Mesh=other.Mesh;\r
824                                 PID=other.PID;\r
825                                 Result=other.Result;\r
826                                 Run=other.Run;\r
827                                 if (Node)\r
828                                         Node->grab();\r
829                                 if (Mesh)\r
830                                         Mesh->grab();\r
831                                 return *this;\r
832                         }\r
833 \r
834                         bool operator==(const SOccQuery& other) const\r
835                         {\r
836                                 return other.Node==Node;\r
837                         }\r
838 \r
839                         scene::ISceneNode* Node;\r
840                         const scene::IMesh* Mesh;\r
841                         union\r
842                         {\r
843                                 void* PID;\r
844                                 unsigned int UID;\r
845                         };\r
846                         u32 Result;\r
847                         u32 Run;\r
848                 };\r
849                 core::array<SOccQuery> OcclusionQueries;\r
850 \r
851                 core::array<IRenderTarget*> RenderTargets;\r
852 \r
853                 // Shared objects used with simplified IVideoDriver::setRenderTarget method with ITexture* param.\r
854                 IRenderTarget* SharedRenderTarget;\r
855                 core::array<ITexture*> SharedDepthTextures;\r
856 \r
857                 IRenderTarget* CurrentRenderTarget;\r
858                 core::dimension2d<u32> CurrentRenderTargetSize;\r
859 \r
860                 core::array<video::IImageLoader*> SurfaceLoader;\r
861                 core::array<video::IImageWriter*> SurfaceWriter;\r
862                 core::array<SLight> Lights;\r
863                 core::array<SMaterialRenderer> MaterialRenderers;\r
864 \r
865                 //core::array<SHWBufferLink*> HWBufferLinks;\r
866                 core::map< const scene::IMeshBuffer* , SHWBufferLink* > HWBufferMap;\r
867 \r
868                 io::IFileSystem* FileSystem;\r
869 \r
870                 //! mesh manipulator\r
871                 scene::IMeshManipulator* MeshManipulator;\r
872 \r
873                 core::rect<s32> ViewPort;\r
874                 core::dimension2d<u32> ScreenSize;\r
875                 core::matrix4 TransformationMatrix;\r
876 \r
877                 CFPSCounter FPSCounter;\r
878 \r
879                 u32 PrimitivesDrawn;\r
880                 u32 MinVertexCountForVBO;\r
881 \r
882                 u32 TextureCreationFlags;\r
883 \r
884                 f32 FogStart;\r
885                 f32 FogEnd;\r
886                 f32 FogDensity;\r
887                 SColor FogColor;\r
888                 SExposedVideoData ExposedData;\r
889 \r
890                 io::IAttributes* DriverAttributes;\r
891 \r
892                 SOverrideMaterial OverrideMaterial;\r
893                 SMaterial OverrideMaterial2D;\r
894                 SMaterial InitMaterial2D;\r
895                 bool OverrideMaterial2DEnabled;\r
896 \r
897                 E_FOG_TYPE FogType;\r
898                 bool PixelFog;\r
899                 bool RangeFog;\r
900                 bool AllowZWriteOnTransparent;\r
901 \r
902                 bool FeatureEnabled[video::EVDF_COUNT];\r
903 \r
904                 SColorf AmbientLight;\r
905         };\r
906 \r
907 } // end namespace video\r
908 } // end namespace irr\r
909 \r
910 \r
911 #endif\r