arsa  2.7
IVideoDriver.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __IRR_I_VIDEO_DRIVER_H_INCLUDED__
6 #define __IRR_I_VIDEO_DRIVER_H_INCLUDED__
7 
8 #include "rect.h"
9 #include "SColor.h"
10 #include "ITexture.h"
11 #include "irrArray.h"
12 #include "matrix4.h"
13 #include "plane3d.h"
14 #include "dimension2d.h"
15 #include "position2d.h"
16 #include "IMeshBuffer.h"
17 #include "triangle3d.h"
18 #include "EDriverTypes.h"
19 #include "EDriverFeatures.h"
20 #include "SExposedVideoData.h"
21 #include "SOverrideMaterial.h"
22 
23 namespace irr
24 {
25 namespace io
26 {
27  class IAttributes;
28  struct SAttributeReadWriteOptions;
29  class IReadFile;
30  class IWriteFile;
31 } // end namespace io
32 namespace scene
33 {
34  class IMeshBuffer;
35  class IMesh;
36  class IMeshManipulator;
37  class ISceneNode;
38 } // end namespace scene
39 
40 namespace video
41 {
42  struct S3DVertex;
43  struct S3DVertex2TCoords;
44  struct S3DVertexTangents;
45  struct SLight;
46  class IImageLoader;
47  class IImageWriter;
48  class IMaterialRenderer;
49  class IGPUProgrammingServices;
50  class IRenderTarget;
51 
54  {
56  ETS_VIEW = 0,
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
81 #endif
82 #endif
83 #endif
84 #endif
87  };
88 
90 
92  {
115  };
116 
119  {
125  };
126 
129  {
133  };
134 
135  const c8* const FogTypeNames[] =
136  {
137  "FogExp",
138  "FogLinear",
139  "FogExp2",
140  0
141  };
142 
144 
151  class IVideoDriver : public virtual IReferenceCounted
152  {
153  public:
154 
156 
169  virtual bool beginScene(u16 clearFlag=(u16)(ECBF_COLOR|ECBF_DEPTH), SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
170  const SExposedVideoData& videoData=SExposedVideoData(), core::rect<s32>* sourceRect = 0) = 0;
171 
173  bool beginScene(bool backBuffer, bool zBuffer, SColor color = SColor(255,0,0,0),
174  const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0)
175  {
176  u16 flag = 0;
177 
178  if (backBuffer)
179  flag |= ECBF_COLOR;
180 
181  if (zBuffer)
182  flag |= ECBF_DEPTH;
183 
184  return beginScene(flag, color, 1.f, 0, videoData, sourceRect);
185  }
186 
188 
191  virtual bool endScene() = 0;
192 
194 
197  virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0;
198 
200 
204  virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) =0;
205 
207 
223  virtual const io::IAttributes& getDriverAttributes() const=0;
224 
226 
229  virtual bool checkDriverReset() =0;
230 
232 
235  virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) =0;
236 
238 
240  virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const =0;
241 
243 
244  virtual u32 getImageLoaderCount() const = 0;
245 
247 
250  virtual IImageLoader* getImageLoader(u32 n) = 0;
251 
253 
254  virtual u32 getImageWriterCount() const = 0;
255 
257 
260  virtual IImageWriter* getImageWriter(u32 n) = 0;
261 
263 
265  virtual void setMaterial(const SMaterial& material) =0;
266 
268 
277  virtual ITexture* getTexture(const io::path& filename) = 0;
278 
280 
289  virtual ITexture* getTexture(io::IReadFile* file) =0;
290 
292 
298  virtual ITexture* getTextureByIndex(u32 index) =0;
299 
301 
302  virtual u32 getTextureCount() const = 0;
303 
305 
307  virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
308 
310 
322 
324 
334  {
335  if (image)
336  image->setMipMapsData(mipmapData, false, true);
337 
338  return addTexture(name, image);
339  }
340 
342 
349  virtual ITexture* addTexture(const io::path& name, IImage* image) = 0;
350 
352 
361  virtual ITexture* addTextureCubemap(const io::path& name, IImage* imagePosX, IImage* imageNegX, IImage* imagePosY,
362  IImage* imageNegY, IImage* imagePosZ, IImage* imageNegZ) = 0;
363 
365 
373  virtual ITexture* addTextureCubemap(const irr::u32 sideLen, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
374 
376 
387  const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
388 
390 
398  virtual ITexture* addRenderTargetTextureCubemap(const irr::u32 sideLen,
399  const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
400 
402 
409  virtual void removeTexture(ITexture* texture) =0;
410 
412 
418  virtual void removeAllTextures() =0;
419 
421  virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0;
422 
424  virtual void removeAllHardwareBuffers() =0;
425 
427 
428  virtual void addOcclusionQuery(scene::ISceneNode* node,
429  const scene::IMesh* mesh=0) =0;
430 
432  virtual void removeOcclusionQuery(scene::ISceneNode* node) =0;
433 
435  virtual void removeAllOcclusionQueries() =0;
436 
438 
440  virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0;
441 
443 
445  virtual void runAllOcclusionQueries(bool visible=false) =0;
446 
448 
450  virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0;
451 
453 
455  virtual void updateAllOcclusionQueries(bool block=true) =0;
456 
458 
461  virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
462 
464  virtual IRenderTarget* addRenderTarget() = 0;
465 
467  virtual void removeRenderTarget(IRenderTarget* renderTarget) = 0;
468 
470  virtual void removeAllRenderTargets() = 0;
471 
473 
491  bool zeroTexels = false) const =0;
492 
494 
507  core::position2d<s32> colorKeyPixelPos,
508  bool zeroTexels = false) const =0;
509 
511 
522  virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
523 
525 
539  virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),
540  f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
541 
543 
571  virtual bool setRenderTarget(ITexture* texture, u16 clearFlag=ECBF_COLOR|ECBF_DEPTH, SColor clearColor = SColor(255,0,0,0),
572  f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
573 
577  bool setRenderTarget(ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color = SColor(255,0,0,0))
578  {
579  u16 flag = 0;
580 
581  if (clearBackBuffer)
582  flag |= ECBF_COLOR;
583 
584  if (clearZBuffer)
585  flag |= ECBF_DEPTH;
586 
587  return setRenderTarget(texture, flag, color);
588  }
589 
591 
594  virtual void setViewPort(const core::rect<s32>& area) =0;
595 
597 
598  virtual const core::rect<s32>& getViewPort() const =0;
599 
601 
615  virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
616  const void* indexList, u32 primCount,
619  E_INDEX_TYPE iType=EIT_16BIT) =0;
620 
622 
641  virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,
642  const void* indexList, u32 primCount,
645  E_INDEX_TYPE iType=EIT_16BIT) =0;
646 
648 
656  void drawIndexedTriangleList(const S3DVertex* vertices,
657  u32 vertexCount, const u16* indexList, u32 triangleCount)
658  {
659  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
660  }
661 
663 
672  u32 vertexCount, const u16* indexList, u32 triangleCount)
673  {
674  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT);
675  }
676 
678 
687  u32 vertexCount, const u16* indexList, u32 triangleCount)
688  {
689  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT);
690  }
691 
693 
701  void drawIndexedTriangleFan(const S3DVertex* vertices,
702  u32 vertexCount, const u16* indexList, u32 triangleCount)
703  {
704  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
705  }
706 
708 
717  u32 vertexCount, const u16* indexList, u32 triangleCount)
718  {
719  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
720  }
721 
723 
732  u32 vertexCount, const u16* indexList, u32 triangleCount)
733  {
734  drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
735  }
736 
738 
752  virtual void draw3DLine(const core::vector3df& start,
753  const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
754 
756 
769  virtual void draw3DTriangle(const core::triangle3df& triangle,
770  SColor color = SColor(255,255,255,255)) =0;
771 
773 
784  virtual void draw3DBox(const core::aabbox3d<f32>& box,
785  SColor color = SColor(255,255,255,255)) =0;
786 
788 
793  virtual void draw2DImage(const video::ITexture* texture,
794  const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture=false) =0;
795 
797 
812  virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
813  const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
814  SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
815 
817 
836  virtual void draw2DImageBatch(const video::ITexture* texture,
837  const core::position2d<s32>& pos,
838  const core::array<core::rect<s32> >& sourceRects,
839  const core::array<s32>& indices,
840  s32 kerningWidth=0,
841  const core::rect<s32>* clipRect=0,
842  SColor color=SColor(255,255,255,255),
843  bool useAlphaChannelOfTexture=false) =0;
844 
846 
861  virtual void draw2DImageBatch(const video::ITexture* texture,
862  const core::array<core::position2d<s32> >& positions,
863  const core::array<core::rect<s32> >& sourceRects,
864  const core::rect<s32>* clipRect=0,
865  SColor color=SColor(255,255,255,255),
866  bool useAlphaChannelOfTexture=false) =0;
867 
869 
878  virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
879  const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
880  const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;
881 
883 
890  virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
891  const core::rect<s32>* clip =0) =0;
892 
894 
910  virtual void draw2DRectangle(const core::rect<s32>& pos,
911  SColor colorLeftUp, SColor colorRightUp,
912  SColor colorLeftDown, SColor colorRightDown,
913  const core::rect<s32>* clip =0) =0;
914 
916 
919  virtual void draw2DRectangleOutline(const core::recti& pos,
920  SColor color=SColor(255,255,255,255)) =0;
921 
923 
931  virtual void draw2DLine(const core::position2d<s32>& start,
932  const core::position2d<s32>& end,
933  SColor color=SColor(255,255,255,255)) =0;
934 
936 
939  virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
940 
942 
954  virtual void draw2DPolygon(core::position2d<s32> center,
955  f32 radius,
956  video::SColor color=SColor(100,255,255,255),
957  s32 vertexCount=10) =0;
958 
960 
973  virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;
974 
976 
995  virtual void drawStencilShadow(bool clearStencilBuffer=false,
996  video::SColor leftUpEdge = video::SColor(255,0,0,0),
997  video::SColor rightUpEdge = video::SColor(255,0,0,0),
998  video::SColor leftDownEdge = video::SColor(255,0,0,0),
999  video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
1000 
1002 
1003  virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
1004 
1006 
1010  virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f, SColor color=0xffffffff) =0;
1011 
1013 
1029  virtual void setFog(SColor color=SColor(0,255,255,255),
1030  E_FOG_TYPE fogType=EFT_FOG_LINEAR,
1031  f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,
1032  bool pixelFog=false, bool rangeFog=false) =0;
1033 
1035  virtual void getFog(SColor& color, E_FOG_TYPE& fogType,
1036  f32& start, f32& end, f32& density,
1037  bool& pixelFog, bool& rangeFog) = 0;
1038 
1040 
1041  virtual ECOLOR_FORMAT getColorFormat() const =0;
1042 
1044 
1045  virtual const core::dimension2d<u32>& getScreenSize() const =0;
1046 
1048 
1052  virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const =0;
1053 
1055 
1060  virtual s32 getFPS() const =0;
1061 
1063 
1067  virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0;
1068 
1070  virtual void deleteAllDynamicLights() =0;
1071 
1075  virtual s32 addDynamicLight(const SLight& light) =0;
1076 
1078 
1079  virtual u32 getMaximalDynamicLightAmount() const =0;
1080 
1082 
1083  virtual u32 getDynamicLightCount() const =0;
1084 
1086 
1089  virtual const SLight& getDynamicLight(u32 idx) const =0;
1090 
1094  virtual void turnLightOn(s32 lightIndex, bool turnOn) =0;
1095 
1097 
1099  virtual const wchar_t* getName() const =0;
1100 
1102 
1108  virtual void addExternalImageLoader(IImageLoader* loader) =0;
1109 
1111 
1117  virtual void addExternalImageWriter(IImageWriter* writer) =0;
1118 
1120 
1123  virtual u32 getMaximalPrimitiveCount() const =0;
1124 
1126 
1135  virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true) =0;
1136 
1138 
1141  virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
1142 
1144 
1152  virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) = 0;
1153 
1155 
1164 
1166 
1175  {
1176  core::array<IImage*> imageArray = createImagesFromFile(filename);
1177 
1178  for (u32 i = 1; i < imageArray.size(); ++i)
1179  imageArray[i]->drop();
1180 
1181  return (imageArray.size() > 0) ? imageArray[0] : 0;
1182  }
1183 
1185 
1193  {
1194  core::array<IImage*> imageArray = createImagesFromFile(file);
1195 
1196  for (u32 i = 1; i < imageArray.size(); ++i)
1197  imageArray[i]->drop();
1198 
1199  return (imageArray.size() > 0) ? imageArray[0] : 0;
1200  }
1201 
1203 
1210  virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0;
1211 
1213 
1221  virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0;
1222 
1224 
1242  const core::dimension2d<u32>& size, void *data, bool ownForeignMemory = false,
1243  bool deleteMemory = true) = 0;
1244 
1246 
1253 
1255 
1261  _IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0;
1262 
1264 
1271  _IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy,
1272  const core::position2d<s32>& pos,
1273  const core::dimension2d<u32>& size) =0;
1274 
1276 
1283  virtual IImage* createImage(ITexture* texture,
1284  const core::position2d<s32>& pos,
1285  const core::dimension2d<u32>& size) =0;
1286 
1288 
1290  virtual void OnResize(const core::dimension2d<u32>& size) =0;
1291 
1293 
1313  virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0;
1314 
1316 
1320  virtual IMaterialRenderer* getMaterialRenderer(u32 idx) const = 0;
1321 
1323 
1324  virtual u32 getMaterialRendererCount() const =0;
1325 
1327 
1336  virtual const c8* getMaterialRendererName(u32 idx) const =0;
1337 
1339 
1344  virtual void setMaterialRendererName(s32 idx, const c8* name) =0;
1345 
1347 
1354  virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames=true) = 0;
1355 
1357 
1367  io::SAttributeReadWriteOptions* options=0) =0;
1368 
1370 
1376  virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) =0;
1377 
1379 
1382  virtual const SExposedVideoData& getExposedVideoData() =0;
1383 
1385 
1386  virtual E_DRIVER_TYPE getDriverType() const =0;
1387 
1389 
1393 
1396 
1398  virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0;
1399 
1401  _IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
1402  {
1403  u16 flag = 0;
1404 
1405  if (backBuffer)
1406  flag |= ECBF_COLOR;
1407 
1408  if (depthBuffer)
1409  flag |= ECBF_DEPTH;
1410 
1411  if (stencilBuffer)
1412  flag |= ECBF_STENCIL;
1413 
1414  clearBuffers(flag, color);
1415  }
1416 
1418 
1425  {
1426  clearBuffers(ECBF_DEPTH, SColor(255,0,0,0), 1.f, 0);
1427  }
1428 
1430 
1432 
1434 
1438  virtual video::ITexture* findTexture(const io::path& filename) = 0;
1439 
1441 
1449  virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0;
1450 
1452 
1458  virtual void enableClipPlane(u32 index, bool enable) =0;
1459 
1461 
1462  virtual void setMinHardwareBufferVertexCount(u32 count) =0;
1463 
1465 
1469  virtual SOverrideMaterial& getOverrideMaterial() =0;
1470 
1472 
1485  virtual SMaterial& getMaterial2D() =0;
1486 
1488 
1490  virtual void enableMaterial2D(bool enable=true) =0;
1491 
1493  virtual core::stringc getVendorInfo() =0;
1494 
1496 
1499  virtual void setAmbientLight(const SColorf& color) =0;
1500 
1502  virtual const SColorf& getAmbientLight() const = 0;
1503 
1505 
1508  virtual void setAllowZWriteOnTransparent(bool flag) =0;
1509 
1511  virtual core::dimension2du getMaxTextureSize() const =0;
1512 
1514 
1523  virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
1524  void* dP, ECOLOR_FORMAT dF) const =0;
1525 
1527 
1528  virtual bool queryTextureFormat(ECOLOR_FORMAT format) const = 0;
1529 
1531  virtual bool needsTransparentRenderPass(const irr::video::SMaterial& material) const = 0;
1532 
1533  // 2021_10_4 By Oil GPU operations
1534  virtual bool removeMaterialRenderer(u32 idx) { return false; }
1535 
1537  {
1545  };
1547  {
1549  {
1550  Type = type;
1551  Name = name;
1552  Data = data;
1553  ID = -1;
1554  }
1555  bool isOk() const
1556  {
1557  return ID > -1 && Data && !Name.empty() ? true : false;
1558  }
1559  bool operator==( const struct SShaderConstant& other ) const
1560  {
1561  if( Name == other.Name && !Name.empty() && !other.Name.empty() )
1562  return true;
1563 
1564  return false;
1565  }
1566 
1570  const void* Data; // ref only
1571  };
1572  virtual void addShaderConstant( const SShaderConstant& value ) { }
1574  virtual void clearShaderConstant() { }
1575  virtual irr::u32 getShaderConstantSize() const { return 0; }
1576 
1577  // 2016_1_5 By Oil setArea
1578  // 2016_1_1 By Oil setVirtualScreenSize
1579  // 2015_7_6 By Oil
1582 #if defined(__WIN32__)
1583  virtual void setArea(int offset_x, int offset_y, const core::dimension2du& size, const core::dimension2du& max_size) { }
1584  virtual core::vector2di getAreaOffset() const { return core::vector2di(0, 0); }
1585  virtual core::dimension2du getAreaSize() const { return core::dimension2du(0, 0); }
1586  virtual core::dimension2du getAreaMax() const { return core::dimension2du(0, 0); }
1587 #endif // __WIN32__
1588 
1589  };
1590 
1591 } // end namespace video
1592 } // end namespace irr
1593 
1594 
1595 #endif
E_RENDER_TARGET
Special render targets, which usually map to dedicated hardware.
Definition: IVideoDriver.h:91
bool empty() const
Definition: irrString.h:509
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.
Definition: dimension2d.h:212
virtual void addExternalImageLoader(IImageLoader *loader)=0
Adds an external image loader to the engine.
Texture transformation.
Definition: IVideoDriver.h:80
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.
Definition: IAttributes.h:41
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Definition: irrTypes.h:202
virtual void deleteAllDynamicLights()=0
Deletes all dynamic lights which were previously added with addDynamicLight().
GLuint num
virtual u32 getMaterialRendererCount() const =0
Get amount of currently available material renderers.
Interface providing read access to a file.
Definition: IReadFile.h:18
GLdouble n
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
GLeglImageOES image
Definition: SDL_opengl.h:2148
Auxiliary buffer 1.
Definition: IVideoDriver.h:108
E_CLEAR_BUFFER_FLAG
Enum for the flags of clear buffer.
Definition: IVideoDriver.h:118
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.
Definition: irrTypes.h:108
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[]
Definition: IVideoDriver.h:135
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
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.
GLuint GLuint end
Definition: SDL_opengl.h:1571
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
Definition: SDL_opengl.h:1571
char c8
8 bit character variable.
Definition: irrTypes.h:35
Scene node interface.
Definition: ISceneNode.h:40
void drawIndexedTriangleList(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition: IVideoDriver.h:656
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
Definition: SDL_opengl.h:1974
3d triangle template class for doing collision detection and other things.
Definition: triangle3d.h:20
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0
Sets transformation matrices.
struct holding data describing options
Auxiliary buffer 3.
Definition: IVideoDriver.h:112
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.
Definition: IVideoDriver.h:333
GLuint start
Definition: SDL_opengl.h:1571
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Definition: SColor.h:20
E_TEXTURE_TYPE
Enumeration describing the type of ITexture.
Definition: ITexture.h:159
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.
Definition: CARSADPad.h:6
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.
Definition: IVideoDriver.h:701
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.
Definition: IVideoDriver.h:94
virtual core::stringc getVendorInfo()=0
Get the graphics card vendor name.
GLsizeiptr size
Interface providing write access to a file.
Definition: IWriteFile.h:17
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.
GLfloat param
_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.
Definition: S3DVertex.h:25
Interface for software image data.
Definition: IImage.h:25
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.
Definition: IVideoDriver.h:60
virtual void clearShaderConstant()
Class which holds the geometry of an object.
Definition: IMesh.h:71
unsigned char u8
8 bit unsigned variable.
Definition: irrTypes.h:22
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...
Definition: IVideoDriver.h:173
void drawIndexedTriangleList(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition: IVideoDriver.h:686
Render target is a render texture.
Definition: IVideoDriver.h:96
virtual void drawPixel(u32 x, u32 y, const SColor &color)=0
Draws a pixel.
unsigned short u16
16 bit unsigned variable.
Definition: irrTypes.h:44
bool operator==(const struct SShaderConstant &other) const
SDL_AudioFormat format
Definition: SDL_audio.h:194
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.
Definition: S3DVertex.h:112
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
Definition: IVideoDriver.h:53
Class which is able to create a image from a file.
Definition: IImageLoader.h:28
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
Struct for holding a mesh with a single material.
Definition: IMeshBuffer.h:39
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Definition: EDriverTypes.h:16
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
Definition: S3DVertex.h:31
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
Unknown color format:
Definition: SColor.h:132
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.
Definition: IVideoDriver.h:100
World transformation.
Definition: IVideoDriver.h:58
GLfloat f
Render target is the right color buffer (left is the main buffer)
Definition: IVideoDriver.h:102
Auxiliary buffer 2.
Definition: IVideoDriver.h:110
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
Definition: S3DVertex.h:21
Explicitly set all vertices for each triangle.
Texture transformation.
Definition: IVideoDriver.h:68
void drawIndexedTriangleFan(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
Definition: IVideoDriver.h:716
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.
Definition: irrArray.h:364
GLenum mode
Texture transformation.
Definition: IVideoDriver.h:77
Texture transformation.
Definition: IVideoDriver.h:62
virtual IRenderTarget * addRenderTarget()=0
Create render target.
Auxiliary buffer 0.
Definition: IVideoDriver.h:106
standard vertex used by the Irrlicht engine.
Definition: S3DVertex.h:44
E_FOG_TYPE
Enum for the types of fog distributions to choose from.
Definition: IVideoDriver.h:128
virtual u32 getOcclusionQueryResult(scene::ISceneNode *node) const =0
Return query result.
structure for holding data describing a dynamic point light.
Definition: SLight.h:41
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
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.
Definition: IVideoDriver.h:151
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.
GLuint index
GLenum GLenum GLsizei const GLuint GLboolean enabled
Class representing a 32 bit ARGB color.
Definition: SColor.h:316
virtual void addShaderConstant(const SShaderConstant &value)
virtual ITexture * getTextureByIndex(u32 index)=0
Returns a texture by index.
GLenum target
View transformation.
Definition: IVideoDriver.h:56
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition: matrix4.h:45
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.
Definition: IRenderTarget.h:30
GLboolean enable
GLint GLint GLsizei GLsizei GLsizei depth
Definition: SDL_opengl.h:1572
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.
Definition: IVideoDriver.h:104
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.
Texture transformation.
Definition: IVideoDriver.h:71
virtual void removeAllRenderTargets()=0
Remove all render targets.
Texture transformation.
Definition: IVideoDriver.h:64
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.
Definition: irrArray.h:22
Texture transformation.
Definition: IVideoDriver.h:74
virtual const wchar_t * getName() const =0
Gets name of this video driver.
2d vector template class with lots of operators and methods.
Definition: dimension2d.h:16
E_VIDEO_DRIVER_FEATURE
enumeration for querying features of the video driver.
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
Texture transformation.
Definition: IVideoDriver.h:66
bool setRenderTarget(ITexture *texture, bool clearBackBuffer, bool clearZBuffer, SColor color=SColor(255, 0, 0, 0))
Definition: IVideoDriver.h:577
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 ...
Definition: ITexture.h:22
virtual void draw2DRectangleOutline(const core::recti &pos, SColor color=SColor(255, 255, 255, 255))=0
Draws the outline of a 2D rectangle.
GLuint color
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.
Definition: IVideoDriver.h:731
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.
Definition: ITexture.h:177
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
Definition: SDL_opengl.h:1571
structure for holding data describing a driver and operating system specific data.
Multi-Render target textures.
Definition: IVideoDriver.h:98
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition: S3DVertex.h:18
void drawIndexedTriangleList(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition: IVideoDriver.h:671
Only used internally.
Definition: IVideoDriver.h:86
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.
Definition: IImageWriter.h:25
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.
Definition: S3DVertex.h:192
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.
Definition: SColor.h:573
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.
Definition: SMaterial.h:304
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.
Auxiliary buffer 4.
Definition: IVideoDriver.h:114
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.
Definition: vector2d.h:406
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.