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;
452 virtual void removeTexture(
ITexture* texture) =0;
461 virtual void removeAllTextures() =0;
467 virtual void removeAllHardwareBuffers() =0;
478 virtual void removeAllOcclusionQueries() =0;
488 virtual void runAllOcclusionQueries(
bool visible=
false) =0;
498 virtual void updateAllOcclusionQueries(
bool block=
true) =0;
525 bool zeroTexels =
false)
const =0;
541 core::position2d<s32> colorKeyPixelPos,
542 bool zeroTexels =
false)
const =0;
552 virtual void makeNormalMapTexture(
video::ITexture* texture,
f32 amplitude=1.0f)
const =0;
587 bool clearBackBuffer=
true,
bool clearZBuffer=
true,
602 virtual bool setRenderTarget(
E_RENDER_TARGET target,
bool clearTarget=
true,
603 bool clearZBuffer=
true,
608 bool clearBackBuffer=
true,
bool clearZBuffer=
true,
636 virtual void drawVertexPrimitiveList(
const void* vertices,
u32 vertexCount,
637 const void* indexList,
u32 primCount,
662 virtual void draw2DVertexPrimitiveList(
const void* vertices,
u32 vertexCount,
663 const void* indexList,
u32 primCount,
678 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
693 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
708 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
723 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
738 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
753 u32 vertexCount,
const u16* indexList,
u32 triangleCount)
813 const core::position2d<s32>& destPos) =0;
831 virtual void draw2DImage(
const video::ITexture* texture,
const core::position2d<s32>& destPos,
833 SColor color=
SColor(255,255,255,255),
bool useAlphaChannelOfTexture=
false) =0;
856 const core::position2d<s32>& pos,
862 bool useAlphaChannelOfTexture=
false) =0;
881 const core::array<core::position2d<s32> >& positions,
885 bool useAlphaChannelOfTexture=
false) =0;
899 const video::SColor *
const colors=0,
bool useAlphaChannelOfTexture=
false) =0;
938 virtual void draw2DRectangleOutline(
const core::recti& pos,
947 virtual void draw2DLine(
const core::position2d<s32>& start,
948 const core::position2d<s32>& end,
955 virtual void drawPixel(
u32 x,
u32 y,
const SColor& color) =0;
970 virtual void draw2DPolygon(core::position2d<s32> center,
973 s32 vertexCount=10) =0;
1011 virtual void drawStencilShadow(
bool clearStencilBuffer=
false,
1045 virtual void setFog(
SColor color=
SColor(0,255,255,255),
1047 f32 start=50.0f,
f32 end=100.0f,
f32 density=0.01f,
1048 bool pixelFog=
false,
bool rangeFog=
false) =0;
1053 bool& pixelFog,
bool& rangeFog) = 0;
1076 virtual s32 getFPS()
const =0;
1083 virtual u32 getPrimitiveCountDrawn(
u32 mode =0 )
const =0;
1086 virtual void deleteAllDynamicLights() =0;
1091 virtual s32 addDynamicLight(
const SLight& light) =0;
1095 virtual u32 getMaximalDynamicLightAmount()
const =0;
1099 virtual u32 getDynamicLightCount()
const =0;
1105 virtual const SLight& getDynamicLight(
u32 idx)
const =0;
1110 virtual void turnLightOn(
s32 lightIndex,
bool turnOn) =0;
1115 virtual const wchar_t* getName()
const =0;
1124 virtual void addExternalImageLoader(
IImageLoader* loader) =0;
1133 virtual void addExternalImageWriter(
IImageWriter* writer) =0;
1139 virtual u32 getMaximalPrimitiveCount()
const =0;
1168 virtual IImage* createImageFromFile(
const io::path& filename) = 0;
1188 virtual bool writeImageToFile(
IImage* image,
const io::path& filename,
u32 param = 0) = 0;
1218 bool ownForeignMemory=
false,
1219 bool deleteMemory =
true) =0;
1248 const core::position2d<s32>& pos,
1260 const core::position2d<s32>& pos,
1300 virtual u32 getMaterialRendererCount()
const =0;
1312 virtual const c8* getMaterialRendererName(
u32 idx)
const =0;
1320 virtual void setMaterialRendererName(
s32 idx,
const c8* name) =0;
1370 virtual void clearZBuffer() =0;
1392 virtual bool setClipPlane(
u32 index,
const core::plane3df& plane,
bool enable=
false) =0;
1401 virtual void enableClipPlane(
u32 index,
bool enable) =0;
1405 virtual void setMinHardwareBufferVertexCount(
u32 count) =0;
1433 virtual void enableMaterial2D(
bool enable=
true) =0;
1442 virtual void setAmbientLight(
const SColorf& color) =0;
1448 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.