![]() |
Skylicht Engine
|
Interface to driver which is able to perform 2d and 3d graphics functions. More...
#include <C:/Projects/skylicht-engine/Projects/Irrlicht/Include/IVideoDriver.h>
Public Member Functions | |
| virtual bool | beginScene (bool backBuffer=true, bool zBuffer=true, SColor color=SColor(255, 0, 0, 0), const SExposedVideoData &videoData=SExposedVideoData(), core::rect< s32 > *sourceRect=0)=0 |
| Applications must call this method before performing any rendering. | |
| virtual bool | endScene ()=0 |
| Presents the rendered image to the screen. | |
| virtual bool | queryFeature (E_VIDEO_DRIVER_FEATURE feature) const =0 |
| Queries the features of the driver. | |
| virtual void | disableFeature (E_VIDEO_DRIVER_FEATURE feature, bool flag=true)=0 |
| Disable a feature of the driver. | |
| virtual const io::IAttributes & | getDriverAttributes () const =0 |
| Get attributes of the actual video driver. | |
| virtual bool | checkDriverReset ()=0 |
| Check if the driver was recently reset. | |
| virtual u32 | getImageLoaderCount () const =0 |
| Retrieve the number of image loaders. | |
| virtual IImageLoader * | getImageLoader (u32 n)=0 |
| Retrieve the given image loader. | |
| virtual u32 | getImageWriterCount () const =0 |
| Retrieve the number of image writers. | |
| virtual IImageWriter * | getImageWriter (u32 n)=0 |
| Retrieve the given image writer. | |
| virtual void | setMaterial (const SMaterial &material)=0 |
| Sets a material. | |
| virtual ITexture * | getTexture (const io::path &filename)=0 |
| Get access to a named texture. | |
| virtual ITexture * | getTexture (io::IReadFile *file)=0 |
| Get access to a named texture. | |
| virtual ITexture * | getTextureCube (const io::path &filenameX1, const io::path &filenameX2, const io::path &filenameY1, const io::path &filenameY2, const io::path &filenameZ1, const io::path &filenameZ2)=0 |
| virtual ITexture * | getTextureCube (IImage *imageX1, IImage *imageX2, IImage *imageY1, IImage *imageY2, IImage *imageZ1, IImage *imageZ2)=0 |
| virtual ITexture * | getTextureArray (core::array< io::path > &files)=0 |
| virtual ITexture * | getTextureArray (IImage **images, u32 num)=0 |
| virtual ITexture * | getTextureByIndex (u32 index)=0 |
| Returns a texture by index. | |
| virtual u32 | getTextureCount () const =0 |
| Returns amount of textures currently loaded. | |
| virtual void | renameTexture (ITexture *texture, const io::path &newName)=0 |
| Renames a texture. | |
| virtual ITexture * | addTexture (const core::dimension2d< u32 > &size, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0 |
| Creates an empty texture of specified size. | |
| virtual ITexture * | addTexture (const io::path &name, IImage *image, void *mipmapData=0)=0 |
| Creates a texture from an IImage. | |
| virtual ITexture * | addRenderTargetTexture (const core::dimension2d< u32 > &size, const io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0 |
| Adds a new render target texture to the texture cache. | |
| virtual ITexture * | addRenderTargetCubeTexture (const core::dimension2d< u32 > &size, const io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0 |
| skylicht engine add | |
| virtual ITexture * | addRenderTargetTextureArray (const core::dimension2d< u32 > &size, u32 arraySize, const io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0 |
| skylicht engine add | |
| virtual IVideoRenderTarget * | addVideoRenderTarget (void *hwnd, u32 w, u32 h)=0 |
| skylicht engine add | |
| virtual void | removeVideoRenderTarget (IVideoRenderTarget *vrt)=0 |
| virtual void | setVideoRenderTarget (IVideoRenderTarget *vrt)=0 |
| virtual void | removeTexture (ITexture *texture)=0 |
| Removes a texture from the texture cache and deletes it. | |
| virtual void | removeAllTextures ()=0 |
| Removes all textures from the texture cache and deletes them. | |
| virtual IHardwareBuffer * | createHardwareBuffer (scene::IIndexBuffer *indexBuffer)=0 |
| virtual IHardwareBuffer * | createHardwareBuffer (scene::IVertexBuffer *vertexBuffer)=0 |
| virtual void | addOcclusionQuery (scene::ISceneNode *node, const scene::IMesh *mesh=0)=0 |
| Create occlusion query. | |
| virtual void | removeOcclusionQuery (scene::ISceneNode *node)=0 |
| Remove occlusion query. | |
| virtual void | removeAllOcclusionQueries ()=0 |
| Remove all occlusion queries. | |
| virtual void | runOcclusionQuery (scene::ISceneNode *node, bool visible=false)=0 |
| Run occlusion query. Draws mesh stored in query. | |
| virtual void | runAllOcclusionQueries (bool visible=false)=0 |
| Run all occlusion queries. Draws all meshes stored in queries. | |
| virtual void | updateOcclusionQuery (scene::ISceneNode *node, bool block=true)=0 |
| Update occlusion query. Retrieves results from GPU. | |
| virtual void | updateAllOcclusionQueries (bool block=true)=0 |
| Update all occlusion queries. Retrieves results from GPU. | |
| virtual u32 | getOcclusionQueryResult (scene::ISceneNode *node) const =0 |
| Return query result. | |
| virtual void | makeColorKeyTexture (video::ITexture *texture, video::SColor color, bool zeroTexels=false) const =0 |
| Sets a boolean alpha channel on the texture based on a color key. | |
| virtual void | makeColorKeyTexture (video::ITexture *texture, core::position2d< s32 > colorKeyPixelPos, bool zeroTexels=false) const =0 |
| Sets a boolean alpha channel on the texture based on the color at a position. | |
| virtual void | makeNormalMapTexture (video::ITexture *texture, f32 amplitude=1.0f) const =0 |
| Creates a normal map from a height map texture. | |
| virtual bool | setRenderTarget (video::ITexture *texture, bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0), video::ITexture *depthStencil=0)=0 |
| Sets a new render target. (this prototype will be removed in future). | |
| virtual bool | setRenderTarget (video::ITexture *texture, video::ITexture *depthStencil, bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0)) |
| Sets a new render target. | |
| virtual bool | setRenderTarget (const core::array< video::IRenderTarget > &texture, bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0), video::ITexture *depthStencil=0)=0 |
| Sets new multiple render targets. (this prototype will be removed in future). | |
| virtual bool | setRenderTarget (const core::array< video::IRenderTarget > &texture, video::ITexture *depthStencil, bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0)) |
| Sets new multiple render targets. | |
| virtual bool | setRenderTarget (E_RENDER_TARGET target, bool clearTarget=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0))=0 |
| set or reset special render targets | |
| virtual bool | setRenderTargetArray (video::ITexture *texture, int arrayID, bool clearTarget=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0))=0 |
| virtual bool | setRenderTargetCube (video::ITexture *texture, E_CUBEMAP_FACE face, bool clearTarget=true, bool clearZBuffer=true, SColor color=video::SColor(0, 0, 0, 0))=0 |
| virtual void | setViewPort (const core::rect< s32 > &area)=0 |
| Sets a new viewport. | |
| virtual const core::rect< s32 > & | getViewPort () const =0 |
| Gets the area of the current viewport. | |
| virtual void | setScissor (const core::rect< s32 > &area)=0 |
| virtual const core::rect< s32 > & | getScissor () const =0 |
| virtual void | enableScissor (bool b)=0 |
| virtual void | draw3DLine (const core::vector3df &start, const core::vector3df &end, SColor color=SColor(255, 255, 255, 255))=0 |
| Draws a 3d line. | |
| virtual void | draw3DLine (const core::array< core::vector3df > &listPoint, SColor color)=0 |
| virtual void | draw3DTriangle (const core::triangle3df &triangle, SColor color=SColor(255, 255, 255, 255))=0 |
| Draws a 3d triangle. | |
| virtual void | draw3DBox (const core::aabbox3d< f32 > &box, SColor color=SColor(255, 255, 255, 255))=0 |
| Draws a 3d axis aligned box. | |
| virtual void | drawMeshBuffer (const scene::IMeshBuffer *mb)=0 |
| Draws a mesh buffer. | |
| virtual void | drawMeshBufferNormals (const scene::IMeshBuffer *mb, f32 length=10.f, SColor color=0xffffffff)=0 |
| Draws normals of a mesh buffer. | |
| virtual void | setFog (SColor color=SColor(0, 255, 255, 255), E_FOG_TYPE fogType=EFT_FOG_LINEAR, f32 start=50.0f, f32 end=100.0f, f32 density=0.01f, bool pixelFog=false, bool rangeFog=false)=0 |
| Sets the fog mode. | |
| virtual void | getFog (SColor &color, E_FOG_TYPE &fogType, f32 &start, f32 &end, f32 &density, bool &pixelFog, bool &rangeFog)=0 |
| Gets the fog mode. | |
| virtual bool | isMaterialTransparent (const SMaterial &material)=0 |
| Check material is transparent. | |
| virtual ECOLOR_FORMAT | getColorFormat () const =0 |
| Get the current color format of the color buffer. | |
| virtual const core::dimension2d< u32 > & | getScreenSize () const =0 |
| Get the size of the screen or render window. | |
| virtual const core::dimension2d< u32 > & | getCurrentRenderTargetSize () const =0 |
| Get the size of the current render target. | |
| virtual s32 | getFPS () const =0 |
| Returns current frames per second value. | |
| virtual s32 | getTextureChange () const =0 |
| virtual s32 | getDrawCall () const =0 |
| virtual u32 | getPrimitiveCountDrawn (u32 mode=0) const =0 |
| Returns amount of primitives (mostly triangles) which were drawn in the last frame. | |
| virtual u32 | getTextureChangeCount (u32 param) const =0 |
| virtual void | deleteAllDynamicLights ()=0 |
| Deletes all dynamic lights which were previously added with addDynamicLight(). | |
| virtual s32 | addDynamicLight (const SLight &light)=0 |
| virtual u32 | getMaximalDynamicLightAmount () const =0 |
| Returns the maximal amount of dynamic lights the device can handle. | |
| virtual u32 | getDynamicLightCount () const =0 |
| Returns amount of dynamic lights currently set. | |
| virtual const SLight & | getDynamicLight (u32 idx) const =0 |
| Returns light data which was previously set by IVideoDriver::addDynamicLight(). | |
| virtual void | turnLightOn (s32 lightIndex, bool turnOn)=0 |
| virtual const wchar_t * | getName () const =0 |
| Gets name of this video driver. | |
| virtual void | addExternalImageLoader (IImageLoader *loader)=0 |
| Adds an external image loader to the engine. | |
| virtual void | addExternalImageWriter (IImageWriter *writer)=0 |
| Adds an external image writer to the engine. | |
| virtual u32 | getMaximalPrimitiveCount () const =0 |
| Returns the maximum amount of primitives. | |
| virtual void | setTextureCreationFlag (E_TEXTURE_CREATION_FLAG flag, bool enabled=true)=0 |
| Enables or disables a texture creation flag. | |
| virtual bool | getTextureCreationFlag (E_TEXTURE_CREATION_FLAG flag) const =0 |
| Returns if a texture creation flag is enabled or disabled. | |
| virtual IImage * | createImageFromFile (const io::path &filename)=0 |
| Creates a software image from a file. | |
| virtual IImage * | createImageFromFile (io::IReadFile *file)=0 |
| Creates a software image from a file. | |
| virtual bool | writeImageToFile (IImage *image, const io::path &filename, u32 param=0)=0 |
| Writes the provided image to a file. | |
| virtual bool | writeImageToFile (IImage *image, io::IWriteFile *file, u32 param=0)=0 |
| Writes the provided image to a file. | |
| virtual IImage * | createImageFromData (ECOLOR_FORMAT format, const core::dimension2d< u32 > &size, void *data, bool ownForeignMemory=false, bool deleteMemory=true)=0 |
| Creates a software image from a byte array. | |
| virtual IImage * | createImage (ECOLOR_FORMAT format, const core::dimension2d< u32 > &size)=0 |
| Creates an empty software image. | |
| virtual _IRR_DEPRECATED_ IImage * | createImage (ECOLOR_FORMAT format, IImage *imageToCopy)=0 |
| Creates a software image by converting it to given format from another image. | |
| virtual _IRR_DEPRECATED_ IImage * | createImage (IImage *imageToCopy, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0 |
| Creates a software image from a part of another image. | |
| virtual IImage * | createImage (ITexture *texture, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0 |
| Creates a software image from a part of a texture. | |
| virtual IRWBuffer * | createRWBuffer (video::ECOLOR_FORMAT format, u32 numElements, void *initialData=NULL)=0 |
| Creates a buffer stored on gpu. | |
| virtual void | OnResize (const core::dimension2d< u32 > &size)=0 |
| Event handler for resize events. Only used by the engine internally. | |
| virtual s32 | addMaterialRenderer (IMaterialRenderer *renderer, const c8 *name=0)=0 |
| Adds a new material renderer to the video device. | |
| virtual IMaterialRenderer * | getMaterialRenderer (u32 idx)=0 |
| Get access to a material renderer by index. | |
| virtual u32 | getMaterialRendererCount () const =0 |
| Get amount of currently available material renderers. | |
| virtual const c8 * | getMaterialRendererName (u32 idx) const =0 |
| Get name of a material renderer. | |
| virtual void | setMaterialRendererName (s32 idx, const c8 *name)=0 |
| Sets the name of a material renderer. | |
| virtual io::IAttributes * | createAttributesFromMaterial (const video::SMaterial &material, io::SAttributeReadWriteOptions *options=0)=0 |
| Creates material attributes list from a material. | |
| virtual void | fillMaterialStructureFromAttributes (video::SMaterial &outMaterial, io::IAttributes *attributes)=0 |
| Fills an SMaterial structure from attributes. | |
| virtual const SExposedVideoData & | getExposedVideoData ()=0 |
| Returns driver and operating system specific data about the IVideoDriver. | |
| virtual E_DRIVER_TYPE | getDriverType () const =0 |
| Get type of video driver. | |
| virtual IGPUProgrammingServices * | getGPUProgrammingServices ()=0 |
| Gets the IGPUProgrammingServices interface. | |
| virtual scene::IMeshManipulator * | getMeshManipulator ()=0 |
| Returns a pointer to the mesh manipulator. | |
| virtual void | clearZBuffer ()=0 |
| Clears the ZBuffer. | |
| virtual IImage * | createScreenShot (video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER)=0 |
| Make a screenshot of the last rendered frame. | |
| virtual video::ITexture * | findTexture (const io::path &filename)=0 |
| Check if the image is already loaded. | |
| virtual bool | setClipPlane (u32 index, const core::plane3df &plane, bool enable=false)=0 |
| Set or unset a clipping plane. | |
| virtual void | enableClipPlane (u32 index, bool enable)=0 |
| Enable or disable a clipping plane. | |
| virtual void | setMinHardwareBufferVertexCount (u32 count)=0 |
| Set the minimum number of vertices for which a hw buffer will be created. | |
| virtual core::stringc | getVendorInfo ()=0 |
| Get the graphics card vendor name. | |
| virtual core::stringc | getGPUName ()=0 |
| virtual void | setAmbientLight (const SColorf &color)=0 |
| Only used by the engine internally. | |
| virtual void | setAllowZWriteOnTransparent (bool flag)=0 |
| Only used by the engine internally. | |
| virtual core::dimension2du | getMaxTextureSize () const =0 |
| Get the maximum texture size supported. | |
| virtual void | convertColor (const void *sP, ECOLOR_FORMAT sF, s32 sN, void *dP, ECOLOR_FORMAT dF) const =0 |
| Color conversion convenience function. | |
| virtual IVertexDescriptor * | addVertexDescriptor (const core::stringc &pName)=0 |
| virtual IVertexDescriptor * | getVertexDescriptor (u32 id) const =0 |
| virtual IVertexDescriptor * | getVertexDescriptor (const core::stringc &pName) const =0 |
| virtual u32 | getVertexDescriptorCount () const =0 |
| virtual void | setDefaultFrameBuffer (int framebuffer)=0 |
| set default frame | |
| virtual int | getDefaultFrameBuffer ()=0 |
| get default frame | |
| virtual void | setTransform (E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0 |
| sets transformation | |
| virtual const core::matrix4 & | getTransform (E_TRANSFORMATION_STATE state) const =0 |
| Returns the transformation set by setTransform. | |
| Public Member Functions inherited from irr::IReferenceCounted | |
| IReferenceCounted () | |
| Constructor. | |
| virtual | ~IReferenceCounted () |
| Destructor. | |
| void | grab () const |
| Grabs the object. Increments the reference counter by one. | |
| bool | drop () const |
| Drops the object. Decrements the reference counter by one. | |
| s32 | getReferenceCount () const |
| Get the reference count. | |
| const c8 * | getDebugName () const |
| Returns the debug name of the object. | |
Additional Inherited Members | |
| Protected Member Functions inherited from irr::IReferenceCounted | |
| void | setDebugName (const c8 *newName) |
| Sets the debug name of the object. | |
Interface to driver which is able to perform 2d and 3d graphics functions.
This interface is one of the most important interfaces of the Irrlicht Engine: All rendering and texture manipulation is done with this interface. You are able to use the Irrlicht Engine by only invoking methods of this interface if you like to, although the irr::scene::ISceneManager interface provides a lot of powerful classes and methods to make the programmer's life easier.
adds a dynamic light, returning an index to the light
| light | the light data to use to create the light |
|
pure virtual |
Adds an external image loader to the engine.
This is useful if the Irrlicht Engine should be able to load textures of currently unsupported file formats (e.g. gif). The IImageLoader only needs to be implemented for loading this file format. A pointer to the implementation can be passed to the engine using this method.
| loader | Pointer to the external loader created. |
|
pure virtual |
Adds an external image writer to the engine.
This is useful if the Irrlicht Engine should be able to write textures of currently unsupported file formats (e.g .gif). The IImageWriter only needs to be implemented for writing this file format. A pointer to the implementation can be passed to the engine using this method.
| writer | Pointer to the external writer created. |
|
pure virtual |
Adds a new material renderer to the video device.
Use this method to extend the VideoDriver with new material types. To extend the engine using this method do the following: Derive a class from IMaterialRenderer and override the methods you need. For setting the right renderstates, you can try to get a pointer to the real rendering device using IVideoDriver::getExposedVideoData(). Add your class with IVideoDriver::addMaterialRenderer(). To use an object being displayed with your new material, set the MaterialType member of the SMaterial struct to the value returned by this method. If you simply want to create a new material using vertex and/or pixel shaders it would be easier to use the video::IGPUProgrammingServices interface which you can get using the getGPUProgrammingServices() method.
| renderer | A pointer to the new renderer. |
| name | Optional name for the material renderer entry. |
|
pure virtual |
Create occlusion query.
Use node for identification and mesh for occlusion test.
|
pure virtual |
Adds a new render target texture to the texture cache.
| size | Size of the texture, in pixels. Width and height should be a power of two (e.g. 64, 128, 256, 512, ...) and it should not be bigger than the backbuffer, because it shares the zbuffer with the screen buffer. |
| name | An optional name for the RTT. |
| format | The color format of the render target. Floating point formats are supported. |
|
pure virtual |
Creates an empty texture of specified size.
| size | Size of the texture. |
| name | A name for the texture. Later calls to getTexture() with this name will return this texture |
| format | Desired color format of the texture. Please note that the driver may choose to create the texture in another color format. |
|
pure virtual |
Creates a texture from an IImage.
| name | A name for the texture. Later calls of getTexture() with this name will return this texture |
| image | Image the texture is created from. |
| mipmapData | Optional pointer to a set of images which build up the whole mipmap set. Must be images of the same color type as image. If this parameter is not given, the mipmaps are derived from image. |
|
pure virtual |
Applications must call this method before performing any rendering.
This method can clear the back- and the z-buffer.
| backBuffer | Specifies if the back buffer should be cleared, which means that the screen is filled with the color specified. If this parameter is false, the back buffer will not be cleared and the color parameter is ignored. |
| zBuffer | Specifies if the depth buffer (z buffer) should be cleared. It is not nesesarry to do so if only 2d drawing is used. |
| color | The color used for back buffer clearing |
| videoData | Handle of another window, if you want the bitmap to be displayed on another window. If this is an empty element, everything will be displayed in the default window. Note: This feature is not fully implemented for all devices. |
| sourceRect | Pointer to a rectangle defining the source rectangle of the area to be presented. Set to null to present everything. Note: not implemented in all devices. |
|
pure virtual |
Check if the driver was recently reset.
For d3d devices you will need to recreate the RTTs if the driver was reset. Should be queried right after beginScene().
|
pure virtual |
Clears the ZBuffer.
Note that you usually need not to call this method, as it is automatically done in IVideoDriver::beginScene() or IVideoDriver::setRenderTarget() if you enable zBuffer. But if you have to render some special things, you can clear the zbuffer during the rendering process with this method any time.
|
pure virtual |
Color conversion convenience function.
Convert an image (as array of pixels) from source to destination array, thereby converting the color format. The pixel size is determined by the color formats.
| sP | Pointer to source |
| sF | Color format of source |
| sN | Number of pixels to convert, both array must be large enough |
| dP | Pointer to destination |
| dF | Color format of destination |
|
pure virtual |
Creates material attributes list from a material.
This method is useful for serialization and more. Please note that the video driver will use the material renderer names from getMaterialRendererName() to write out the material type name, so they should be set before.
| material | The material to serialize. |
| options | Additional options which might influence the serialization. |
|
pure virtual |
Creates an empty software image.
| format | Desired color format of the image. |
| size | Size of the image to create. |
|
pure virtual |
Creates a software image by converting it to given format from another image.
| format | Desired color format of the image. |
| imageToCopy | Image to copy to the new image. |
|
pure virtual |
Creates a software image from a part of another image.
| imageToCopy | Image to copy to the new image in part. |
| pos | Position of rectangle to copy. |
| size | Extents of rectangle to copy. |
|
pure virtual |
Creates a software image from a part of a texture.
| texture | Texture to copy to the new image in part. |
| pos | Position of rectangle to copy. |
| size | Extents of rectangle to copy. |
|
pure virtual |
Creates a software image from a byte array.
No hardware texture will be created for this image. This method is useful for example if you want to read a heightmap for a terrain renderer.
| format | Desired color format of the texture |
| size | Desired size of the image |
| data | A byte array with pixel color information |
| ownForeignMemory | If true, the image will use the data pointer directly and own it afterwards. If false, the memory will by copied internally. |
| deleteMemory | Whether the memory is deallocated upon destruction. |
|
pure virtual |
Creates a software image from a file.
No hardware texture will be created for this image. This method is useful for example if you want to read a heightmap for a terrain renderer.
| filename | Name of the file from which the image is created. |
|
pure virtual |
Creates a software image from a file.
No hardware texture will be created for this image. This method is useful for example if you want to read a heightmap for a terrain renderer.
| file | File from which the image is created. |
|
pure virtual |
Creates a buffer stored on gpu.
| format | pixel data. |
| number | of pixels |
|
pure virtual |
Make a screenshot of the last rendered frame.
|
pure virtual |
Disable a feature of the driver.
Can also be used to enable the features again. It is not possible to enable unsupported features this way, though.
| feature | Feature to disable. |
| flag | When true the feature is disabled, otherwise it is enabled. |
|
pure virtual |
Draws a 3d axis aligned box.
This method simply calls draw3DLine for the edges of the box. Note that the box is drawn using the current transformation matrix and material. So if you need to draw it independently of the current transformation, use
for some properly set up material before drawing the box.
| box | The axis aligned box to draw |
| color | Color to use while drawing the box. |
|
pure virtual |
Draws a 3d line.
For some implementations, this method simply calls drawVertexPrimitiveList for some triangles. Note that the line is drawn using the current transformation matrix and material. So if you need to draw the 3D line independently of the current transformation, use
for some properly set up material before drawing the line. Some drivers support line thickness set in the material.
| start | Start of the 3d line. |
| end | End of the 3d line. |
| color | Color of the line. |
|
pure virtual |
Draws a 3d triangle.
This method calls drawVertexPrimitiveList for some triangles. This method works with all drivers because it simply calls drawVertexPrimitiveList, but it is hence not very fast. Note that the triangle is drawn using the current transformation matrix and material. So if you need to draw it independently of the current transformation, use
for some properly set up material before drawing the triangle.
| triangle | The triangle to draw. |
| color | Color of the line. |
|
pure virtual |
Draws a mesh buffer.
| mb | Buffer to draw |
|
pure virtual |
Draws normals of a mesh buffer.
| mb | Buffer to draw the normals of |
| length | length scale factor of the normals |
| color | Color the normals are rendered with |
|
pure virtual |
Enable or disable a clipping plane.
There are at least 6 clipping planes available for the user to set at will.
| index | The plane index. Must be between 0 and MaxUserClipPlanes. |
| enable | If true, enable the clipping plane else disable it. |
|
pure virtual |
Presents the rendered image to the screen.
Applications must call this method after performing any rendering.
|
pure virtual |
Fills an SMaterial structure from attributes.
Please note that for setting material types of the material, the video driver will need to query the material renderers for their names, so all non built-in materials must have been created before calling this method.
| outMaterial | The material to set the properties for. |
| attributes | The attributes to read from. |
|
pure virtual |
Check if the image is already loaded.
Works similar to getTexture(), but does not load the texture if it is not currently loaded.
| filename | Name of the texture. |
|
pure virtual |
Get the current color format of the color buffer.
|
pure virtual |
Get the size of the current render target.
This method will return the screen size if the driver doesn't support render to texture, or if the current render target is the screen.
|
pure virtual |
Get attributes of the actual video driver.
The following names can be queried for the given types: 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. 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. MaxLights (int) Number of hardware lights supported in the fixed function pipieline of the driver, typically 6-8. Use light manager or deferred shading for more. MaxAnisotropy (int) Number of anisotropy levels supported for filtering. At least 1, max is typically at 16 or 32. MaxUserClipPlanes (int) Number of additional clip planes, which can be set by the user via dedicated driver methods. MaxAuxBuffers (int) Special render buffers, which are currently not really usable inside Irrlicht. Only supported by OpenGL MaxMultipleRenderTargets (int) Number of render targets which can be bound simultaneously. Rendering to MRTs is done via shaders. MaxIndices (int) Number of indices which can be used in one render call (i.e. one mesh buffer). MaxTextureSize (int) Dimension that a texture may have, both in width and height. MaxGeometryVerticesOut (int) Number of vertices the geometry shader can output in one pass. Only OpenGL so far. MaxTextureLODBias (float) Maximum value for LOD bias. Is usually at around 16, but can be lower on some systems. Version (int) Version of the driver. Should be Major*100+Minor ShaderLanguageVersion (int) Version of the high level shader language. Should be Major*100+Minor. 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
|
pure virtual |
Get type of video driver.
Returns light data which was previously set by IVideoDriver::addDynamicLight().
| idx | Zero based index of the light. Must be 0 or greater and smaller than IVideoDriver::getDynamicLightCount. |
|
pure virtual |
Returns amount of dynamic lights currently set.
|
pure virtual |
Returns driver and operating system specific data about the IVideoDriver.
This method should only be used if the engine should be extended without having to modify the source of the engine.
|
pure virtual |
Returns current frames per second value.
This value is updated approximately every 1.5 seconds and is only intended to provide a rough guide to the average frame rate. It is not suitable for use in performing timing calculations or framerate independent movement.
|
pure virtual |
Gets the IGPUProgrammingServices interface.
|
pure virtual |
Retrieve the given image loader.
| n | The index of the loader to retrieve. This parameter is an 0-based array index. |
|
pure virtual |
Retrieve the number of image loaders.
|
pure virtual |
Retrieve the given image writer.
| n | The index of the writer to retrieve. This parameter is an 0-based array index. |
|
pure virtual |
Retrieve the number of image writers.
|
pure virtual |
Get access to a material renderer by index.
| idx | Id of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer(). |
|
pure virtual |
Get amount of currently available material renderers.
Get name of a material renderer.
This string can, e.g., be used to test if a specific renderer already has been registered/created, or use this string to store data about materials: This returned name will be also used when serializing materials.
| idx | Id of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer(). |
|
pure virtual |
Returns the maximal amount of dynamic lights the device can handle.
|
pure virtual |
Returns the maximum amount of primitives.
(mostly vertices) which the device is able to render with one drawVertexPrimitiveList call.
|
pure virtual |
Gets name of this video driver.
|
pure virtual |
Return query result.
Return value is the number of visible pixels/fragments. The value is a safe approximation, i.e. can be larger than the actual value of pixels.
Returns amount of primitives (mostly triangles) which were drawn in the last frame.
Together with getFPS() very useful method for statistics.
| mode | Defines if the primitives drawn are accumulated or counted per frame. |
|
pure virtual |
Get the size of the screen or render window.
Get access to a named texture.
Loads the texture from disk if it is not already loaded and generates mipmap levels if desired. Texture loading can be influenced using the setTextureCreationFlag() method. The texture can be in several imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
| filename | Filename of the texture to be loaded. |
|
pure virtual |
Get access to a named texture.
Loads the texture from disk if it is not already loaded and generates mipmap levels if desired. Texture loading can be influenced using the setTextureCreationFlag() method. The texture can be in several imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
| file | Pointer to an already opened file. |
Returns a texture by index.
| index | Index of the texture, must be smaller than getTextureCount() Please note that this index might change when adding or removing textures |
|
pure virtual |
Returns amount of textures currently loaded.
|
pure virtual |
Returns if a texture creation flag is enabled or disabled.
You can change this value using setTextureCreationFlag().
| flag | Texture creation flag. |
|
pure virtual |
Gets the area of the current viewport.
|
pure virtual |
Sets a boolean alpha channel on the texture based on the color at a position.
This makes the texture fully transparent at the texels where the color key can be found when using for example draw2DImage with useAlphachannel==true. The alpha of other texels is not modified.
| texture | Texture whose alpha channel is modified. |
| colorKeyPixelPos | Position of a pixel with the color key color. Every texel with this color will become fully transparent as described above. |
| zeroTexels |
|
pure virtual |
Sets a boolean alpha channel on the texture based on a color key.
This makes the texture fully transparent at the texels where this color key can be found when using for example draw2DImage with useAlphachannel==true. The alpha of other texels is not modified.
| texture | Texture whose alpha channel is modified. |
| color | Color key color. Every texel with this color will become fully transparent as described above. Please note that the colors of a texture may be converted when loading it, so the color values may not be exactly the same in the engine and for example in picture edit programs. To avoid this problem, you could use the makeColorKeyTexture method, which takes the position of a pixel instead a color value. |
| zeroTexels |
|
pure virtual |
Creates a normal map from a height map texture.
If the target texture has 32 bit, the height value is stored in the alpha component of the texture as addition. This value is used by the video::EMT_PARALLAX_MAP_SOLID material and similar materials.
| texture | Texture whose alpha channel is modified. |
| amplitude | Constant value by which the height information is multiplied. |
|
pure virtual |
Event handler for resize events. Only used by the engine internally.
Used to notify the driver that the window was resized. Usually, there is no need to call this method.
|
pure virtual |
Queries the features of the driver.
Returns true if a feature is available
| feature | Feature to query. |
|
pure virtual |
Removes all textures from the texture cache and deletes them.
This method can free a lot of memory! Please note that after calling this, the pointer to the ITexture may no longer be valid, if it was not grabbed before by other parts of the engine for storing it longer. So it is a good idea to set all materials which are using this texture to 0 or another texture first.
|
pure virtual |
Removes a texture from the texture cache and deletes it.
This method can free a lot of memory! Please note that after calling this, the pointer to the ITexture may no longer be valid, if it was not grabbed before by other parts of the engine for storing it longer. So it is a good idea to set all materials which are using this texture to 0 or another texture first.
| texture | Texture to delete from the engine cache. |
|
pure virtual |
Renames a texture.
| texture | Pointer to the texture to rename. |
| newName | New name for the texture. This should be a unique name. |
|
pure virtual |
Run all occlusion queries. Draws all meshes stored in queries.
If the meshes shall not be rendered visible, use overrideMaterial to disable the color and depth buffer.
|
pure virtual |
Run occlusion query. Draws mesh stored in query.
If the mesh shall not be rendered visible, use overrideMaterial to disable the color and depth buffer.
|
pure virtual |
Only used by the engine internally.
Passes the global material flag AllowZWriteOnTransparent. Use the SceneManager attribute to set this value from your app.
| flag | Default behavior is to disable ZWrite, i.e. false. |
|
pure virtual |
Only used by the engine internally.
The ambient color is set in the scene manager, see scene::ISceneManager::setAmbientLight().
| color | New color of the ambient light. |
|
pure virtual |
Set or unset a clipping plane.
There are at least 6 clipping planes available for the user to set at will.
| index | The plane index. Must be between 0 and MaxUserClipPlanes. |
| plane | The plane itself. |
| enable | If true, enable the clipping plane else disable it. |
|
pure virtual |
Sets the fog mode.
These are global values attached to each 3d object rendered, which has the fog flag enabled in its material.
| color | Color of the fog |
| fogType | Type of fog used |
| start | Only used in linear fog mode (linearFog=true). Specifies where fog starts. |
| end | Only used in linear fog mode (linearFog=true). Specifies where fog ends. |
| density | Only used in exponential fog mode (linearFog=false). Must be a value between 0 and 1. |
| pixelFog | Set this to false for vertex fog, and true if you want per-pixel fog. |
| rangeFog | Set this to true to enable range-based vertex fog. The distance from the viewer is used to compute the fog, not the z-coordinate. This is better, but slower. This might not be available with all drivers and fog settings. |
|
pure virtual |
Sets a material.
All 3d drawing functions will draw geometry using this material thereafter.
| material | Material to be used from now on. |
|
pure virtual |
Sets the name of a material renderer.
Will have no effect on built-in material renderers.
| idx | Id of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer(). |
| name | New name of the material renderer. |
|
pure virtual |
Set the minimum number of vertices for which a hw buffer will be created.
| count | Number of vertices to set as minimum. |
|
pure virtual |
set or reset special render targets
This method enables access to special color buffers such as stereoscopic buffers or auxiliary buffers.
| target | Enum value for the render target |
| clearTarget | Clears the target buffer with the color parameter |
| clearZBuffer | Clears the zBuffer of the rendertarget. Note that because the main frame buffer may share the zbuffer with the rendertarget, its zbuffer might be partially cleared too by this. |
| color | The background color for the render target. |
|
pure virtual |
Sets a new render target. (this prototype will be removed in future).
This will only work if the driver supports the EVDF_RENDER_TO_TARGET feature, which can be queried with queryFeature(). Usually, rendering to textures is done in this way:
Please note that you cannot render 3D or 2D geometry with a render target as texture on it when you are rendering the scene into this render target at the same time. It is usually only possible to render into a texture between the IVideoDriver::beginScene() and endScene() method calls.
| texture | New render target. Must be a texture created with IVideoDriver::addRenderTargetTexture(). If set to 0, it sets the previous render target which was set before the last setRenderTarget() call. |
| clearBackBuffer | Clears the backbuffer of the render target with the color parameter |
| clearZBuffer | Clears the zBuffer of the rendertarget. Note that because the frame buffer may share the zbuffer with the rendertarget, its zbuffer might be partially cleared too by this. |
| color | The background color for the render target. |
|
pure virtual |
Enables or disables a texture creation flag.
These flags define how textures should be created. By changing this value, you can influence for example the speed of rendering a lot. But please note that the video drivers take this value only as recommendation. It could happen that you enable the ETCF_ALWAYS_16_BIT mode, but the driver still creates 32 bit textures.
| flag | Texture creation flag. |
| enabled | Specifies if the given flag should be enabled or disabled. |
|
pure virtual |
Sets a new viewport.
Every rendering operation is done into this new area.
| area | Rectangle defining the new area of rendering operations. |
|
pure virtual |
Turns a dynamic light on or off
| lightIndex | the index returned by addDynamicLight |
| turnOn | true to turn the light on, false to turn it off |
|
pure virtual |
Update all occlusion queries. Retrieves results from GPU.
If the query shall not block, set the flag to false. Update might not occur in this case, though
|
pure virtual |
Update occlusion query. Retrieves results from GPU.
If the query shall not block, set the flag to false. Update might not occur in this case, though
|
pure virtual |
Writes the provided image to a file.
Requires that there is a suitable image writer registered for writing the image.
| image | Image to write. |
| filename | Name of the file to write. |
| param | Control parameter for the backend (e.g. compression level). |
|
pure virtual |
Writes the provided image to a file.
Requires that there is a suitable image writer registered for writing the image.
| image | Image to write. |
| file | An already open io::IWriteFile object. The name will be used to determine the appropriate image writer to use. |
| param | Control parameter for the backend (e.g. compression level). |