5#ifndef DCPP_I_VIDEO_DRIVER_HPP_INCLUDED
6#define DCPP_I_VIDEO_DRIVER_HPP_INCLUDED
8#include <duckcpp/core/engine/rect.hpp>
9#include <duckcpp/core/engine/SColor.hpp>
10#include <duckcpp/core/engine/ITexture.hpp>
11#include <duckcpp/core/engine/irrArray.hpp>
12#include <duckcpp/core/engine/matrix4.hpp>
13#include <duckcpp/core/engine/plane3d.hpp>
14#include <duckcpp/core/engine/dimension2d.hpp>
15#include <duckcpp/core/engine/position2d.hpp>
16#include <duckcpp/core/engine/IMeshBuffer.hpp>
17#include <duckcpp/core/engine/triangle3d.hpp>
18#include <duckcpp/core/engine/EDriverTypes.hpp>
19#include <duckcpp/core/engine/EDriverFeatures.hpp>
20#include <duckcpp/core/engine/SExposedVideoData.hpp>
21#include <duckcpp/core/engine/SOverrideMaterial.hpp>
28 class SAttributeReadWriteOptions;
36 class IMeshManipulator;
43 class S3DVertex2TCoords;
44 class S3DVertexTangents;
48 class IMaterialRenderer;
49 class IGPUProgrammingServices;
69#if _DCPP_MATERIAL_MAX_TEXTURES_>4
72#if _DCPP_MATERIAL_MAX_TEXTURES_>5
75#if _DCPP_MATERIAL_MAX_TEXTURES_>6
78#if _DCPP_MATERIAL_MAX_TEXTURES_>7
124 ECBF_ALL = ECBF_COLOR|ECBF_DEPTH|ECBF_STENCIL
188 dcpp::video::ECBF_COLOR | dcpp::video::ECBF_DEPTH,
230 clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect
556 bool zeroTexels =
false)
const =0;
573 bool zeroTexels =
false)
const =0;
684 E_INDEX_TYPE iType=EIT_16BIT) =0;
710 E_INDEX_TYPE iType=EIT_16BIT) =0;
879 SColor color=
SColor(255,255,255,255),
bool useAlphaChannelOfTexture=
false) =0;
908 bool useAlphaChannelOfTexture=
false) =0;
931 bool useAlphaChannelOfTexture=
false) =0;
1097 bool pixelFog=
false,
bool rangeFog=
false) =0;
1102 bool& pixelFog,
bool& rangeFog) = 0;
1244 imageArray[i]->
drop();
1246 return (imageArray.size() > 0) ? imageArray[0] : 0;
1262 imageArray[i]->
drop();
1264 return (imageArray.size() > 0) ? imageArray[0] : 0;
1308 bool deleteMemory =
true) = 0;
1477 flag |= ECBF_STENCIL;
Base class of most objects of the Duckcpp Engine.
Definition IReferenceCounted.hpp:46
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.hpp:126
Provides a generic interface for attributes and their values and the possibility to serialize them.
Definition IAttributes.hpp:42
Interface providing read access to a file.
Definition IReadFile.hpp:19
Interface providing write access to a file.
Definition IWriteFile.hpp:18
class holding data describing options
Definition IAttributeExchangingObject.hpp:35
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Template plane class with some intersection testing methods.
Definition plane3d.hpp:34
Rectangle template.
Definition rect.hpp:27
3d vector template class with lots of operators and methods.
Definition vector3d.hpp:32
Class for holding a mesh with a single material.
Definition IMeshBuffer.hpp:41
An interface for easy manipulation of meshes.
Definition IMeshManipulator.hpp:30
Class which holds the geometry of an object.
Definition IMesh.hpp:72
Scene node interface.
Definition ISceneNode.hpp:43
Interface making it possible to create and use programs running on the GPU.
Definition IGPUProgrammingServices.hpp:29
Class which is able to create a image from a file.
Definition IImageLoader.hpp:29
Interface for writing software image data.
Definition IImageWriter.hpp:26
Interface for software image data.
Definition IImage.hpp:26
void setMipMapsData(void *data, bool ownForeignMemory, bool deleteMemory)
Set mipmaps data.
Definition IImage.hpp:277
Interface for material rendering.
Definition IMaterialRenderer.hpp:26
Interface of a Render Target.
Definition IRenderTarget.hpp:31
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.hpp:152
virtual void drawMeshBuffer(const dcpp::scene::IMeshBuffer *mb)=0
Draws a mesh buffer.
virtual dcpp::uint32_kt getImageWriterCount() const =0
Retrieve the number of image writers.
virtual void draw2DRectangle(SColor color, const dcpp::nub::recti &pos, const dcpp::nub::recti *clip=0)=0
Draws a 2d rectangle.
virtual IImage * createImage(ECOLOR_FORMAT format, const dcpp::nub::dimension2du &size)=0
Creates an empty software image.
void drawIndexedTriangleList(const S3DVertex2TCoords *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:736
DCPP_DEPRECATED void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
Clear the color, depth and/or stencil buffers.
Definition IVideoDriver.hpp:1466
virtual void removeHardwareBuffer(const dcpp::scene::IMeshBuffer *mb)=0
Remove hardware buffer.
virtual void draw2DImage(const dcpp::video::ITexture *texture, const dcpp::nub::position2di &destPos, const dcpp::nub::recti &sourceRect, const dcpp::nub::recti *clipRect=0, SColor color=SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture=false)=0
Draws a 2d image using a color.
DCPP_DEPRECATED ITexture * addTexture(const dcpp::io::path &name, IImage *image, void *mipmapData)
Creates a texture from an IImage.
Definition IVideoDriver.hpp:396
virtual void setFog(SColor color=SColor(0, 255, 255, 255), E_FOG_TYPE fogType=EFT_FOG_LINEAR, dcpp::float32_kt start=50.0f, dcpp::float32_kt end=100.0f, dcpp::float32_kt density=0.01f, bool pixelFog=false, bool rangeFog=false)=0
Sets the fog mode.
virtual void removeOcclusionQuery(dcpp::scene::ISceneNode *node)=0
Remove occlusion query.
virtual ECOLOR_FORMAT getColorFormat() const =0
Get the current color format of the color buffer.
virtual void runAllOcclusionQueries(bool visible=false)=0
Run all occlusion queries. Draws all meshes stored in queries.
virtual void addOcclusionQuery(dcpp::scene::ISceneNode *node, const dcpp::scene::IMesh *mesh=0)=0
Create occlusion query.
virtual void updateOcclusionQuery(dcpp::scene::ISceneNode *node, bool block=true)=0
Update occlusion query. Retrieves results from GPU.
virtual void setTransform(E_TRANSFORMATION_STATE state, const dcpp::nub::matrix4 &mat)=0
Sets transformation matrices.
virtual E_DRIVER_TYPE getDriverType() const =0
Get type of video driver.
virtual IMaterialRenderer * getMaterialRenderer(dcpp::uint32_kt idx) const =0
Get access to a material renderer by index.
virtual bool beginScene(dcpp::uint16_kt clearFlag, dcpp::video::SColor clearColor, dcpp::float32_kt clearDepth=1.0f, dcpp::uint8_kt clearStencil=0, const dcpp::video::SExposedVideoData &videoData=dcpp::video::SExposedVideoData{}, dcpp::nub::recti *sourceRect=nullptr)=0
Applications must call this method before performing any rendering.
virtual void drawVertexPrimitiveList(const void *vertices, dcpp::uint32_kt vertexCount, const void *indexList, dcpp::uint32_kt primCount, E_VERTEX_TYPE vType=EVT_STANDARD, dcpp::scene::E_PRIMITIVE_TYPE pType=dcpp::scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)=0
Draws a vertex primitive list.
virtual dcpp::uint32_kt getMaximalDynamicLightAmount() const =0
Returns the maximal amount of dynamic lights the device can handle.
virtual const dcpp::nub::dimension2du & getScreenSize() const =0
Get the size of the screen or render window.
virtual void enableClipPlane(dcpp::uint32_kt index, bool enable)=0
Enable or disable a clipping plane.
virtual dcpp::nub::array< IImage * > createImagesFromFile(const dcpp::io::path &filename, E_TEXTURE_TYPE *type=0)=0
Creates a software images from a file.
void drawIndexedTriangleFan(const S3DVertexTangents *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:796
void clearZBuffer()
Clears the ZBuffer.
Definition IVideoDriver.hpp:1489
virtual void clearBuffers(dcpp::uint16_kt flag, SColor color=SColor(255, 0, 0, 0), dcpp::float32_kt depth=1.f, dcpp::uint8_kt stencil=0)=0
Clear the color, depth and/or stencil buffers.
virtual void runOcclusionQuery(dcpp::scene::ISceneNode *node, bool visible=false)=0
Run occlusion query. Draws mesh stored in query.
virtual IImage * createImage(ITexture *texture, const dcpp::nub::position2di &pos, const dcpp::nub::dimension2du &size)=0
Creates a software image from a part of a texture.
virtual void draw3DBox(const dcpp::nub::aabbox3df &box, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d axis aligned box.
virtual IRenderTarget * addRenderTarget()=0
Create render target.
virtual dcpp::uint32_kt getMaximalPrimitiveCount() const =0
Returns the maximum amount of primitives.
virtual ITexture * getTexture(dcpp::io::IReadFile *file)=0
Get access to a named texture.
virtual void updateAllOcclusionQueries(bool block=true)=0
Update all occlusion queries. Retrieves results from GPU.
virtual void removeAllOcclusionQueries()=0
Remove all occlusion queries.
virtual void draw2DVertexPrimitiveList(const void *vertices, dcpp::uint32_kt vertexCount, const void *indexList, dcpp::uint32_kt primCount, E_VERTEX_TYPE vType=EVT_STANDARD, dcpp::scene::E_PRIMITIVE_TYPE pType=dcpp::scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)=0
Draws a vertex primitive list in 2d.
virtual void draw2DImageBatch(const dcpp::video::ITexture *texture, const dcpp::nub::position2di &pos, const dcpp::nub::array< dcpp::nub::recti > &sourceRects, const dcpp::nub::array< dcpp::int32_kt > &indices, dcpp::int32_kt kerningWidth=0, const dcpp::nub::recti *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 makeNormalMapTexture(dcpp::video::ITexture *texture, dcpp::float32_kt amplitude=1.0f) const =0
Creates a normal map from a height map texture.
virtual dcpp::video::ITexture * findTexture(const dcpp::io::path &filename)=0
Check if the image is already loaded.
virtual void makeColorKeyTexture(dcpp::video::ITexture *texture, dcpp::video::SColor color, bool zeroTexels=false) const =0
Sets a boolean alpha channel on the texture based on a color key.
void drawIndexedTriangleList(const S3DVertex *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:721
virtual bool queryTextureFormat(ECOLOR_FORMAT format) const =0
Check if the driver supports creating textures with the given color format.
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0
Returns if a texture creation flag is enabled or disabled.
virtual dcpp::nub::string getVendorInfo()=0
Get the graphics card vendor name.
bool beginScene(dcpp::video::SColor color=dcpp::video::SColor{255, 0, 0, 0}, const dcpp::video::SExposedVideoData &videoData=dcpp::video::SExposedVideoData{}, dcpp::nub::recti *sourceRect=nullptr)
Alternative beginScene implementation.
Definition IVideoDriver.hpp:181
virtual SOverrideMaterial & getOverrideMaterial()=0
Get the global Material, which might override local materials.
virtual dcpp::io::IAttributes * createAttributesFromMaterial(const dcpp::video::SMaterial &material, dcpp::io::SAttributeReadWriteOptions *options=0)=0
Creates material attributes list from a material.
virtual void draw2DImage(const dcpp::video::ITexture *texture, const dcpp::nub::position2di &destPos, bool useAlphaChannelOfTexture=false)=0
Draws a 2d image without any special effects.
virtual void removeRenderTarget(IRenderTarget *renderTarget)=0
Remove render target.
virtual const SLight & getDynamicLight(dcpp::uint32_kt idx) const =0
Returns light data which was previously set by IVideoDriver::addDynamicLight().
void drawIndexedTriangleFan(const S3DVertex2TCoords *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:781
virtual IImageWriter * getImageWriter(dcpp::uint32_kt n)=0
Retrieve the given image writer.
virtual DCPP_DEPRECATED IImage * createImage(IImage *imageToCopy, const dcpp::nub::position2di &pos, const dcpp::nub::dimension2du &size)=0
Creates a software image from a part of another image.
virtual bool setClipPlane(dcpp::uint32_kt index, const dcpp::nub::plane3df &plane, bool enable=false)=0
Set or unset a clipping plane.
virtual void draw2DRectangle(const dcpp::nub::recti &pos, SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, const dcpp::nub::recti *clip=0)=0
Draws a 2d rectangle with a gradient.
virtual void getFog(SColor &color, E_FOG_TYPE &fogType, dcpp::float32_kt &start, dcpp::float32_kt &end, dcpp::float32_kt &density, bool &pixelFog, bool &rangeFog)=0
Gets the fog mode.
virtual dcpp::uint32_kt getDynamicLightCount() const =0
Returns amount of dynamic lights currently set.
virtual bool writeImageToFile(IImage *image, const dcpp::io::path &filename, dcpp::uint32_kt param=0)=0
Writes the provided image to a file.
virtual void setAmbientLight(const SColorf &color)=0
Only used by the engine internally.
virtual ITexture * addTexture(const dcpp::io::path &name, IImage *image)=0
Creates a texture from an IImage.
virtual void draw2DRectangleOutline(const dcpp::nub::recti &pos, SColor color=SColor(255, 255, 255, 255))=0
Draws the outline of a 2D rectangle.
virtual SMaterial & getMaterial2D()=0
Get the 2d override material for altering its values.
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true)=0
Enables or disables a texture creation flag.
virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true)=0
Disable a feature of the driver.
virtual void drawMeshBufferNormals(const dcpp::scene::IMeshBuffer *mb, dcpp::float32_kt length=10.f, SColor color=0xffffffff)=0
Draws normals of a mesh buffer.
virtual ITexture * addTexture(const dcpp::nub::dimension2du &size, const dcpp::io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
Creates an empty texture of specified size.
virtual void setMaterial(const SMaterial &material)=0
Sets a material.
virtual void draw2DLine(const dcpp::nub::position2di &start, const dcpp::nub::position2di &end, SColor color=SColor(255, 255, 255, 255))=0
Draws a 2d line.
virtual dcpp::int32_kt addMaterialRenderer(IMaterialRenderer *renderer, const dcpp::char_kt *name=0)=0
Adds a new material renderer to the video device.
virtual bool needsTransparentRenderPass(const dcpp::video::SMaterial &material) const =0
Used by some SceneNodes to check if a material should be rendered in the transparent render pass.
virtual ITexture * addRenderTargetTexture(const dcpp::nub::dimension2du &size, const dcpp::io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0
Adds a new render target texture to the texture cache.
virtual void removeAllTextures()=0
Removes all textures from the texture cache and deletes them.
virtual dcpp::nub::dimension2du getMaxTextureSize() const =0
Get the maximum texture size supported.
virtual void setMinHardwareBufferVertexCount(dcpp::uint32_kt count)=0
Set the minimum number of vertices for which a hw buffer will be created.
virtual const dcpp::char_kt * getMaterialRendererName(dcpp::uint32_kt idx) const =0
Get name of a material renderer.
virtual bool setRenderTarget(ITexture *texture, dcpp::uint16_kt clearFlag=ECBF_COLOR|ECBF_DEPTH, SColor clearColor=SColor(255, 0, 0, 0), dcpp::float32_kt clearDepth=1.f, dcpp::uint8_kt clearStencil=0)=0
Sets a new render target.
virtual void setViewPort(const dcpp::nub::recti &area)=0
Sets a new viewport.
virtual void drawStencilShadowVolume(const dcpp::nub::array< dcpp::nub::vector3df > &triangles, bool zfail=true, dcpp::uint32_kt debugDataVisible=0)=0
Draws a shadow volume into the stencil buffer.
virtual DCPP_DEPRECATED IImage * createImage(ECOLOR_FORMAT format, IImage *imageToCopy)=0
Creates a software image by converting it to given format from another image.
virtual bool writeImageToFile(IImage *image, dcpp::io::IWriteFile *file, dcpp::uint32_kt param=0)=0
Writes the provided image to a file.
virtual void setMaterialRendererName(dcpp::uint32_kt idx, const dcpp::char_kt *name)=0
Sets the name of a material renderer.
virtual bool endScene()=0
Presents the rendered image to the screen.
virtual void renameTexture(ITexture *texture, const dcpp::io::path &newName)=0
Renames a texture.
virtual void draw2DPolygon(dcpp::nub::position2di center, dcpp::float32_kt radius, dcpp::video::SColor color=SColor(100, 255, 255, 255), dcpp::int32_kt vertexCount=10)=0
Draws a non filled concyclic regular 2d polygon.
virtual void turnLightOn(dcpp::int32_kt lightIndex, bool turnOn)=0
virtual void convertColor(const void *sP, ECOLOR_FORMAT sF, dcpp::int32_kt sN, void *dP, ECOLOR_FORMAT dF) const =0
Color conversion convenience function.
virtual void draw2DImage(const dcpp::video::ITexture *texture, const dcpp::nub::recti &destRect, const dcpp::nub::recti &sourceRect, const dcpp::nub::recti *clipRect=0, const dcpp::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 const dcpp::nub::recti & getViewPort() const =0
Gets the area of the current viewport.
IImage * createImageFromFile(const dcpp::io::path &filename)
Creates a software image from a file.
Definition IVideoDriver.hpp:1239
virtual void drawStencilShadow(bool clearStencilBuffer=false, dcpp::video::SColor leftUpEdge=dcpp::video::SColor(255, 0, 0, 0), dcpp::video::SColor rightUpEdge=dcpp::video::SColor(255, 0, 0, 0), dcpp::video::SColor leftDownEdge=dcpp::video::SColor(255, 0, 0, 0), dcpp::video::SColor rightDownEdge=dcpp::video::SColor(255, 0, 0, 0))=0
Fills the stencil shadow with color.
virtual const wchar_t * getName() const =0
Gets name of this video driver.
virtual dcpp::uint32_kt getPrimitiveCountDrawn(dcpp::uint32_kt mode=0) const =0
Returns amount of primitives (mostly triangles) which were drawn in the last frame.
virtual IImage * createScreenShot(dcpp::video::ECOLOR_FORMAT format=dcpp::video::ECF_UNKNOWN, dcpp::video::E_RENDER_TARGET target=dcpp::video::ERT_FRAME_BUFFER)=0
Make a screenshot of the last rendered frame.
bool swapScenes(dcpp::video::SColor color=dcpp::video::SColor{255, 0, 0, 0}, const dcpp::video::SExposedVideoData &videoData=dcpp::video::SExposedVideoData{}, dcpp::nub::recti *sourceRect=nullptr)
Alternative swapScenes(...) method.
Definition IVideoDriver.hpp:240
virtual dcpp::scene::IMeshManipulator * getMeshManipulator()=0
Returns a pointer to the mesh manipulator.
virtual void removeAllRenderTargets()=0
Remove all render targets.
virtual void swapMaterialRenderers(dcpp::uint32_kt idx1, dcpp::uint32_kt idx2, bool swapNames=true)=0
Swap the material renderers used for certain id's.
virtual IImage * createImageFromData(ECOLOR_FORMAT format, const dcpp::nub::dimension2du &size, void *data, bool ownForeignMemory=false, bool deleteMemory=true)=0
Creates a software image from a byte array.
virtual void setAllowZWriteOnTransparent(bool flag)=0
Only used by the engine internally.
virtual dcpp::uint32_kt getTextureCount() const =0
Returns amount of textures currently loaded.
virtual void drawPixel(dcpp::uint32_kt x, dcpp::uint32_kt y, const SColor &color)=0
Draws a pixel.
virtual ITexture * addTextureCubemap(const dcpp::io::path &name, IImage *imagePosX, IImage *imageNegX, IImage *imagePosY, IImage *imageNegY, IImage *imagePosZ, IImage *imageNegZ)=0
Creates a cubemap texture from loaded IImages.
virtual void addExternalImageLoader(IImageLoader *loader)=0
Adds an external image loader to the engine.
virtual dcpp::uint32_kt getImageLoaderCount() const =0
Retrieve the number of image loaders.
virtual ITexture * getTexture(const dcpp::io::path &filename)=0
Get access to a named texture.
virtual dcpp::int32_kt addDynamicLight(const SLight &light)=0
virtual IImageLoader * getImageLoader(dcpp::uint32_kt n)=0
Retrieve the given image loader.
virtual void draw3DLine(const dcpp::nub::vector3df &start, const dcpp::nub::vector3df &end, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d line.
virtual ITexture * getTextureByIndex(dcpp::uint32_kt index)=0
Returns a texture by index.
virtual bool checkDriverReset()=0
Check if the driver was recently reset.
virtual const dcpp::nub::dimension2du & getCurrentRenderTargetSize() const =0
Get the size of the current render target.
virtual ITexture * addTextureCubemap(const dcpp::uint32_kt sideLen, const dcpp::io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
Creates an empty cubemap texture of specified size.
virtual const dcpp::io::IAttributes & getDriverAttributes() const =0
Get attributes of the actual video driver.
virtual void fillMaterialStructureFromAttributes(dcpp::video::SMaterial &outMaterial, dcpp::io::IAttributes *attributes)=0
Fills an SMaterial class from attributes.
virtual dcpp::uint32_kt getOcclusionQueryResult(const dcpp::scene::ISceneNode *node) const =0
Return query result.
void drawIndexedTriangleList(const S3DVertexTangents *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:751
virtual void removeAllHardwareBuffers()=0
Remove all hardware buffers.
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0
Queries the features of the driver.
virtual void draw3DTriangle(const dcpp::nub::triangle3df &triangle, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d triangle.
bool setRenderTarget(ITexture *texture, bool clearBackBuffer, bool clearZBuffer, SColor color=SColor(255, 0, 0, 0))
Definition IVideoDriver.hpp:642
void drawIndexedTriangleFan(const S3DVertex *vertices, dcpp::uint32_kt vertexCount, const dcpp::uint16_kt *indexList, dcpp::uint32_kt triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:766
virtual ITexture * addRenderTargetTextureCubemap(const dcpp::uint32_kt sideLen, const dcpp::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 OnResize(const dcpp::nub::dimension2du &size)=0
Event handler for resize events. Only used by the engine internally.
virtual const dcpp::nub::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
virtual void deleteAllDynamicLights()=0
Deletes all dynamic lights which were previously added with addDynamicLight().
virtual dcpp::uint32_kt getMaterialRendererCount() const =0
Get amount of currently available material renderers.
virtual dcpp::int32_kt getFPS() const =0
Returns current frames per second value.
virtual IGPUProgrammingServices * getGPUProgrammingServices()=0
Gets the IGPUProgrammingServices interface.
virtual dcpp::nub::array< IImage * > createImagesFromFile(dcpp::io::IReadFile *file, E_TEXTURE_TYPE *type=0)=0
Creates a software images from a file.
virtual const SExposedVideoData & getExposedVideoData()=0
Returns driver and operating system specific data about the IVideoDriver.
virtual void makeColorKeyTexture(dcpp::video::ITexture *texture, dcpp::nub::position2di colorKeyPixelPos, bool zeroTexels=false) const =0
Sets a boolean alpha channel on the texture based on the color at a position.
virtual void removeTexture(ITexture *texture)=0
Removes a texture from the texture cache and deletes it.
virtual void draw2DImageBatch(const dcpp::video::ITexture *texture, const dcpp::nub::array< dcpp::nub::position2di > &positions, const dcpp::nub::array< dcpp::nub::recti > &sourceRects, const dcpp::nub::recti *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 addExternalImageWriter(IImageWriter *writer)=0
Adds an external image writer to the engine.
bool swapScenes(dcpp::uint16_kt clearFlag, dcpp::video::SColor clearColor, dcpp::float32_kt clearDepth=1.0f, dcpp::uint8_kt clearStencil=0, const dcpp::video::SExposedVideoData &videoData=dcpp::video::SExposedVideoData{}, dcpp::nub::recti *sourceRect=nullptr)
Presents the current rendered image to the screen and start for next rendering.
Definition IVideoDriver.hpp:217
virtual void enableMaterial2D(bool enable=true)=0
Enable the 2d override material.
IImage * createImageFromFile(dcpp::io::IReadFile *file)
Creates a software image from a file.
Definition IVideoDriver.hpp:1257
virtual bool setRenderTargetEx(IRenderTarget *target, dcpp::uint16_kt clearFlag, SColor clearColor=SColor(255, 0, 0, 0), dcpp::float32_kt clearDepth=1.f, dcpp::uint8_kt clearStencil=0)=0
Set a render target.
Vertex with two texture coordinates.
Definition S3DVertex.hpp:116
Vertex with a tangent and binormal vector.
Definition S3DVertex.hpp:199
standard vertex used by the Duckcpp engine.
Definition S3DVertex.hpp:45
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
Class representing a color with four floats.
Definition SColor.hpp:574
class for holding data describing a driver and operating system specific data.
Definition SExposedVideoData.hpp:26
class for holding data describing a dynamic point light.
Definition SLight.hpp:43
Class for holding parameters for a material renderer.
Definition SMaterial.hpp:304
Definition SOverrideMaterial.hpp:16
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
Definition EPrimitiveTypes.hpp:15
@ EPT_TRIANGLE_FAN
Definition EPrimitiveTypes.hpp:34
@ EPT_TRIANGLES
Explicitly set all vertices for each triangle.
Definition EPrimitiveTypes.hpp:37
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.hpp:19
@ EVT_2TCOORDS
Vertex with two texture coordinates, dcpp::video::S3DVertex2TCoords.
Definition S3DVertex.hpp:25
@ EVT_TANGENTS
Vertex with a tangent and binormal vector, dcpp::video::S3DVertexTangents.
Definition S3DVertex.hpp:31
@ EVT_STANDARD
Standard vertex type used by the Duckcpp engine, dcpp::video::S3DVertex.
Definition S3DVertex.hpp:21
E_DRIVER_TYPE
An enum for all types of drivers the Duckcpp Engine supports.
Definition EDriverTypes.hpp:17
E_VIDEO_DRIVER_FEATURE
enumeration for querying features of the video driver.
Definition EDriverFeatures.hpp:15
E_RENDER_TARGET
Special render targets, which usually map to dedicated hardware.
Definition IVideoDriver.hpp:92
@ ERT_AUX_BUFFER1
Auxiliary buffer 1.
Definition IVideoDriver.hpp:108
@ ERT_AUX_BUFFER4
Auxiliary buffer 4.
Definition IVideoDriver.hpp:114
@ ERT_AUX_BUFFER2
Auxiliary buffer 2.
Definition IVideoDriver.hpp:110
@ ERT_FRAME_BUFFER
Render target is the main color frame buffer.
Definition IVideoDriver.hpp:94
@ ERT_RENDER_TEXTURE
Render target is a render texture.
Definition IVideoDriver.hpp:96
@ ERT_AUX_BUFFER0
Auxiliary buffer 0.
Definition IVideoDriver.hpp:106
@ ERT_MULTI_RENDER_TEXTURES
Multi-Render target textures.
Definition IVideoDriver.hpp:98
@ ERT_STEREO_LEFT_BUFFER
Render target is the main color frame buffer.
Definition IVideoDriver.hpp:100
@ ERT_STEREO_BOTH_BUFFERS
Render to both stereo buffers at once.
Definition IVideoDriver.hpp:104
@ ERT_STEREO_RIGHT_BUFFER
Render target is the right color buffer (left is the main buffer)
Definition IVideoDriver.hpp:102
@ ERT_AUX_BUFFER3
Auxiliary buffer 3.
Definition IVideoDriver.hpp:112
ECOLOR_FORMAT
An enum for the color format of textures used by the Duckcpp Engine.
Definition SColor.hpp:21
@ ECF_UNKNOWN
Unknown color format:
Definition SColor.hpp:132
@ ECF_A8R8G8B8
Definition SColor.hpp:38
E_TEXTURE_TYPE
Enumeration describing the type of ITexture.
Definition ITexture.hpp:168
E_FOG_TYPE
Enum for the types of fog distributions to choose from.
Definition IVideoDriver.hpp:129
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
Definition IVideoDriver.hpp:54
@ ETS_TEXTURE_2
Texture transformation.
Definition IVideoDriver.hpp:66
@ ETS_TEXTURE_1
Texture transformation.
Definition IVideoDriver.hpp:64
@ ETS_TEXTURE_3
Texture transformation.
Definition IVideoDriver.hpp:68
@ ETS_PROJECTION
Projection transformation.
Definition IVideoDriver.hpp:60
@ ETS_VIEW
View transformation.
Definition IVideoDriver.hpp:56
@ ETS_WORLD
World transformation.
Definition IVideoDriver.hpp:58
@ ETS_TEXTURE_0
Texture transformation.
Definition IVideoDriver.hpp:62
@ ETS_COUNT
Only used internally.
Definition IVideoDriver.hpp:86
E_TEXTURE_CREATION_FLAG
Enumeration flags used to tell the video driver with setTextureCreationFlag in which format textures ...
Definition ITexture.hpp:23
E_CLEAR_BUFFER_FLAG
Enum for the flags of clear buffer.
Definition IVideoDriver.hpp:119
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition shared_device.hpp:34
char char_kt
8 bit character variable.
Definition irrTypes.hpp:37
unsigned char uint8_kt
8 bit unsigned variable.
Definition irrTypes.hpp:24
unsigned int uint32_kt
32 bit unsigned variable.
Definition irrTypes.hpp:64
float float32_kt
32 bit floating point variable.
Definition irrTypes.hpp:108
unsigned short uint16_kt
16 bit unsigned variable.
Definition irrTypes.hpp:46
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72