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;
68 #if _IRR_MATERIAL_MAX_TEXTURES_>4 71 #if _IRR_MATERIAL_MAX_TEXTURES_>5 74 #if _IRR_MATERIAL_MAX_TEXTURES_>6 77 #if _IRR_MATERIAL_MAX_TEXTURES_>7 171 for (
u32 i=0; i<32; ++i)
173 const u32 num=(1<<i);
174 if (EnableFlags & num)
218 RenderTexture(texture),
220 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
228 TargetType(target), ColorMask(colorMask),
229 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
278 virtual bool beginScene(
bool backBuffer=
true,
bool zBuffer=
true,
287 virtual bool endScene() =0;
325 virtual bool checkDriverReset() =0;
340 virtual u32 getImageLoaderCount()
const = 0;
350 virtual u32 getImageWriterCount()
const = 0;
361 virtual void setMaterial(
const SMaterial& material) =0;
398 virtual u32 getTextureCount()
const = 0;
454 virtual void removeTexture(
ITexture* texture) =0;
463 virtual void removeAllTextures() =0;
469 virtual void removeAllHardwareBuffers() =0;
480 virtual void removeAllOcclusionQueries() =0;
490 virtual void runAllOcclusionQueries(
bool visible=
false) =0;
500 virtual void updateAllOcclusionQueries(
bool block=
true) =0;
527 bool zeroTexels =
false)
const =0;
543 core::position2d<s32> colorKeyPixelPos,
544 bool zeroTexels =
false)
const =0;
554 virtual void makeNormalMapTexture(
video::ITexture* texture,
f32 amplitude=1.0f)
const =0;
589 bool clearBackBuffer=
true,
bool clearZBuffer=
true,
604 virtual bool setRenderTarget(
E_RENDER_TARGET target,
bool clearTarget=
true,
605 bool clearZBuffer=
true,
610 bool clearBackBuffer=
true,
bool clearZBuffer=
true,
638 virtual void drawVertexPrimitiveList(
const void* vertices,
u32 vertexCount,
639 const void* indexList,
u32 primCount,
664 virtual void draw2DVertexPrimitiveList(
const void* vertices,
u32 vertexCount,
665 const void* indexList,
u32 primCount,
680 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
695 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
710 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
725 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
740 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
755 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
815 const core::position2d<s32>& destPos) =0;
833 virtual void draw2DImage(
const video::ITexture* texture,
const core::position2d<s32>& destPos,
835 SColor color=
SColor(255,255,255,255),
bool useAlphaChannelOfTexture=
false) =0;
858 const core::position2d<s32>& pos,
864 bool useAlphaChannelOfTexture=
false) =0;
883 const core::array<core::position2d<s32> >& positions,
887 bool useAlphaChannelOfTexture=
false) =0;
901 const video::SColor *
const colors=0,
bool useAlphaChannelOfTexture=
false) =0;
940 virtual void draw2DRectangleOutline(
const core::recti& pos,
949 virtual void draw2DLine(
const core::position2d<s32>& start,
950 const core::position2d<s32>& end,
957 virtual void drawPixel(
u32 x,
u32 y,
const SColor& color) =0;
972 virtual void draw2DPolygon(core::position2d<s32> center,
975 s32 vertexCount=10) =0;
1013 virtual void drawStencilShadow(
bool clearStencilBuffer=
false,
1047 virtual void setFog(
SColor color=
SColor(0,255,255,255),
1049 f32 start=50.0f,
f32 end=100.0f,
f32 density=0.01f,
1050 bool pixelFog=
false,
bool rangeFog=
false) =0;
1055 bool& pixelFog,
bool& rangeFog) = 0;
1078 virtual s32 getFPS()
const =0;
1085 virtual u32 getPrimitiveCountDrawn(
u32 mode =0 )
const =0;
1088 virtual void deleteAllDynamicLights() =0;
1093 virtual s32 addDynamicLight(
const SLight& light) =0;
1097 virtual u32 getMaximalDynamicLightAmount()
const =0;
1101 virtual u32 getDynamicLightCount()
const =0;
1107 virtual const SLight& getDynamicLight(
u32 idx)
const =0;
1112 virtual void turnLightOn(
s32 lightIndex,
bool turnOn) =0;
1117 virtual const wchar_t* getName()
const =0;
1126 virtual void addExternalImageLoader(
IImageLoader* loader) =0;
1135 virtual void addExternalImageWriter(
IImageWriter* writer) =0;
1141 virtual u32 getMaximalPrimitiveCount()
const =0;
1170 virtual IImage* createImageFromFile(
const io::path& filename) = 0;
1190 virtual bool writeImageToFile(
IImage* image,
const io::path& filename,
u32 param = 0) = 0;
1220 bool ownForeignMemory=
false,
1221 bool deleteMemory =
true) =0;
1250 const core::position2d<s32>& pos,
1262 const core::position2d<s32>& pos,
1302 virtual u32 getMaterialRendererCount()
const =0;
1314 virtual const c8* getMaterialRendererName(
u32 idx)
const =0;
1322 virtual void setMaterialRendererName(
s32 idx,
const c8* name) =0;
1372 virtual void clearZBuffer() =0;
1394 virtual bool setClipPlane(
u32 index,
const core::plane3df& plane,
bool enable=
false) =0;
1403 virtual void enableClipPlane(
u32 index,
bool enable) =0;
1407 virtual void setMinHardwareBufferVertexCount(
u32 count) =0;
1435 virtual void enableMaterial2D(
bool enable=
true) =0;
1444 virtual void setAmbientLight(
const SColorf& color) =0;
1450 virtual void setAllowZWriteOnTransparent(
bool flag) =0;
E_RENDER_TARGET
Special render targets, which usually map to dedicated hardware.
SMaterial Material
The Material values.
u8 ZBuffer
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
Is backface culling enabled? Default: true.
E_BLEND_FACTOR
Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor...
u32 EnableFlags
Which values are taken for override.
Provides a generic interface for attributes and their values and the possiblity to serialize them...
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
bool FrontfaceCulling
Is frontface culling enabled? Default: false.
Is fog enabled? Default: false.
Interface providing read acess to a file.
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
E_BLEND_FACTOR BlendFuncSrc
u8 ColorMaterial
Defines the interpretation of vertex color in the lighting equation.
float f32
32 bit floating point variable.
const c8 *const FogTypeNames[]
bool PointCloud
Draw as point cloud or filled triangles? Default: false.
Is the ZBuffer enabled? Default: true.
bool UseMipMaps
Shall mipmaps be used if available.
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
u8 ColorMask
Defines the enabled color planes.
char c8
8 bit character variable.
void drawIndexedTriangleList(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Flag for blend operation.
bool GouraudShading
Flat or Gouraud shading? Default: true.
3d triangle template class for doing collision detection and other things.
IRenderTarget(E_RENDER_TARGET target, E_COLOR_PLANE colorMask=ECP_ALL, E_BLEND_FACTOR blendFuncSrc=EBF_ONE, E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, E_BLEND_OPERATION blendOp=EBO_NONE)
struct holding data describing options
u8 TextureWrapU
Texture Clamp Mode.
E_BLEND_OPERATION
Values defining the blend operation used when blend is enabled.
E_LOST_RESOURCE
enumeration for signaling resources which were lost after the last render cycle
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Everything in the Irrlicht Engine can be found in this namespace.
bool Enabled
Global enable flag, overwritten by the SceneManager in each pass.
void drawIndexedTriangleFan(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
ColorMaterial enum for vertex color interpretation.
E_BLEND_OPERATION BlendOperation
Store the blend operation of choice.
Render target is the main color frame buffer.
Interface providing write access to a file.
ColorMask bits, for enabling the color planes.
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Interface for software image data.
Projection transformation.
Class which holds the geometry of an object.
SOverrideMaterial()
Default constructor.
Is bilinear filtering enabled? Default: true.
void drawIndexedTriangleList(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Render target is a render texture.
unsigned short u16
16 bit unsigned variable.
Vertex with two texture coordinates.
E_COLOR_PLANE
Enum values for enabling/disabling color planes for rendering.
All texture are lost, rare problem.
bool operator!=(const IRenderTarget &other) const
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.
bool BackfaceCulling
Is backface culling enabled? Default: true.
u8 AntiAliasing
Sets the antialiasing mode.
E_BLEND_FACTOR BlendFuncDst
IRenderTarget(ITexture *texture, E_COLOR_PLANE colorMask=ECP_ALL, E_BLEND_FACTOR blendFuncSrc=EBF_ONE, E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, E_BLEND_OPERATION blendOp=EBO_NONE)
Render target is the main color frame buffer.
The whole device/driver is lost.
Render target is the right color buffer (left is the main buffer)
Normalizes normals. Default: false.
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.
standard vertex used by the Irrlicht engine.
u8 PolygonOffsetFactor
Factor specifying how far the polygon offset should be made.
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
E_FOG_TYPE
Enum for the types of fog distributions to choose from.
structure for holding data describing a dynamic point light.
Interface to driver which is able to perform 2d and 3d graphics functions.
bool NormalizeNormals
Should normals be normalized?
Is anisotropic filtering? Default: false.
Flag for enabling/disabling mipmap usage.
bool FogEnable
Is fog enabled? Default: false.
Class representing a 32 bit ARGB color.
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
May be written to the zbuffer or is it readonly. Default: true.
Will this material be lighted? Default: true.
Render to both stereo buffers at once.
Self reallocating template array (like stl vector) with additional features.
E_VIDEO_DRIVER_FEATURE
enumeration for querying features of the video driver.
u16 EnablePasses
Set in which render passes the material override is active.
bool Lighting
Will this material be lighted? Default: true.
bool ZWriteEnable
Is the zbuffer writeable or is it read-only. Default: true.
E_TEXTURE_CREATION_FLAG
Enumeration flags telling the video driver in which format textures should be created.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]
Texture layer array.
E_POLYGON_OFFSET PolygonOffsetDirection
Flag defining the direction the polygon offset is applied to.
void drawIndexedTriangleFan(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
Interface of a Video Driver dependent Texture.
Base class of most objects of the Irrlicht Engine.
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.
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
The HW buffers are lost, will be recreated automatically, but might require some more time this frame...
Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha...
An interface for easy manipulation of meshes.
Interface for writing software image data.
Flat or Gouraud shading? Default: true.
void apply(SMaterial &material)
Apply the enabled overrides.
Access to all layers texture wrap settings. Overwrites separate layer settings.
Vertex with a tangent and binormal vector.
Is trilinear filtering enabled? Default: false.
Class representing a color with four floats.
Struct for holding parameters for a material renderer.
Draw as wireframe or filled triangles? Default: false.
Is frontface culling enabled? Default: false.
Draw as point cloud or filled triangles? Default: false.
The Render Target Textures are lost, typical problem for D3D.
E_BLEND_OPERATION BlendOp
E_RENDER_TARGET TargetType
Interface making it possible to create and use programs running on the GPU.