Jimcpp 2.1.0
Jimcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
jpp::video::IVideoDriver Class Referenceabstract

Interface to driver which is able to perform 2d and 3d graphics functions. More...

#include <jimcpp/core/engine/IVideoDriver.hpp>

Inheritance diagram for jpp::video::IVideoDriver:
Inheritance graph
Collaboration diagram for jpp::video::IVideoDriver:
Collaboration graph

Public Member Functions

virtual bool beginScene (u16 clearFlag=(u16)(ECBF_COLOR|ECBF_DEPTH), SColor clearColor=SColor(255, 0, 0, 0), f32 clearDepth=1.f, u8 clearStencil=0, const SExposedVideoData &videoData=SExposedVideoData(), core::rect< s32 > *sourceRect=0)=0
 Applications must call this method before performing any rendering.
 
bool beginScene (bool backBuffer, bool zBuffer, SColor color=SColor(255, 0, 0, 0), const SExposedVideoData &videoData=SExposedVideoData(), core::rect< s32 > *sourceRect=0)
 Alternative beginScene implementation. Can't clear stencil buffer, but otherwise identical to other beginScene.
 
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::IAttributesgetDriverAttributes () const =0
 Get attributes of the actual video driver.
 
virtual bool checkDriverReset ()=0
 Check if the driver was recently reset.
 
virtual void setTransform (E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0
 Sets transformation matrices.
 
virtual const core::matrix4getTransform (E_TRANSFORMATION_STATE state) const =0
 Returns the transformation set by setTransform.
 
virtual u32 getImageLoaderCount () const =0
 Retrieve the number of image loaders.
 
virtual IImageLoadergetImageLoader (u32 n)=0
 Retrieve the given image loader.
 
virtual u32 getImageWriterCount () const =0
 Retrieve the number of image writers.
 
virtual IImageWritergetImageWriter (u32 n)=0
 Retrieve the given image writer.
 
virtual void setMaterial (const SMaterial &material)=0
 Sets a material.
 
virtual ITexturegetTexture (const io::path &filename)=0
 Get access to a named texture.
 
virtual ITexturegetTexture (io::IReadFile *file)=0
 Get access to a named texture.
 
virtual ITexturegetTextureByIndex (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 ITextureaddTexture (const core::dimension2d< u32 > &size, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
 Creates an empty texture of specified size.
 
JPP_DEPRECATED ITextureaddTexture (const io::path &name, IImage *image, void *mipmapData)
 Creates a texture from an IImage.
 
virtual ITextureaddTexture (const io::path &name, IImage *image)=0
 Creates a texture from an IImage.
 
virtual ITextureaddTextureCubemap (const io::path &name, IImage *imagePosX, IImage *imageNegX, IImage *imagePosY, IImage *imageNegY, IImage *imagePosZ, IImage *imageNegZ)=0
 Creates a cubemap texture from loaded IImages.
 
virtual ITextureaddTextureCubemap (const jpp::u32 sideLen, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
 Creates an empty cubemap texture of specified size.
 
virtual ITextureaddRenderTargetTexture (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 ITextureaddRenderTargetTextureCubemap (const jpp::u32 sideLen, const io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0
 Adds a new render target texture with 6 sides for a cubemap map to the texture cache.
 
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 void removeHardwareBuffer (const scene::IMeshBuffer *mb)=0
 Remove hardware buffer.
 
virtual void removeAllHardwareBuffers ()=0
 Remove all hardware buffers.
 
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 (const scene::ISceneNode *node) const =0
 Return query result.
 
virtual IRenderTargetaddRenderTarget ()=0
 Create render target.
 
virtual void removeRenderTarget (IRenderTarget *renderTarget)=0
 Remove render target.
 
virtual void removeAllRenderTargets ()=0
 Remove all render targets.
 
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 setRenderTargetEx (IRenderTarget *target, u16 clearFlag, SColor clearColor=SColor(255, 0, 0, 0), f32 clearDepth=1.f, u8 clearStencil=0)=0
 Set a render target.
 
virtual bool setRenderTarget (ITexture *texture, u16 clearFlag=ECBF_COLOR|ECBF_DEPTH, SColor clearColor=SColor(255, 0, 0, 0), f32 clearDepth=1.f, u8 clearStencil=0)=0
 Sets a new render target.
 
bool setRenderTarget (ITexture *texture, bool clearBackBuffer, bool clearZBuffer, SColor color=SColor(255, 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 drawVertexPrimitiveList (const void *vertices, u32 vertexCount, const void *indexList, u32 primCount, E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)=0
 Draws a vertex primitive list.
 
virtual void draw2DVertexPrimitiveList (const void *vertices, u32 vertexCount, const void *indexList, u32 primCount, E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)=0
 Draws a vertex primitive list in 2d.
 
void drawIndexedTriangleList (const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle list.
 
void drawIndexedTriangleList (const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle list.
 
void drawIndexedTriangleList (const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle list.
 
void drawIndexedTriangleFan (const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle fan.
 
void drawIndexedTriangleFan (const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle fan.
 
void drawIndexedTriangleFan (const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
 Draws an indexed triangle fan.
 
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 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 draw2DImage (const video::ITexture *texture, const core::position2d< s32 > &destPos, bool useAlphaChannelOfTexture=false)=0
 Draws a 2d image without any special effects.
 
virtual void draw2DImage (const video::ITexture *texture, const core::position2d< s32 > &destPos, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect=0, SColor color=SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture=false)=0
 Draws a 2d image using a color.
 
virtual void draw2DImageBatch (const video::ITexture *texture, const core::position2d< s32 > &pos, const core::array< core::rect< s32 > > &sourceRects, const core::array< s32 > &indices, s32 kerningWidth=0, const core::rect< s32 > *clipRect=0, SColor color=SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture=false)=0
 Draws a set of 2d images, using a color and the alpha channel of the texture.
 
virtual void draw2DImageBatch (const video::ITexture *texture, const core::array< core::position2d< s32 > > &positions, const core::array< core::rect< s32 > > &sourceRects, const core::rect< s32 > *clipRect=0, SColor color=SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture=false)=0
 Draws a set of 2d images, using a color and the alpha channel of the texture.
 
virtual void draw2DImage (const video::ITexture *texture, const core::rect< s32 > &destRect, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect=0, const video::SColor *const colors=0, bool useAlphaChannelOfTexture=false)=0
 Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.
 
virtual void draw2DRectangle (SColor color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0
 Draws a 2d rectangle.
 
virtual void draw2DRectangle (const core::rect< s32 > &pos, SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, const core::rect< s32 > *clip=0)=0
 Draws a 2d rectangle with a gradient.
 
virtual void draw2DRectangleOutline (const core::recti &pos, SColor color=SColor(255, 255, 255, 255))=0
 Draws the outline of a 2D rectangle.
 
virtual void draw2DLine (const core::position2d< s32 > &start, const core::position2d< s32 > &end, SColor color=SColor(255, 255, 255, 255))=0
 Draws a 2d line.
 
virtual void drawPixel (u32 x, u32 y, const SColor &color)=0
 Draws a pixel.
 
virtual void draw2DPolygon (core::position2d< s32 > center, f32 radius, video::SColor color=SColor(100, 255, 255, 255), s32 vertexCount=10)=0
 Draws a non filled concyclic regular 2d polygon.
 
virtual void drawStencilShadowVolume (const core::array< core::vector3df > &triangles, bool zfail=true, u32 debugDataVisible=0)=0
 Draws a shadow volume into the stencil buffer.
 
virtual void drawStencilShadow (bool clearStencilBuffer=false, video::SColor leftUpEdge=video::SColor(255, 0, 0, 0), video::SColor rightUpEdge=video::SColor(255, 0, 0, 0), video::SColor leftDownEdge=video::SColor(255, 0, 0, 0), video::SColor rightDownEdge=video::SColor(255, 0, 0, 0))=0
 Fills the stencil shadow with color.
 
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 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 u32 getPrimitiveCountDrawn (u32 mode=0) const =0
 Returns amount of primitives (mostly triangles) which were drawn in the last frame.
 
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 SLightgetDynamicLight (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 core::array< IImage * > createImagesFromFile (const io::path &filename, E_TEXTURE_TYPE *type=0)=0
 Creates a software images from a file.
 
virtual core::array< IImage * > createImagesFromFile (io::IReadFile *file, E_TEXTURE_TYPE *type=0)=0
 Creates a software images from a file.
 
IImagecreateImageFromFile (const io::path &filename)
 Creates a software image from a file.
 
IImagecreateImageFromFile (io::IReadFile *file)
 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 IImagecreateImageFromData (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 IImagecreateImage (ECOLOR_FORMAT format, const core::dimension2d< u32 > &size)=0
 Creates an empty software image.
 
virtual JPP_DEPRECATED IImagecreateImage (ECOLOR_FORMAT format, IImage *imageToCopy)=0
 Creates a software image by converting it to given format from another image.
 
virtual JPP_DEPRECATED IImagecreateImage (IImage *imageToCopy, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0
 Creates a software image from a part of another image.
 
virtual IImagecreateImage (ITexture *texture, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0
 Creates a software image from a part of a texture.
 
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 IMaterialRenderergetMaterialRenderer (u32 idx) const =0
 Get access to a material renderer by index.
 
virtual u32 getMaterialRendererCount () const =0
 Get amount of currently available material renderers.
 
virtual const c8getMaterialRendererName (u32 idx) const =0
 Get name of a material renderer.
 
virtual void setMaterialRendererName (u32 idx, const c8 *name)=0
 Sets the name of a material renderer.
 
virtual void swapMaterialRenderers (u32 idx1, u32 idx2, bool swapNames=true)=0
 Swap the material renderers used for certain id's.
 
virtual io::IAttributescreateAttributesFromMaterial (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 class from attributes.
 
virtual const SExposedVideoDatagetExposedVideoData ()=0
 Returns driver and operating system specific data about the IVideoDriver.
 
virtual E_DRIVER_TYPE getDriverType () const =0
 Get type of video driver.
 
virtual IGPUProgrammingServicesgetGPUProgrammingServices ()=0
 Gets the IGPUProgrammingServices interface.
 
virtual scene::IMeshManipulatorgetMeshManipulator ()=0
 Returns a pointer to the mesh manipulator.
 
virtual void clearBuffers (u16 flag, SColor color=SColor(255, 0, 0, 0), f32 depth=1.f, u8 stencil=0)=0
 Clear the color, depth and/or stencil buffers.
 
JPP_DEPRECATED void clearBuffers (bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
 Clear the color, depth and/or stencil buffers.
 
void clearZBuffer ()
 Clears the ZBuffer.
 
virtual IImagecreateScreenShot (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::ITexturefindTexture (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 SOverrideMaterialgetOverrideMaterial ()=0
 Get the global Material, which might override local materials.
 
virtual SMaterialgetMaterial2D ()=0
 Get the 2d override material for altering its values.
 
virtual void enableMaterial2D (bool enable=true)=0
 Enable the 2d override material.
 
virtual core::stringc getVendorInfo ()=0
 Get the graphics card vendor name.
 
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 bool queryTextureFormat (ECOLOR_FORMAT format) const =0
 Check if the driver supports creating textures with the given color format.
 
virtual bool needsTransparentRenderPass (const jpp::video::SMaterial &material) const =0
 Used by some SceneNodes to check if a material should be rendered in the transparent render pass.
 
- Public Member Functions inherited from jpp::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 c8getDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from jpp::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.
 

Detailed Description

Interface to driver which is able to perform 2d and 3d graphics functions.

This interface is one of the most important interfaces of the Jimcpp Engine: All rendering and texture manipulation is done with this interface. You are able to use the Jimcpp Engine by only invoking methods of this interface if you like to, although the jpp::scene::ISceneManager interface provides a lot of powerful classes and methods to make the programmer's life easier.

Member Function Documentation

◆ addDynamicLight()

virtual s32 jpp::video::IVideoDriver::addDynamicLight ( const SLight light)
pure virtual

adds a dynamic light, returning an index to the light

Parameters
lightthe light data to use to create the light
Returns
An index to the light, or -1 if an error occurs

◆ addExternalImageLoader()

virtual void jpp::video::IVideoDriver::addExternalImageLoader ( IImageLoader loader)
pure virtual

Adds an external image loader to the engine.

This is useful if the Jimcpp 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.

Parameters
loaderPointer to the external loader created.

◆ addExternalImageWriter()

virtual void jpp::video::IVideoDriver::addExternalImageWriter ( IImageWriter writer)
pure virtual

Adds an external image writer to the engine.

This is useful if the Jimcpp 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.

Parameters
writerPointer to the external writer created.

◆ addMaterialRenderer()

virtual s32 jpp::video::IVideoDriver::addMaterialRenderer ( IMaterialRenderer renderer,
const c8 name = 0 
)
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 class 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.

Parameters
rendererA pointer to the new renderer.
nameOptional name for the material renderer entry.
Returns
The number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred. For example if you tried to add an material renderer to the software renderer or the null device, which do not accept material renderers.

◆ addOcclusionQuery()

virtual void jpp::video::IVideoDriver::addOcclusionQuery ( scene::ISceneNode node,
const scene::IMesh mesh = 0 
)
pure virtual

Create occlusion query.

Use node for identification and mesh for occlusion test.

◆ addRenderTargetTexture()

virtual ITexture * jpp::video::IVideoDriver::addRenderTargetTexture ( const core::dimension2d< u32 > &  size,
const io::path name = "rt",
const ECOLOR_FORMAT  format = ECF_UNKNOWN 
)
pure virtual

Adds a new render target texture to the texture cache.

Parameters
sizeSize 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.
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
formatThe color format of the render target. Floating point formats are supported.
Returns
Pointer to the created texture or 0 if the texture could not be created. This pointer should not be dropped. See IReferenceCounted::drop() for more information. You may want to remove it from driver texture cache with removeTexture if you no longer need it.

◆ addRenderTargetTextureCubemap()

virtual ITexture * jpp::video::IVideoDriver::addRenderTargetTextureCubemap ( const jpp::u32  sideLen,
const io::path name = "rt",
const ECOLOR_FORMAT  format = ECF_UNKNOWN 
)
pure virtual

Adds a new render target texture with 6 sides for a cubemap map to the texture cache.

NOTE: Only supported on D3D9 so far.

Parameters
sideLenLength of one cubemap side.
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
formatThe color format of the render target. Floating point formats are supported.
Returns
Pointer to the created texture or 0 if the texture could not be created. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addTexture() [1/3]

virtual ITexture * jpp::video::IVideoDriver::addTexture ( const core::dimension2d< u32 > &  size,
const io::path name,
ECOLOR_FORMAT  format = ECF_A8R8G8B8 
)
pure virtual

Creates an empty texture of specified size.

Parameters
sizeSize of the texture.
nameA name for the texture. Later calls to getTexture() with this name will return this texture. The name can not be empty.
formatDesired color format of the texture. Please note that the driver may choose to create the texture in another color format.
Returns
Pointer to the newly created texture. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addTexture() [2/3]

virtual ITexture * jpp::video::IVideoDriver::addTexture ( const io::path name,
IImage image 
)
pure virtual

Creates a texture from an IImage.

Parameters
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
imageImage the texture is created from.
Returns
Pointer to the newly created texture. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addTexture() [3/3]

JPP_DEPRECATED ITexture * jpp::video::IVideoDriver::addTexture ( const io::path name,
IImage image,
void *  mipmapData 
)
inline

Creates a texture from an IImage.

Parameters
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
imageImage the texture is created from.
mipmapDataOptional pointer to a mipmaps data. If this parameter is not given, the mipmaps are derived from image.
Returns
Pointer to the newly created texture. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addTextureCubemap() [1/2]

virtual ITexture * jpp::video::IVideoDriver::addTextureCubemap ( const io::path name,
IImage imagePosX,
IImage imageNegX,
IImage imagePosY,
IImage imageNegY,
IImage imagePosZ,
IImage imageNegZ 
)
pure virtual

Creates a cubemap texture from loaded IImages.

Parameters
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
imagePosXImage (positive X) the texture is created from.
imageNegXImage (negative X) the texture is created from.
imagePosYImage (positive Y) the texture is created from.
imageNegYImage (negative Y) the texture is created from.
imagePosZImage (positive Z) the texture is created from.
imageNegZImage (negative Z) the texture is created from.
Returns
Pointer to the newly created texture. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addTextureCubemap() [2/2]

virtual ITexture * jpp::video::IVideoDriver::addTextureCubemap ( const jpp::u32  sideLen,
const io::path name,
ECOLOR_FORMAT  format = ECF_A8R8G8B8 
)
pure virtual

Creates an empty cubemap texture of specified size.

Parameters
sideLendiameter of one side of the cube
nameA name for the texture. Later calls of getTexture() with this name will return this texture. The name can not be empty.
formatDesired color format of the texture. Please note that the driver may choose to create the texture in another color format.
Returns
Pointer to the newly created texture.

◆ beginScene()

virtual bool jpp::video::IVideoDriver::beginScene ( u16  clearFlag = (u16)(ECBF_COLOR|ECBF_DEPTH),
SColor  clearColor = SColor(255, 0, 0, 0),
f32  clearDepth = 1.f,
u8  clearStencil = 0,
const SExposedVideoData videoData = SExposedVideoData(),
core::rect< s32 > *  sourceRect = 0 
)
pure virtual

Applications must call this method before performing any rendering.

This method can clear the back- and the z-buffer.

Parameters
clearFlagA combination of the E_CLEAR_BUFFER_FLAG bit-flags.
clearColorThe clear color for the color buffer.
clearDepthThe clear value for the depth buffer.
clearStencilThe clear value for the stencil buffer.
videoDataHandle 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.
sourceRectPointer 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.
Returns
False if failed.

◆ checkDriverReset()

virtual bool jpp::video::IVideoDriver::checkDriverReset ( )
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().

◆ clearZBuffer()

void jpp::video::IVideoDriver::clearZBuffer ( )
inline

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.

◆ convertColor()

virtual void jpp::video::IVideoDriver::convertColor ( const void *  sP,
ECOLOR_FORMAT  sF,
s32  sN,
void *  dP,
ECOLOR_FORMAT  dF 
) const
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.

Parameters
sPPointer to source
sFColor format of source
sNNumber of pixels to convert, both array must be large enough
dPPointer to destination
dFColor format of destination

◆ createAttributesFromMaterial()

virtual io::IAttributes * jpp::video::IVideoDriver::createAttributesFromMaterial ( const video::SMaterial material,
io::SAttributeReadWriteOptions options = 0 
)
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.

Parameters
materialThe material to serialize.
optionsAdditional options which might influence the serialization.
Returns
The io::IAttributes container holding the material properties.

◆ createImage() [1/4]

virtual IImage * jpp::video::IVideoDriver::createImage ( ECOLOR_FORMAT  format,
const core::dimension2d< u32 > &  size 
)
pure virtual

Creates an empty software image.

Parameters
formatDesired color format of the image.
sizeSize of the image to create.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImage() [2/4]

virtual JPP_DEPRECATED IImage * jpp::video::IVideoDriver::createImage ( ECOLOR_FORMAT  format,
IImage imageToCopy 
)
pure virtual

Creates a software image by converting it to given format from another image.

Deprecated:
Create an empty image and use copyTo(). This method may be removed by Jimcpp 1.9.
Parameters
formatDesired color format of the image.
imageToCopyImage to copy to the new image.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImage() [3/4]

virtual JPP_DEPRECATED IImage * jpp::video::IVideoDriver::createImage ( IImage imageToCopy,
const core::position2d< s32 > &  pos,
const core::dimension2d< u32 > &  size 
)
pure virtual

Creates a software image from a part of another image.

Deprecated:
Create an empty image and use copyTo(). This method may be removed by Jimcpp 1.9.
Parameters
imageToCopyImage to copy to the new image in part.
posPosition of rectangle to copy.
sizeExtents of rectangle to copy.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImage() [4/4]

virtual IImage * jpp::video::IVideoDriver::createImage ( ITexture texture,
const core::position2d< s32 > &  pos,
const core::dimension2d< u32 > &  size 
)
pure virtual

Creates a software image from a part of a texture.

Parameters
textureTexture to copy to the new image in part.
posPosition of rectangle to copy.
sizeExtents of rectangle to copy.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImageFromData()

virtual IImage * jpp::video::IVideoDriver::createImageFromData ( ECOLOR_FORMAT  format,
const core::dimension2d< u32 > &  size,
void *  data,
bool  ownForeignMemory = false,
bool  deleteMemory = true 
)
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.

Parameters
formatDesired color format of the texture
sizeDesired size of the image
dataA byte array with pixel color information
ownForeignMemoryIf true, the image will use the data pointer directly and own it afterward. If false, the memory will by copied internally. WARNING: Setting this to 'true' will not work across dll boundaries. So unless you link Jimcpp statically you should keep this to 'false'. The parameter is mainly for internal usage.
deleteMemoryWhether the memory is deallocated upon destruction.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImageFromFile() [1/2]

IImage * jpp::video::IVideoDriver::createImageFromFile ( const io::path filename)
inline

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.

Parameters
filenameName of the file from which the image is created.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImageFromFile() [2/2]

IImage * jpp::video::IVideoDriver::createImageFromFile ( io::IReadFile file)
inline

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.

Parameters
fileFile from which the image is created.
Returns
The created image. If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information.

◆ createImagesFromFile() [1/2]

virtual core::array< IImage * > jpp::video::IVideoDriver::createImagesFromFile ( const io::path filename,
E_TEXTURE_TYPE type = 0 
)
pure virtual

Creates a software images from a file.

No hardware texture will be created for those images. This method is useful for example if you want to read a heightmap for a terrain renderer.

Parameters
filenameName of the file from which the images are created.
typePointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
Returns
The array of created images. If you no longer need those images, you should call IImage::drop() on each of them. See IReferenceCounted::drop() for more information.

◆ createImagesFromFile() [2/2]

virtual core::array< IImage * > jpp::video::IVideoDriver::createImagesFromFile ( io::IReadFile file,
E_TEXTURE_TYPE type = 0 
)
pure virtual

Creates a software images from a file.

No hardware texture will be created for those images. This method is useful for example if you want to read a heightmap for a terrain renderer.

Parameters
fileFile from which the image is created.
typePointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
Returns
The array of created images. If you no longer need those images, you should call IImage::drop() on each of them. See IReferenceCounted::drop() for more information.

◆ createScreenShot()

virtual IImage * jpp::video::IVideoDriver::createScreenShot ( video::ECOLOR_FORMAT  format = video::ECF_UNKNOWN,
video::E_RENDER_TARGET  target = video::ERT_FRAME_BUFFER 
)
pure virtual

Make a screenshot of the last rendered frame.

Parameters
targetAll current drivers only support ERT_FRAME_BUFFER
Returns
An image created from the last rendered frame.

◆ disableFeature()

virtual void jpp::video::IVideoDriver::disableFeature ( E_VIDEO_DRIVER_FEATURE  feature,
bool  flag = true 
)
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.

Parameters
featureFeature to disable.
flagWhen true the feature is disabled, otherwise it is enabled.

◆ draw2DImage() [1/3]

virtual void jpp::video::IVideoDriver::draw2DImage ( const video::ITexture texture,
const core::position2d< s32 > &  destPos,
bool  useAlphaChannelOfTexture = false 
)
pure virtual

Draws a 2d image without any special effects.

Parameters
texturePointer to texture to use.
destPosUpper left 2d destination position where the image will be drawn.
useAlphaChannelOfTextureIf true, the alpha channel of the texture is used to draw the image.

◆ draw2DImage() [2/3]

virtual void jpp::video::IVideoDriver::draw2DImage ( const video::ITexture texture,
const core::position2d< s32 > &  destPos,
const core::rect< s32 > &  sourceRect,
const core::rect< s32 > *  clipRect = 0,
SColor  color = SColor(255, 255, 255, 255),
bool  useAlphaChannelOfTexture = false 
)
pure virtual

Draws a 2d image using a color.

(if color is other than Color(255,255,255,255)) and the alpha channel of the texture.

Parameters
textureTexture to be drawn.
destPosUpper left 2d destination position where the image will be drawn.
sourceRectSource rectangle in the texture (based on it's OriginalSize)
clipRectPointer to rectangle on the screen where the image is clipped to. If this pointer is NULL the image is not clipped.
colorColor with which the image is drawn. If the color equals Color(255,255,255,255) it is ignored. Note that the alpha component is used: If alpha is other than 255, the image will be transparent.
useAlphaChannelOfTextureIf true, the alpha channel of the texture is used to draw the image.

◆ draw2DImage() [3/3]

virtual void jpp::video::IVideoDriver::draw2DImage ( const video::ITexture texture,
const core::rect< s32 > &  destRect,
const core::rect< s32 > &  sourceRect,
const core::rect< s32 > *  clipRect = 0,
const video::SColor *const  colors = 0,
bool  useAlphaChannelOfTexture = false 
)
pure virtual

Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.

Suggested and first implemented by zola.

Parameters
textureThe texture to draw from
destRectThe rectangle to draw into
sourceRectThe rectangle denoting a part of the texture (based on it's OriginalSize)
clipRectClips the destination rectangle (may be 0)
colorsArray of 4 colors denoting the color values of the corners of the destRect
useAlphaChannelOfTextureTrue if alpha channel will be blended.

◆ draw2DImageBatch() [1/2]

virtual void jpp::video::IVideoDriver::draw2DImageBatch ( const video::ITexture texture,
const core::array< core::position2d< s32 > > &  positions,
const core::array< core::rect< s32 > > &  sourceRects,
const core::rect< s32 > *  clipRect = 0,
SColor  color = SColor(255, 255, 255, 255),
bool  useAlphaChannelOfTexture = false 
)
pure virtual

Draws a set of 2d images, using a color and the alpha channel of the texture.

All drawings are clipped against clipRect (if != 0). The subtextures are defined by the array of sourceRects and are positioned using the array of positions.

Parameters
textureTexture to be drawn.
positionsArray of upper left 2d destinations where the images will be drawn.
sourceRectsSource rectangles of the texture (based on it's OriginalSize)
clipRectPointer to rectangle on the screen where the images are clipped to. If this pointer is 0 then the image is not clipped.
colorColor with which the image is drawn. Note that the alpha component is used. If alpha is other than 255, the image will be transparent.
useAlphaChannelOfTextureIf true, the alpha channel of the texture is used to draw the image.

◆ draw2DImageBatch() [2/2]

virtual void jpp::video::IVideoDriver::draw2DImageBatch ( const video::ITexture texture,
const core::position2d< s32 > &  pos,
const core::array< core::rect< s32 > > &  sourceRects,
const core::array< s32 > &  indices,
s32  kerningWidth = 0,
const core::rect< s32 > *  clipRect = 0,
SColor  color = SColor(255, 255, 255, 255),
bool  useAlphaChannelOfTexture = false 
)
pure virtual

Draws a set of 2d images, using a color and the alpha channel of the texture.

The images are drawn beginning at pos and concatenated in one line. All drawings are clipped against clipRect (if != 0). The subtextures are defined by the array of sourceRects and are chosen by the indices given.

Parameters
textureTexture to be drawn.
posUpper left 2d destination position where the image will be drawn.
sourceRectsSource rectangles of the texture (based on it's OriginalSize)
indicesList of indices which choose the actual rectangle used each time.
kerningWidthOffset to Position on X
clipRectPointer to rectangle on the screen where the image is clipped to. If this pointer is 0 then the image is not clipped.
colorColor with which the image is drawn. Note that the alpha component is used. If alpha is other than 255, the image will be transparent.
useAlphaChannelOfTextureIf true, the alpha channel of the texture is used to draw the image.

◆ draw2DLine()

virtual void jpp::video::IVideoDriver::draw2DLine ( const core::position2d< s32 > &  start,
const core::position2d< s32 > &  end,
SColor  color = SColor(255, 255, 255, 255) 
)
pure virtual

Draws a 2d line.

In theory both start and end will be included in coloring. BUG: Currently hardware drivers (d3d/opengl) ignore the last pixel (they use the so called "diamond exit rule" for drawing lines).

Parameters
startScreen coordinates of the start of the line in pixels.
endScreen coordinates of the start of the line in pixels.
colorColor of the line to draw.

◆ draw2DPolygon()

virtual void jpp::video::IVideoDriver::draw2DPolygon ( core::position2d< s32 center,
f32  radius,
video::SColor  color = SColor(100, 255, 255, 255),
s32  vertexCount = 10 
)
pure virtual

Draws a non filled concyclic regular 2d polygon.

This method can be used to draw circles, but also triangles, tetragons, pentagons, hexagons, heptagons, octagons, enneagons, decagons, hendecagons, dodecagon, triskaidecagons, etc. I think you'll got it now. And all this by simply specifying the vertex count. Welcome to the wonders of geometry.

Parameters
centerPosition of center of circle (pixels).
radiusRadius of circle in pixels.
colorColor of the circle.
vertexCountAmount of vertices of the polygon. Specify 2 to draw a line, 3 to draw a triangle, 4 for tetragons and a lot (>10) for nearly a circle.

◆ draw2DRectangle() [1/2]

virtual void jpp::video::IVideoDriver::draw2DRectangle ( const core::rect< s32 > &  pos,
SColor  colorLeftUp,
SColor  colorRightUp,
SColor  colorLeftDown,
SColor  colorRightDown,
const core::rect< s32 > *  clip = 0 
)
pure virtual

Draws a 2d rectangle with a gradient.

Parameters
colorLeftUpColor of the upper left corner to draw. The alpha component will not be ignored and specifies how transparent the rectangle will be.
colorRightUpColor of the upper right corner to draw. The alpha component will not be ignored and specifies how transparent the rectangle will be.
colorLeftDownColor of the lower left corner to draw. The alpha component will not be ignored and specifies how transparent the rectangle will be.
colorRightDownColor of the lower right corner to draw. The alpha component will not be ignored and specifies how transparent the rectangle will be.
posPosition of the rectangle.
clipPointer to rectangle against which the rectangle will be clipped. If the pointer is null, no clipping will be performed.

◆ draw2DRectangle() [2/2]

virtual void jpp::video::IVideoDriver::draw2DRectangle ( SColor  color,
const core::rect< s32 > &  pos,
const core::rect< s32 > *  clip = 0 
)
pure virtual

Draws a 2d rectangle.

Parameters
colorColor of the rectangle to draw. The alpha component will not be ignored and specifies how transparent the rectangle will be.
posPosition of the rectangle.
clipPointer to rectangle against which the rectangle will be clipped. If the pointer is null, no clipping will be performed.

◆ draw2DRectangleOutline()

virtual void jpp::video::IVideoDriver::draw2DRectangleOutline ( const core::recti pos,
SColor  color = SColor(255, 255, 255, 255) 
)
pure virtual

Draws the outline of a 2D rectangle.

Parameters
posPosition of the rectangle.
colorColor of the rectangle to draw. The alpha component specifies how transparent the rectangle outline will be.

◆ draw2DVertexPrimitiveList()

virtual void jpp::video::IVideoDriver::draw2DVertexPrimitiveList ( const void *  vertices,
u32  vertexCount,
const void *  indexList,
u32  primCount,
E_VERTEX_TYPE  vType = EVT_STANDARD,
scene::E_PRIMITIVE_TYPE  pType = scene::EPT_TRIANGLES,
E_INDEX_TYPE  iType = EIT_16BIT 
)
pure virtual

Draws a vertex primitive list in 2d.

Compared to the general (3d) version of this method, this one sets up a 2d render mode, and uses only x and y of vectors. Note that, depending on the index type, some vertices might be not accessible through the index list. The limit is at 65535 vertices for 16bit indices. Please note that currently not all primitives are available for all drivers, and some might be emulated via triangle renders. This function is not available for the sw drivers.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices. These define the vertices used for each primitive. Depending on the pType, indices are interpreted as single objects (for point like primitives), pairs (for lines), triplets (for triangles), or quads.
primCountAmount of Primitives
vTypeVertex type, e.g. video::EVT_STANDARD for S3DVertex.
pTypePrimitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
iTypeIndex type, e.g. video::EIT_16BIT for 16bit indices.

◆ draw3DBox()

virtual void jpp::video::IVideoDriver::draw3DBox ( const core::aabbox3d< f32 > &  box,
SColor  color = SColor(255, 255, 255, 255) 
)
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

driver->setMaterial(someMaterial);
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
JIMCPP_API const matrix4 IdentityMatrix
global const identity matrix
@ ETS_WORLD
World transformation.
Definition IVideoDriver.hpp:58

for some properly set up material before drawing the box.

Parameters
boxThe axis aligned box to draw
colorColor to use while drawing the box.

◆ draw3DLine()

virtual void jpp::video::IVideoDriver::draw3DLine ( const core::vector3df start,
const core::vector3df end,
SColor  color = SColor(255, 255, 255, 255) 
)
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

driver->setMaterial(someMaterial);
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);

for some properly set up material before drawing the line. Some drivers support line thickness set in the material.

Parameters
startStart of the 3d line.
endEnd of the 3d line.
colorColor of the line.

◆ draw3DTriangle()

virtual void jpp::video::IVideoDriver::draw3DTriangle ( const core::triangle3df triangle,
SColor  color = SColor(255, 255, 255, 255) 
)
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

driver->setMaterial(someMaterial);
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);

for some properly set up material before drawing the triangle.

Parameters
triangleThe triangle to draw.
colorColor of the line.

◆ drawIndexedTriangleFan() [1/3]

void jpp::video::IVideoDriver::drawIndexedTriangleFan ( const S3DVertex vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle fan.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices - 2.

◆ drawIndexedTriangleFan() [2/3]

void jpp::video::IVideoDriver::drawIndexedTriangleFan ( const S3DVertex2TCoords vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle fan.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices - 2.

◆ drawIndexedTriangleFan() [3/3]

void jpp::video::IVideoDriver::drawIndexedTriangleFan ( const S3DVertexTangents vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle fan.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices - 2.

◆ drawIndexedTriangleList() [1/3]

void jpp::video::IVideoDriver::drawIndexedTriangleList ( const S3DVertex vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle list.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices / 3.

◆ drawIndexedTriangleList() [2/3]

void jpp::video::IVideoDriver::drawIndexedTriangleList ( const S3DVertex2TCoords vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle list.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices / 3.

◆ drawIndexedTriangleList() [3/3]

void jpp::video::IVideoDriver::drawIndexedTriangleList ( const S3DVertexTangents vertices,
u32  vertexCount,
const u16 indexList,
u32  triangleCount 
)
inline

Draws an indexed triangle list.

Note that there may be at maximum 65536 vertices, because the index list is an array of 16 bit values each with a maximum value of 65536. If there are more than 65536 vertices in the list, results of this operation are not defined.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices.
triangleCountAmount of Triangles. Usually amount of indices / 3.

◆ drawMeshBuffer()

virtual void jpp::video::IVideoDriver::drawMeshBuffer ( const scene::IMeshBuffer mb)
pure virtual

Draws a mesh buffer.

Parameters
mbBuffer to draw

◆ drawMeshBufferNormals()

virtual void jpp::video::IVideoDriver::drawMeshBufferNormals ( const scene::IMeshBuffer mb,
f32  length = 10.f,
SColor  color = 0xffffffff 
)
pure virtual

Draws normals of a mesh buffer.

Parameters
mbBuffer to draw the normals of
lengthlength scale factor of the normals
colorColor the normals are rendered with

◆ drawPixel()

virtual void jpp::video::IVideoDriver::drawPixel ( u32  x,
u32  y,
const SColor color 
)
pure virtual

Draws a pixel.

Parameters
xThe x-position of the pixel.
yThe y-position of the pixel.
colorColor of the pixel to draw.

◆ drawStencilShadow()

virtual void jpp::video::IVideoDriver::drawStencilShadow ( bool  clearStencilBuffer = false,
video::SColor  leftUpEdge = video::SColor(255, 0, 0, 0),
video::SColor  rightUpEdge = video::SColor(255, 0, 0, 0),
video::SColor  leftDownEdge = video::SColor(255, 0, 0, 0),
video::SColor  rightDownEdge = video::SColor(255, 0, 0, 0) 
)
pure virtual

Fills the stencil shadow with color.

After the shadow volume has been drawn into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this to draw the color of the shadow. Please note that the code for the opengl version of the method is based on free code sent in by Philipp Dortmann, lots of thanks go to him!

Parameters
clearStencilBufferSet this to false, if you want to draw every shadow with the same color, and only want to call drawStencilShadow() once after all shadow volumes have been drawn. Set this to true, if you want to paint every shadow with its own color.
leftUpEdgeColor of the shadow in the upper left corner of screen.
rightUpEdgeColor of the shadow in the upper right corner of screen.
leftDownEdgeColor of the shadow in the lower left corner of screen.
rightDownEdgeColor of the shadow in the lower right corner of screen.

◆ drawStencilShadowVolume()

virtual void jpp::video::IVideoDriver::drawStencilShadowVolume ( const core::array< core::vector3df > &  triangles,
bool  zfail = true,
u32  debugDataVisible = 0 
)
pure virtual

Draws a shadow volume into the stencil buffer.

To draw a stencil shadow, do this: First, draw all geometry. Then use this method, to draw the shadow volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. Please note that the code for the opengl version of the method is based on free code sent in by Philipp Dortmann, lots of thanks go to him!

Parameters
trianglesArray of 3d vectors, specifying the shadow volume.
zfailIf set to true, zfail method is used, otherwise zpass.
debugDataVisibleThe debug data that is enabled for this shadow node

◆ drawVertexPrimitiveList()

virtual void jpp::video::IVideoDriver::drawVertexPrimitiveList ( const void *  vertices,
u32  vertexCount,
const void *  indexList,
u32  primCount,
E_VERTEX_TYPE  vType = EVT_STANDARD,
scene::E_PRIMITIVE_TYPE  pType = scene::EPT_TRIANGLES,
E_INDEX_TYPE  iType = EIT_16BIT 
)
pure virtual

Draws a vertex primitive list.

Note that, depending on the index type, some vertices might be not accessible through the index list. The limit is at 65535 vertices for 16bit indices. Please note that currently not all primitives are available for all drivers, and some might be emulated via triangle renders.

Parameters
verticesPointer to array of vertices.
vertexCountAmount of vertices in the array.
indexListPointer to array of indices. These define the vertices used for each primitive. Depending on the pType, indices are interpreted as single objects (for point like primitives), pairs (for lines), triplets (for triangles), or quads.
primCountAmount of Primitives
vTypeVertex type, e.g. video::EVT_STANDARD for S3DVertex.
pTypePrimitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
iTypeIndex type, e.g. video::EIT_16BIT for 16bit indices.

◆ enableClipPlane()

virtual void jpp::video::IVideoDriver::enableClipPlane ( u32  index,
bool  enable 
)
pure virtual

Enable or disable a clipping plane.

There are at least 6 clipping planes available for the user to set at will.

Parameters
indexThe plane index. Must be between 0 and MaxUserClipPlanes.
enableIf true, enable the clipping plane else disable it.

◆ enableMaterial2D()

virtual void jpp::video::IVideoDriver::enableMaterial2D ( bool  enable = true)
pure virtual

Enable the 2d override material.

Parameters
enableFlag which tells whether the material shall be enabled or disabled.

◆ endScene()

virtual bool jpp::video::IVideoDriver::endScene ( )
pure virtual

Presents the rendered image to the screen.

Applications must call this method after performing any rendering.

Returns
False if failed and true if succeeded.

◆ fillMaterialStructureFromAttributes()

virtual void jpp::video::IVideoDriver::fillMaterialStructureFromAttributes ( video::SMaterial outMaterial,
io::IAttributes attributes 
)
pure virtual

Fills an SMaterial class 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.

Parameters
outMaterialThe material to set the properties for.
attributesThe attributes to read from.

◆ findTexture()

virtual video::ITexture * jpp::video::IVideoDriver::findTexture ( const io::path filename)
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.

Parameters
filenameName of the texture.
Returns
Pointer to loaded texture, or 0 if not found.

◆ getColorFormat()

virtual ECOLOR_FORMAT jpp::video::IVideoDriver::getColorFormat ( ) const
pure virtual

Get the current color format of the color buffer.

Returns
Color format of the color buffer.

◆ getCurrentRenderTargetSize()

virtual const core::dimension2d< u32 > & jpp::video::IVideoDriver::getCurrentRenderTargetSize ( ) const
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.

Returns
Size of render target or screen/window

◆ getDriverAttributes()

virtual const io::IAttributes & jpp::video::IVideoDriver::getDriverAttributes ( ) const
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 JPP_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 pipeline 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 Jimcpp. 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

◆ getDriverType()

virtual E_DRIVER_TYPE jpp::video::IVideoDriver::getDriverType ( ) const
pure virtual

Get type of video driver.

Returns
Type of driver.

◆ getDynamicLight()

virtual const SLight & jpp::video::IVideoDriver::getDynamicLight ( u32  idx) const
pure virtual

Returns light data which was previously set by IVideoDriver::addDynamicLight().

Parameters
idxZero based index of the light. Must be 0 or greater and smaller than IVideoDriver::getDynamicLightCount.
Returns
Light data.

◆ getDynamicLightCount()

virtual u32 jpp::video::IVideoDriver::getDynamicLightCount ( ) const
pure virtual

Returns amount of dynamic lights currently set.

Returns
Amount of dynamic lights currently set

◆ getExposedVideoData()

virtual const SExposedVideoData & jpp::video::IVideoDriver::getExposedVideoData ( )
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.

Returns
Collection of device dependent pointers.

◆ getFPS()

virtual s32 jpp::video::IVideoDriver::getFPS ( ) const
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.

Returns
Approximate amount of frames per second drawn.

◆ getGPUProgrammingServices()

virtual IGPUProgrammingServices * jpp::video::IVideoDriver::getGPUProgrammingServices ( )
pure virtual

Gets the IGPUProgrammingServices interface.

Returns
Pointer to the IGPUProgrammingServices. Returns 0 if the video driver does not support this. For example the Software driver and the Null driver will always return 0.

◆ getImageLoader()

virtual IImageLoader * jpp::video::IVideoDriver::getImageLoader ( u32  n)
pure virtual

Retrieve the given image loader.

Parameters
nThe index of the loader to retrieve. This parameter is an 0-based array index.
Returns
A pointer to the specified loader, 0 if the index is incorrect.

◆ getImageLoaderCount()

virtual u32 jpp::video::IVideoDriver::getImageLoaderCount ( ) const
pure virtual

Retrieve the number of image loaders.

Returns
Number of image loaders

◆ getImageWriter()

virtual IImageWriter * jpp::video::IVideoDriver::getImageWriter ( u32  n)
pure virtual

Retrieve the given image writer.

Parameters
nThe index of the writer to retrieve. This parameter is an 0-based array index.
Returns
A pointer to the specified writer, 0 if the index is incorrect.

◆ getImageWriterCount()

virtual u32 jpp::video::IVideoDriver::getImageWriterCount ( ) const
pure virtual

Retrieve the number of image writers.

Returns
Number of image writers

◆ getMaterial2D()

virtual SMaterial & jpp::video::IVideoDriver::getMaterial2D ( )
pure virtual

Get the 2d override material for altering its values.

The 2d override material allows to alter certain render states of the 2d methods. Not all members of SMaterial are honored, especially not MaterialType and Textures. Moreover, the zbuffer is always ignored, and lighting is always off. All other flags can be changed, though some might have to effect in most cases. Please note that you have to enable/disable this effect with enableMaterial2D(). This effect is costly, as it increases the number of state changes considerably. Always reset the values when done.

Returns
Material reference which should be altered to reflect the new settings.

◆ getMaterialRenderer()

virtual IMaterialRenderer * jpp::video::IVideoDriver::getMaterialRenderer ( u32  idx) const
pure virtual

Get access to a material renderer by index.

Parameters
idxId of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer().
Returns
Pointer to material renderer or null if not existing.

◆ getMaterialRendererCount()

virtual u32 jpp::video::IVideoDriver::getMaterialRendererCount ( ) const
pure virtual

Get amount of currently available material renderers.

Returns
Amount of currently available material renderers.

◆ getMaterialRendererName()

virtual const c8 * jpp::video::IVideoDriver::getMaterialRendererName ( u32  idx) const
pure virtual

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.

Parameters
idxId of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer().
Returns
String with the name of the renderer, or 0 if not exisiting

◆ getMaximalDynamicLightAmount()

virtual u32 jpp::video::IVideoDriver::getMaximalDynamicLightAmount ( ) const
pure virtual

Returns the maximal amount of dynamic lights the device can handle.

Returns
Maximal amount of dynamic lights.

◆ getMaximalPrimitiveCount()

virtual u32 jpp::video::IVideoDriver::getMaximalPrimitiveCount ( ) const
pure virtual

Returns the maximum amount of primitives.

(mostly vertices) which the device is able to render with one drawVertexPrimitiveList call.

Returns
Maximum amount of primitives.

◆ getName()

virtual const wchar_t * jpp::video::IVideoDriver::getName ( ) const
pure virtual

Gets name of this video driver.

Returns
Returns the name of the video driver, e.g. in case of the Direct3D8 driver, it would return "Direct3D 8.1".

◆ getOcclusionQueryResult()

virtual u32 jpp::video::IVideoDriver::getOcclusionQueryResult ( const scene::ISceneNode node) const
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.

◆ getOverrideMaterial()

virtual SOverrideMaterial & jpp::video::IVideoDriver::getOverrideMaterial ( )
pure virtual

Get the global Material, which might override local materials.

Depending on the enable flags, values from this Material are used to override those of local materials of some meshbuffer being rendered.

Returns
Reference to the Override Material.

◆ getPrimitiveCountDrawn()

virtual u32 jpp::video::IVideoDriver::getPrimitiveCountDrawn ( u32  mode = 0) const
pure virtual

Returns amount of primitives (mostly triangles) which were drawn in the last frame.

Together with getFPS() very useful method for statistics.

Parameters
modeDefines if the primitives drawn are accumulated or counted per frame.
Returns
Amount of primitives drawn in the last frame.

◆ getScreenSize()

virtual const core::dimension2d< u32 > & jpp::video::IVideoDriver::getScreenSize ( ) const
pure virtual

Get the size of the screen or render window.

Returns
Size of screen or render window.

◆ getTexture() [1/2]

virtual ITexture * jpp::video::IVideoDriver::getTexture ( const io::path filename)
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.

Parameters
filenameFilename of the texture to be loaded.
Returns
Pointer to the texture, or 0 if the texture could not be loaded. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getTexture() [2/2]

virtual ITexture * jpp::video::IVideoDriver::getTexture ( io::IReadFile file)
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.

Parameters
filePointer to an already opened file.
Returns
Pointer to the texture, or 0 if the texture could not be loaded. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getTextureByIndex()

virtual ITexture * jpp::video::IVideoDriver::getTextureByIndex ( u32  index)
pure virtual

Returns a texture by index.

Parameters
indexIndex of the texture, must be smaller than getTextureCount() Please note that this index might change when adding or removing textures
Returns
Pointer to the texture, or 0 if the texture was not set or index is out of bounds. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getTextureCount()

virtual u32 jpp::video::IVideoDriver::getTextureCount ( ) const
pure virtual

Returns amount of textures currently loaded.

Returns
Amount of textures currently loaded

◆ getTextureCreationFlag()

virtual bool jpp::video::IVideoDriver::getTextureCreationFlag ( E_TEXTURE_CREATION_FLAG  flag) const
pure virtual

Returns if a texture creation flag is enabled or disabled.

You can change this value using setTextureCreationFlag().

Parameters
flagTexture creation flag.
Returns
The current texture creation flag enabled mode.

◆ getTransform()

virtual const core::matrix4 & jpp::video::IVideoDriver::getTransform ( E_TRANSFORMATION_STATE  state) const
pure virtual

Returns the transformation set by setTransform.

Parameters
stateTransformation type to query
Returns
Matrix describing the transformation.

◆ getViewPort()

virtual const core::rect< s32 > & jpp::video::IVideoDriver::getViewPort ( ) const
pure virtual

Gets the area of the current viewport.

Returns
Rectangle of the current viewport.

◆ makeColorKeyTexture() [1/2]

virtual void jpp::video::IVideoDriver::makeColorKeyTexture ( video::ITexture texture,
core::position2d< s32 colorKeyPixelPos,
bool  zeroTexels = false 
) const
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.

Parameters
textureTexture whose alpha channel is modified.
colorKeyPixelPosPosition of a pixel with the color key color. Every texel with this color will become fully transparent as described above.
zeroTexels(deprecated) If set to true, then any texels that match the color key will have their color, as well as their alpha, set to zero (i.e. black). This behavior matches the legacy (buggy) behavior prior to release 1.5 and is provided for backwards compatibility only. This parameter may be removed by Jimcpp 1.9.

◆ makeColorKeyTexture() [2/2]

virtual void jpp::video::IVideoDriver::makeColorKeyTexture ( video::ITexture texture,
video::SColor  color,
bool  zeroTexels = false 
) const
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.

Parameters
textureTexture whose alpha channel is modified.
colorColor 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(deprecated) If set to true, then any texels that match the color key will have their color, as well as their alpha, set to zero (i.e. black). This behavior matches the legacy (buggy) behavior prior to release 1.5 and is provided for backwards compatibility only. This parameter may be removed by Jimcpp 1.9.

◆ makeNormalMapTexture()

virtual void jpp::video::IVideoDriver::makeNormalMapTexture ( video::ITexture texture,
f32  amplitude = 1.0f 
) const
pure virtual

Creates a normal map from a height map texture.

As input is considered to be a height map the texture is read like:

  • For a 32-bit texture only the red channel is regarded
  • For a 16-bit texture the rgb-values are averaged. Output channels red/green for X/Y and blue for up (Z). For a 32-bit texture we store additionally the height value in the alpha channel. This value is used by the video::EMT_PARALLAX_MAP_SOLID material and similar materials. On the borders the texture is considered to repeat.
    Parameters
    textureHeight map texture which is converted to a normal map.
    amplitudeConstant value by which the height information is multiplied.

◆ OnResize()

virtual void jpp::video::IVideoDriver::OnResize ( const core::dimension2d< u32 > &  size)
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.

◆ queryFeature()

virtual bool jpp::video::IVideoDriver::queryFeature ( E_VIDEO_DRIVER_FEATURE  feature) const
pure virtual

Queries the features of the driver.

Returns true if a feature is available

Parameters
featureFeature to query.
Returns
True if the feature is available, false if not.

◆ queryTextureFormat()

virtual bool jpp::video::IVideoDriver::queryTextureFormat ( ECOLOR_FORMAT  format) const
pure virtual

Check if the driver supports creating textures with the given color format.

Returns
True if the format is available, false if not.

◆ removeAllTextures()

virtual void jpp::video::IVideoDriver::removeAllTextures ( )
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.

◆ removeTexture()

virtual void jpp::video::IVideoDriver::removeTexture ( ITexture texture)
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.

Parameters
textureTexture to delete from the engine cache.

◆ renameTexture()

virtual void jpp::video::IVideoDriver::renameTexture ( ITexture texture,
const io::path newName 
)
pure virtual

Renames a texture.

Parameters
texturePointer to the texture to rename.
newNameNew name for the texture. This should be a unique name.

◆ runAllOcclusionQueries()

virtual void jpp::video::IVideoDriver::runAllOcclusionQueries ( bool  visible = false)
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.

◆ runOcclusionQuery()

virtual void jpp::video::IVideoDriver::runOcclusionQuery ( scene::ISceneNode node,
bool  visible = false 
)
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.

◆ setAllowZWriteOnTransparent()

virtual void jpp::video::IVideoDriver::setAllowZWriteOnTransparent ( bool  flag)
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.

Parameters
flagDefault behavior is to disable ZWrite, i.e. false.

◆ setAmbientLight()

virtual void jpp::video::IVideoDriver::setAmbientLight ( const SColorf color)
pure virtual

Only used by the engine internally.

The ambient color is set in the scene manager, see scene::ISceneManager::setAmbientLight().

Parameters
colorNew color of the ambient light.

◆ setClipPlane()

virtual bool jpp::video::IVideoDriver::setClipPlane ( u32  index,
const core::plane3df plane,
bool  enable = false 
)
pure virtual

Set or unset a clipping plane.

There are at least 6 clipping planes available for the user to set at will.

Parameters
indexThe plane index. Must be between 0 and MaxUserClipPlanes.
planeThe plane itself.
enableIf true, enable the clipping plane else disable it.
Returns
True if the clipping plane is usable.

◆ setFog()

virtual void jpp::video::IVideoDriver::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 
)
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.

Parameters
colorColor of the fog
fogTypeType of fog used
startOnly used in linear fog mode (linearFog=true). Specifies where fog starts.
endOnly used in linear fog mode (linearFog=true). Specifies where fog ends.
densityOnly used in exponential fog mode (linearFog=false). Must be a value between 0 and 1.
pixelFogSet this to false for vertex fog, and true if you want per-pixel fog.
rangeFogSet 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.

◆ setMaterial()

virtual void jpp::video::IVideoDriver::setMaterial ( const SMaterial material)
pure virtual

Sets a material.

All 3d drawing functions will draw geometry using this material thereafter.

Parameters
materialMaterial to be used from now on.

◆ setMaterialRendererName()

virtual void jpp::video::IVideoDriver::setMaterialRendererName ( u32  idx,
const c8 name 
)
pure virtual

Sets the name of a material renderer.

Will have no effect on built-in material renderers.

Parameters
idxId of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a value which was returned by addMaterialRenderer().
nameNew name of the material renderer.

◆ setMinHardwareBufferVertexCount()

virtual void jpp::video::IVideoDriver::setMinHardwareBufferVertexCount ( u32  count)
pure virtual

Set the minimum number of vertices for which a hw buffer will be created.

Parameters
countNumber of vertices to set as minimum.

◆ setRenderTarget() [1/2]

bool jpp::video::IVideoDriver::setRenderTarget ( ITexture texture,
bool  clearBackBuffer,
bool  clearZBuffer,
SColor  color = SColor(255,0,0,0) 
)
inline

Sets a new render target. Prefer to use the setRenderTarget function taking flags as parameter as this one can't clear the stencil buffer. It's still offered for backward compatibility.

◆ setRenderTarget() [2/2]

virtual bool jpp::video::IVideoDriver::setRenderTarget ( ITexture texture,
u16  clearFlag = ECBF_COLOR|ECBF_DEPTH,
SColor  clearColor = SColor(255, 0, 0, 0),
f32  clearDepth = 1.f,
u8  clearStencil = 0 
)
pure virtual

Sets a new render target.

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:

// create render target
ITexture* target = driver->addRenderTargetTexture(core::dimension2d<u32>(128,128), "rtt1");
// ...
driver->setRenderTarget(target); // set render target
// .. draw stuff here
driver->setRenderTarget(0); // set previous render target
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186

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.

Parameters
textureNew 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.
clearFlagA combination of the E_CLEAR_BUFFER_FLAG bit-flags.
clearColorThe clear color for the color buffer.
clearDepthThe clear value for the depth buffer.
clearStencilThe clear value for the stencil buffer.
Returns
True if successful and false if not.

◆ setRenderTargetEx()

virtual bool jpp::video::IVideoDriver::setRenderTargetEx ( IRenderTarget target,
u16  clearFlag,
SColor  clearColor = SColor(255, 0, 0, 0),
f32  clearDepth = 1.f,
u8  clearStencil = 0 
)
pure virtual

Set a render target.

This will only work if the driver supports the EVDF_RENDER_TO_TARGET feature, which can be queried with queryFeature(). 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. If you need the best performance use this method instead of setRenderTarget.

Parameters
targetRender target object.
clearFlagA combination of the E_CLEAR_BUFFER_FLAG bit-flags.
clearColorThe clear color for the color buffer.
clearDepthThe clear value for the depth buffer.
clearStencilThe clear value for the stencil buffer.
Returns
True if successful and false if not.

◆ setTextureCreationFlag()

virtual void jpp::video::IVideoDriver::setTextureCreationFlag ( E_TEXTURE_CREATION_FLAG  flag,
bool  enabled = true 
)
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.

Parameters
flagTexture creation flag.
enabledSpecifies if the given flag should be enabled or disabled.

◆ setTransform()

virtual void jpp::video::IVideoDriver::setTransform ( E_TRANSFORMATION_STATE  state,
const core::matrix4 mat 
)
pure virtual

Sets transformation matrices.

Parameters
stateTransformation type to be set, e.g. view, world, or projection.
matMatrix describing the transformation.

◆ setViewPort()

virtual void jpp::video::IVideoDriver::setViewPort ( const core::rect< s32 > &  area)
pure virtual

Sets a new viewport.

Every rendering operation is done into this new area.

Parameters
areaRectangle defining the new area of rendering operations.

◆ swapMaterialRenderers()

virtual void jpp::video::IVideoDriver::swapMaterialRenderers ( u32  idx1,
u32  idx2,
bool  swapNames = true 
)
pure virtual

Swap the material renderers used for certain id's.

Swap the IMaterialRenderers responsible for rendering specific material-id's. This means every SMaterial using a MaterialType with one of the indices involved here will now render differently.

Parameters
idx1First material index to swap. It must already exist or nothing happens.
idx2Second material index to swap. It must already exist or nothing happens.
swapNamesWhen true the renderer names also swap When false the names will stay at the original index

◆ turnLightOn()

virtual void jpp::video::IVideoDriver::turnLightOn ( s32  lightIndex,
bool  turnOn 
)
pure virtual

Turns a dynamic light on or off

Parameters
lightIndexthe index returned by addDynamicLight
turnOntrue to turn the light on, false to turn it off

◆ updateAllOcclusionQueries()

virtual void jpp::video::IVideoDriver::updateAllOcclusionQueries ( bool  block = true)
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

◆ updateOcclusionQuery()

virtual void jpp::video::IVideoDriver::updateOcclusionQuery ( scene::ISceneNode node,
bool  block = true 
)
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

◆ writeImageToFile() [1/2]

virtual bool jpp::video::IVideoDriver::writeImageToFile ( IImage image,
const io::path filename,
u32  param = 0 
)
pure virtual

Writes the provided image to a file.

Requires that there is a suitable image writer registered for writing the image.

Parameters
imageImage to write.
filenameName of the file to write.
paramControl parameter for the backend (e.g. compression level).
Returns
True on successful write.

◆ writeImageToFile() [2/2]

virtual bool jpp::video::IVideoDriver::writeImageToFile ( IImage image,
io::IWriteFile file,
u32  param = 0 
)
pure virtual

Writes the provided image to a file.

Requires that there is a suitable image writer registered for writing the image.

Parameters
imageImage to write.
fileAn already open io::IWriteFile object. The name will be used to determine the appropriate image writer to use.
paramControl parameter for the backend (e.g. compression level).
Returns
True on successful write.

The documentation for this class was generated from the following file:

Jimcpp    @cppfx.xyz

K