5 #ifndef __IRR_I_VIDEO_DRIVER_H_INCLUDED__ 6 #define __IRR_I_VIDEO_DRIVER_H_INCLUDED__ 28 struct SAttributeReadWriteOptions;
36 class IMeshManipulator;
43 struct S3DVertex2TCoords;
44 struct S3DVertexTangents;
48 class IMaterialRenderer;
49 class IGPUProgrammingServices;
69 #if _IRR_MATERIAL_MAX_TEXTURES_>4 72 #if _IRR_MATERIAL_MAX_TEXTURES_>5 75 #if _IRR_MATERIAL_MAX_TEXTURES_>6 78 #if _IRR_MATERIAL_MAX_TEXTURES_>7 336 image->setMipMapsData(mipmapData,
false,
true);
491 bool zeroTexels =
false)
const =0;
507 core::position2d<s32> colorKeyPixelPos,
508 bool zeroTexels =
false)
const =0;
540 f32 clearDepth = 1.
f,
u8 clearStencil = 0) = 0;
572 f32 clearDepth = 1.
f,
u8 clearStencil = 0) = 0;
616 const void* indexList,
u32 primCount,
642 const void* indexList,
u32 primCount,
657 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
672 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
687 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
702 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
717 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
732 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
794 const core::position2d<s32>& destPos,
bool useAlphaChannelOfTexture=
false) =0;
837 const core::position2d<s32>& pos,
843 bool useAlphaChannelOfTexture=
false) =0;
862 const core::array<core::position2d<s32> >& positions,
866 bool useAlphaChannelOfTexture=
false) =0;
880 const video::SColor *
const colors=0,
bool useAlphaChannelOfTexture=
false) =0;
932 const core::position2d<s32>&
end,
957 s32 vertexCount=10) =0;
1032 bool pixelFog=
false,
bool rangeFog=
false) =0;
1037 bool& pixelFog,
bool& rangeFog) = 0;
1099 virtual const wchar_t*
getName()
const =0;
1178 for (
u32 i = 1; i < imageArray.
size(); ++i)
1179 imageArray[i]->
drop();
1181 return (imageArray.
size() > 0) ? imageArray[0] : 0;
1196 for (
u32 i = 1; i < imageArray.
size(); ++i)
1197 imageArray[i]->
drop();
1199 return (imageArray.
size() > 0) ? imageArray[0] : 0;
1243 bool deleteMemory =
true) = 0;
1272 const core::position2d<s32>& pos,
1284 const core::position2d<s32>& pos,
1582 #if defined(__WIN32__) E_RENDER_TARGET
Special render targets, which usually map to dedicated hardware.
virtual void addExternalImageWriter(IImageWriter *writer)=0
Adds an external image writer to the engine.
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 addOcclusionQuery(scene::ISceneNode *node, const scene::IMesh *mesh=0)=0
Create occlusion query.
virtual io::IAttributes * createAttributesFromMaterial(const video::SMaterial &material, io::SAttributeReadWriteOptions *options=0)=0
Creates material attributes list from a material.
bool drop() const
Drops the object. Decrements the reference counter by one.
dimension2d< u32 > dimension2du
Typedef for an unsigned integer dimension.
virtual void addExternalImageLoader(IImageLoader *loader)=0
Adds an external image loader to the engine.
virtual void setViewPort(const core::rect< s32 > &area)=0
Sets a new 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 renameTexture(ITexture *texture, const io::path &newName)=0
Renames a 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 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.
Provides a generic interface for attributes and their values and the possibility to serialize them.
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
virtual void deleteAllDynamicLights()=0
Deletes all dynamic lights which were previously added with addDynamicLight().
virtual u32 getMaterialRendererCount() const =0
Get amount of currently available material renderers.
Interface providing read access to a file.
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
E_CLEAR_BUFFER_FLAG
Enum for the flags of clear buffer.
virtual void turnLightOn(s32 lightIndex, bool turnOn)=0
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true)=0
Enables or disables a texture creation flag.
virtual const SLight & getDynamicLight(u32 idx) const =0
Returns light data which was previously set by IVideoDriver::addDynamicLight().
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 removeAllOcclusionQueries()=0
Remove all occlusion queries.
virtual void removeAllHardwareBuffers()=0
Remove all hardware buffers.
float f32
32 bit floating point variable.
virtual bool setClipPlane(u32 index, const core::plane3df &plane, bool enable=false)=0
Set or unset a clipping plane.
virtual void removeOcclusionQuery(scene::ISceneNode *node)=0
Remove occlusion query.
const c8 *const FogTypeNames[]
GLuint GLuint GLsizei count
virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames=true)=0
Swap the material renderers used for certain id's.
virtual IImage * createImageFromData(ECOLOR_FORMAT format, const core::dimension2d< u32 > &size, void *data, bool ownForeignMemory=false, bool deleteMemory=true)=0
Creates a software image from a byte array.
virtual void setAmbientLight(const SColorf &color)=0
Only used by the engine internally.
virtual void setMaterial(const SMaterial &material)=0
Sets a material.
GLenum GLenum GLuint texture
GLuint GLuint GLsizei GLenum const GLvoid * indices
char c8
8 bit character variable.
void drawIndexedTriangleList(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
virtual void draw3DBox(const core::aabbox3d< f32 > &box, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d axis aligned box.
GLint GLfloat GLint stencil
virtual const c8 * getMaterialRendererName(u32 idx) const =0
Get name of a material renderer.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
3d triangle template class for doing collision detection and other things.
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0
Sets transformation matrices.
struct holding data describing options
virtual scene::IMeshManipulator * getMeshManipulator()=0
Returns a pointer to the mesh manipulator.
virtual void removeTexture(ITexture *texture)=0
Removes a texture from the texture cache and deletes it.
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.
virtual u32 getMaximalPrimitiveCount() const =0
Returns the maximum amount of primitives.
virtual irr::u32 getShaderConstantSize() const
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 ITexture * addTextureCubemap(const io::path &name, IImage *imagePosX, IImage *imageNegX, IImage *imagePosY, IImage *imageNegY, IImage *imagePosZ, IImage *imageNegZ)=0
Creates a cubemap texture from loaded IImages.
_IRR_DEPRECATED_ ITexture * addTexture(const io::path &name, IImage *image, void *mipmapData)
Creates a texture from an IImage.
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
E_TEXTURE_TYPE
Enumeration describing the type of ITexture.
GLuint const GLchar * name
virtual const core::dimension2d< u32 > & getScreenSize() const =0
Get the size of the screen or render window.
virtual void removeHardwareBuffer(const scene::IMeshBuffer *mb)=0
Remove hardware buffer.
virtual void drawMeshBuffer(const scene::IMeshBuffer *mb)=0
Draws a mesh buffer.
virtual const core::dimension2d< u32 > & getCurrentRenderTargetSize() const =0
Get the size of the current render target.
Everything in the Irrlicht Engine can be found in this namespace.
virtual void draw3DTriangle(const core::triangle3df &triangle, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d triangle.
void drawIndexedTriangleFan(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
virtual u32 getPrimitiveCountDrawn(u32 mode=0) const =0
Returns amount of primitives (mostly triangles) which were drawn in the last frame.
virtual SOverrideMaterial & getOverrideMaterial()=0
Get the global Material, which might override local materials.
virtual void updateAllOcclusionQueries(bool block=true)=0
Update all occlusion queries. Retrieves results from GPU.
virtual u32 getDynamicLightCount() const =0
Returns amount of dynamic lights currently set.
virtual void OnResize(const core::dimension2d< u32 > &size)=0
Event handler for resize events. Only used by the engine internally.
Render target is the main color frame buffer.
virtual core::stringc getVendorInfo()=0
Get the graphics card vendor name.
Interface providing write access to a file.
virtual core::dimension2du getMaxTextureSize() const =0
Get the maximum texture size supported.
virtual core::array< IImage * > createImagesFromFile(const io::path &filename, E_TEXTURE_TYPE *type=0)=0
Creates a software images from a file.
virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true)=0
Disable a feature of the driver.
_IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
Clear the color, depth and/or stencil buffers.
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Interface for software image data.
virtual void convertColor(const void *sP, ECOLOR_FORMAT sF, s32 sN, void *dP, ECOLOR_FORMAT dF) const =0
Color conversion convenience function.
virtual E_DRIVER_TYPE getDriverType() const =0
Get type of video driver.
Projection transformation.
virtual void clearShaderConstant()
Class which holds the geometry of an object.
unsigned char u8
8 bit unsigned variable.
virtual s32 getFPS() const =0
Returns current frames per second value.
virtual void draw3DLine(const core::vector3df &start, const core::vector3df &end, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d line.
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 b...
void drawIndexedTriangleList(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Render target is a render texture.
virtual void drawPixel(u32 x, u32 y, const SColor &color)=0
Draws a pixel.
unsigned short u16
16 bit unsigned variable.
bool operator==(const struct SShaderConstant &other) const
virtual bool writeImageToFile(IImage *image, const io::path &filename, u32 param=0)=0
Writes the provided image to a file.
Vertex with two texture coordinates.
virtual void setMinHardwareBufferVertexCount(u32 count)=0
Set the minimum number of vertices for which a hw buffer will be created.
virtual SShaderConstant * getShaderConstant(irr::u32 num)
virtual const SExposedVideoData & getExposedVideoData()=0
Returns driver and operating system specific data about the IVideoDriver.
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
Class which is able to create a image from a file.
signed int s32
32 bit signed variable.
Struct for holding a mesh with a single material.
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
Interface for material rendering.
virtual const core::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
virtual void setAllowZWriteOnTransparent(bool flag)=0
Only used by the engine internally.
GLsizei const GLfloat * value
virtual IImageLoader * getImageLoader(u32 n)=0
Retrieve the given image loader.
virtual void runAllOcclusionQueries(bool visible=false)=0
Run all occlusion queries. Draws all meshes stored in queries.
Render target is the main color frame buffer.
Render target is the right color buffer (left is the main buffer)
unsigned int u32
32 bit unsigned variable.
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
Explicitly set all vertices for each triangle.
void drawIndexedTriangleFan(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
virtual ITexture * addRenderTargetTexture(const core::dimension2d< u32 > &size, const io::path &name="rt", const ECOLOR_FORMAT format=ECF_UNKNOWN)=0
Adds a new render target texture to the texture cache.
virtual void fillMaterialStructureFromAttributes(video::SMaterial &outMaterial, io::IAttributes *attributes)=0
Fills an SMaterial structure from attributes.
virtual const core::rect< s32 > & getViewPort() const =0
Gets the area of the current viewport.
u32 size() const
Get number of occupied elements of the array.
virtual IRenderTarget * addRenderTarget()=0
Create render target.
standard vertex used by the Irrlicht engine.
E_FOG_TYPE
Enum for the types of fog distributions to choose from.
virtual u32 getOcclusionQueryResult(scene::ISceneNode *node) const =0
Return query result.
structure for holding data describing a dynamic point light.
GLint GLint GLint GLint GLint GLint y
virtual bool removeMaterialRenderer(u32 idx)
virtual bool endScene()=0
Presents the rendered image to the screen.
virtual u32 getTextureCount() const =0
Returns amount of textures currently loaded.
Interface to driver which is able to perform 2d and 3d graphics functions.
IImage * createImageFromFile(const io::path &filename)
Creates a software image from a file.
virtual IImage * createImage(ECOLOR_FORMAT format, const core::dimension2d< u32 > &size)=0
Creates an empty software image.
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 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.
virtual IMaterialRenderer * getMaterialRenderer(u32 idx) const =0
Get access to a material renderer by index.
GLenum GLenum GLsizei const GLuint GLboolean enabled
Class representing a 32 bit ARGB color.
virtual void addShaderConstant(const SShaderConstant &value)
virtual ITexture * getTextureByIndex(u32 index)=0
Returns a texture by index.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
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 ITexture * addTexture(const core::dimension2d< u32 > &size, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
Creates an empty texture of specified size.
virtual IImage * createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER)=0
Make a screenshot of the last rendered frame.
Interface of a Render Target.
GLint GLint GLsizei GLsizei GLsizei depth
virtual bool queryTextureFormat(ECOLOR_FORMAT format) const =0
Check if the driver supports creating textures with the given color format.
virtual void removeAllTextures()=0
Removes all textures from the texture cache and deletes them.
Render to both stereo buffers at once.
IImage * createImageFromFile(io::IReadFile *file)
Creates a software image from a file.
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.
_IRR_DEPRECATED_ void clearZBuffer()
Clears the ZBuffer.
virtual void removeAllRenderTargets()=0
Remove all render targets.
virtual u32 getImageWriterCount() const =0
Retrieve the number of image writers.
virtual s32 addMaterialRenderer(IMaterialRenderer *renderer, const c8 *name=0)=0
Adds a new material renderer to the video device.
Self reallocating template array (like stl vector) with additional features.
virtual const wchar_t * getName() const =0
Gets name of this video driver.
2d vector template class with lots of operators and methods.
E_VIDEO_DRIVER_FEATURE
enumeration for querying features of the video driver.
GLint GLint GLint GLint GLint x
bool setRenderTarget(ITexture *texture, bool clearBackBuffer, bool clearZBuffer, SColor color=SColor(255, 0, 0, 0))
virtual ITexture * getTexture(const io::path &filename)=0
Get access to a named texture.
E_TEXTURE_CREATION_FLAG
Enumeration flags used to tell the video driver with setTextureCreationFlag in which format textures ...
virtual void draw2DRectangleOutline(const core::recti &pos, SColor color=SColor(255, 255, 255, 255))=0
Draws the outline of a 2D rectangle.
SShaderConstant(const irr::core::stringc &name=irr::core::stringc(), E_SHADER_VAR_TYPE type=ESVT_FLOAT32, const void *data=0)
void drawIndexedTriangleFan(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
virtual void setVirtualScreenSize(const core::dimension2du &size)
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.
Interface of a Video Driver dependent Texture.
virtual ITexture * addRenderTargetTextureCubemap(const irr::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.
Base class of most objects of the Irrlicht Engine.
GLuint GLuint GLsizei GLenum type
structure for holding data describing a driver and operating system specific data.
Multi-Render target textures.
E_VERTEX_TYPE
Enumeration for all vertex types there are.
void drawIndexedTriangleList(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
virtual bool needsTransparentRenderPass(const irr::video::SMaterial &material) const =0
Used by some SceneNodes to check if a material should be rendered in the transparent render pass.
virtual u32 getMaximalDynamicLightAmount() const =0
Returns the maximal amount of dynamic lights the device can handle.
virtual void setMaterialRendererName(s32 idx, const c8 *name)=0
Sets the name of a material renderer.
virtual video::ITexture * findTexture(const io::path &filename)=0
Check if the image is already loaded.
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0
Queries the features of the driver.
virtual void makeNormalMapTexture(video::ITexture *texture, f32 amplitude=1.0f) const =0
Creates a normal map from a height map texture.
virtual IImageWriter * getImageWriter(u32 n)=0
Retrieve the given image writer.
An interface for easy manipulation of meshes.
Interface for writing software image data.
virtual u32 getImageLoaderCount() const =0
Retrieve the number of image loaders.
virtual const io::IAttributes & getDriverAttributes() const =0
Get attributes of the actual video driver.
virtual bool checkDriverReset()=0
Check if the driver was recently reset.
GLuint GLsizei GLsizei * length
virtual void runOcclusionQuery(scene::ISceneNode *node, bool visible=false)=0
Run occlusion query. Draws mesh stored in query.
Vertex with a tangent and binormal vector.
virtual void enableClipPlane(u32 index, bool enable)=0
Enable or disable a clipping plane.
virtual void removeRenderTarget(IRenderTarget *renderTarget)=0
Remove render target.
Class representing a color with four floats.
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.
Struct for holding parameters for a material renderer.
virtual void updateOcclusionQuery(scene::ISceneNode *node, bool block=true)=0
Update occlusion query. Retrieves results from GPU.
virtual IGPUProgrammingServices * getGPUProgrammingServices()=0
Gets the IGPUProgrammingServices interface.
#define _IRR_MATERIAL_MAX_TEXTURES_
Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
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 getFog(SColor &color, E_FOG_TYPE &fogType, f32 &start, f32 &end, f32 &density, bool &pixelFog, bool &rangeFog)=0
Gets the fog mode.
virtual const SColorf & getAmbientLight() const =0
Get the global ambient light currently used by the driver.
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0
Returns if a texture creation flag is enabled or disabled.
virtual SMaterial & getMaterial2D()=0
Get the 2d override material for altering its values.
virtual core::dimension2du getVirtualScreenSize() const
virtual void drawMeshBufferNormals(const scene::IMeshBuffer *mb, f32 length=10.f, SColor color=0xffffffff)=0
Draws normals of a mesh buffer.
vector2d< s32 > vector2di
Typedef for integer 2d vector.
virtual s32 addDynamicLight(const SLight &light)=0
virtual void enableMaterial2D(bool enable=true)=0
Enable the 2d override material.
virtual void draw2DRectangle(SColor color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0
Draws a 2d rectangle.
virtual ECOLOR_FORMAT getColorFormat() const =0
Get the current color format of the color buffer.
Interface making it possible to create and use programs running on the GPU.