Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IVideoDriver.hpp
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 nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_VIDEO_DRIVER_HPP_INCLUDED
6#define NIRT_I_VIDEO_DRIVER_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/rect.hpp>
9#include <nirtcpp/core/engine/SColor.hpp>
10#include <nirtcpp/core/engine/ITexture.hpp>
11#include <nirtcpp/core/engine/irrArray.hpp>
12#include <nirtcpp/core/engine/matrix4.hpp>
13#include <nirtcpp/core/engine/plane3d.hpp>
14#include <nirtcpp/core/engine/dimension2d.hpp>
15#include <nirtcpp/core/engine/position2d.hpp>
16#include <nirtcpp/core/engine/IMeshBuffer.hpp>
17#include <nirtcpp/core/engine/triangle3d.hpp>
18#include <nirtcpp/core/engine/EDriverTypes.hpp>
19#include <nirtcpp/core/engine/EDriverFeatures.hpp>
20#include <nirtcpp/core/engine/SExposedVideoData.hpp>
21#include <nirtcpp/core/engine/SOverrideMaterial.hpp>
22
23namespace nirt
24{
25namespace io
26{
27 class IAttributes;
28 class SAttributeReadWriteOptions;
29 class IReadFile;
30 class IWriteFile;
31} // end namespace io
32namespace scene
33{
34 class IMeshBuffer;
35 class IMesh;
36 class IMeshManipulator;
37 class ISceneNode;
38} // end namespace scene
39
40namespace video
41{
42 class S3DVertex;
43 class S3DVertex2TCoords;
44 class S3DVertexTangents;
45 class SLight;
46 class IImageLoader;
47 class IImageWriter;
48 class IMaterialRenderer;
49 class IGPUProgrammingServices;
50 class IRenderTarget;
51
54 {
69#if _NIRT_MATERIAL_MAX_TEXTURES_>4
71 ETS_TEXTURE_4,
72#if _NIRT_MATERIAL_MAX_TEXTURES_>5
74 ETS_TEXTURE_5,
75#if _NIRT_MATERIAL_MAX_TEXTURES_>6
77 ETS_TEXTURE_6,
78#if _NIRT_MATERIAL_MAX_TEXTURES_>7
80 ETS_TEXTURE_7,
81#endif
82#endif
83#endif
84#endif
86 ETS_COUNT = ETS_TEXTURE_0 + _NIRT_MATERIAL_MAX_TEXTURES_
87 };
88
90
116
119 {
120 ECBF_NONE = 0,
121 ECBF_COLOR = 1,
122 ECBF_DEPTH = 2,
123 ECBF_STENCIL = 4,
124 ECBF_ALL = ECBF_COLOR|ECBF_DEPTH|ECBF_STENCIL
125 };
126
129 {
130 EFT_FOG_EXP=0,
131 EFT_FOG_LINEAR,
132 EFT_FOG_EXP2
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
251
253
254 virtual u32 getImageWriterCount() const = 0;
255
257
261
263
265 virtual void setMaterial(const SMaterial& material) =0;
266
268
277 virtual ITexture* getTexture(const io::path& filename) = 0;
278
280
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
321 const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
322
324
333 NIRT_DEPRECATED ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData)
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 nirt::u32 sideLen, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
374
376
389 const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
390
392
401 const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
402
404
411 virtual void removeTexture(ITexture* texture) =0;
412
414
420 virtual void removeAllTextures() =0;
421
423 virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0;
424
426 virtual void removeAllHardwareBuffers() =0;
427
429
431 const scene::IMesh* mesh=0) =0;
432
435
437 virtual void removeAllOcclusionQueries() =0;
438
440
442 virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0;
443
445
447 virtual void runAllOcclusionQueries(bool visible=false) =0;
448
450
452 virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0;
453
455
457 virtual void updateAllOcclusionQueries(bool block=true) =0;
458
460
463 virtual u32 getOcclusionQueryResult(const scene::ISceneNode* node) const =0;
464
467
469 virtual void removeRenderTarget(IRenderTarget* renderTarget) = 0;
470
472 virtual void removeAllRenderTargets() = 0;
473
475
492 video::SColor color,
493 bool zeroTexels = false) const =0;
494
496
509 core::position2d<s32> colorKeyPixelPos,
510 bool zeroTexels = false) const =0;
511
513
524 virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
525
527
541 virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),
542 f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
543
545
573 virtual bool setRenderTarget(ITexture* texture, u16 clearFlag=ECBF_COLOR|ECBF_DEPTH, SColor clearColor = SColor(255,0,0,0),
574 f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
575
579 bool setRenderTarget(ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color = SColor(255,0,0,0))
580 {
581 u16 flag = 0;
582
583 if (clearBackBuffer)
584 flag |= ECBF_COLOR;
585
586 if (clearZBuffer)
587 flag |= ECBF_DEPTH;
588
589 return setRenderTarget(texture, flag, color);
590 }
591
593
596 virtual void setViewPort(const core::rect<s32>& area) =0;
597
599
600 virtual const core::rect<s32>& getViewPort() const =0;
601
603
617 virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
618 const void* indexList, u32 primCount,
621 E_INDEX_TYPE iType=EIT_16BIT) =0;
622
624
643 virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,
644 const void* indexList, u32 primCount,
647 E_INDEX_TYPE iType=EIT_16BIT) =0;
648
650
658 void drawIndexedTriangleList(const S3DVertex* vertices,
659 u32 vertexCount, const u16* indexList, u32 triangleCount)
660 {
661 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
662 }
663
665
674 u32 vertexCount, const u16* indexList, u32 triangleCount)
675 {
676 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT);
677 }
678
680
689 u32 vertexCount, const u16* indexList, u32 triangleCount)
690 {
691 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT);
692 }
693
695
703 void drawIndexedTriangleFan(const S3DVertex* vertices,
704 u32 vertexCount, const u16* indexList, u32 triangleCount)
705 {
706 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
707 }
708
710
719 u32 vertexCount, const u16* indexList, u32 triangleCount)
720 {
721 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
722 }
723
725
734 u32 vertexCount, const u16* indexList, u32 triangleCount)
735 {
736 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
737 }
738
740
754 virtual void draw3DLine(const core::vector3df& start,
755 const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
756
758
771 virtual void draw3DTriangle(const core::triangle3df& triangle,
772 SColor color = SColor(255,255,255,255)) =0;
773
775
786 virtual void draw3DBox(const core::aabbox3d<f32>& box,
787 SColor color = SColor(255,255,255,255)) =0;
788
790
795 virtual void draw2DImage(const video::ITexture* texture,
796 const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture=false) =0;
797
799
814 virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
815 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
816 SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
817
819
838 virtual void draw2DImageBatch(const video::ITexture* texture,
839 const core::position2d<s32>& pos,
840 const core::array<core::rect<s32> >& sourceRects,
841 const core::array<s32>& indices,
842 s32 kerningWidth=0,
843 const core::rect<s32>* clipRect=0,
844 SColor color=SColor(255,255,255,255),
845 bool useAlphaChannelOfTexture=false) =0;
846
848
863 virtual void draw2DImageBatch(const video::ITexture* texture,
864 const core::array<core::position2d<s32> >& positions,
865 const core::array<core::rect<s32> >& sourceRects,
866 const core::rect<s32>* clipRect=0,
867 SColor color=SColor(255,255,255,255),
868 bool useAlphaChannelOfTexture=false) =0;
869
871
880 virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
881 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
882 const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;
883
885
892 virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
893 const core::rect<s32>* clip =0) =0;
894
896
912 virtual void draw2DRectangle(const core::rect<s32>& pos,
913 SColor colorLeftUp, SColor colorRightUp,
914 SColor colorLeftDown, SColor colorRightDown,
915 const core::rect<s32>* clip =0) =0;
916
918
921 virtual void draw2DRectangleOutline(const core::recti& pos,
922 SColor color=SColor(255,255,255,255)) =0;
923
925
933 virtual void draw2DLine(const core::position2d<s32>& start,
934 const core::position2d<s32>& end,
935 SColor color=SColor(255,255,255,255)) =0;
936
938
941 virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
942
944
957 f32 radius,
958 video::SColor color=SColor(100,255,255,255),
959 s32 vertexCount=10) =0;
960
962
975 virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;
976
978
997 virtual void drawStencilShadow(bool clearStencilBuffer=false,
998 video::SColor leftUpEdge = video::SColor(255,0,0,0),
999 video::SColor rightUpEdge = video::SColor(255,0,0,0),
1000 video::SColor leftDownEdge = video::SColor(255,0,0,0),
1001 video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
1002
1004
1005 virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
1006
1008
1012 virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f, SColor color=0xffffffff) =0;
1013
1015
1031 virtual void setFog(SColor color=SColor(0,255,255,255),
1032 E_FOG_TYPE fogType=EFT_FOG_LINEAR,
1033 f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,
1034 bool pixelFog=false, bool rangeFog=false) =0;
1035
1037 virtual void getFog(SColor& color, E_FOG_TYPE& fogType,
1038 f32& start, f32& end, f32& density,
1039 bool& pixelFog, bool& rangeFog) = 0;
1040
1042
1043 virtual ECOLOR_FORMAT getColorFormat() const =0;
1044
1046
1047 virtual const core::dimension2d<u32>& getScreenSize() const =0;
1048
1050
1055
1057
1062 virtual s32 getFPS() const =0;
1063
1065
1069 virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0;
1070
1072 virtual void deleteAllDynamicLights() =0;
1073
1077 virtual s32 addDynamicLight(const SLight& light) =0;
1078
1080
1082
1084
1085 virtual u32 getDynamicLightCount() const =0;
1086
1088
1091 virtual const SLight& getDynamicLight(u32 idx) const =0;
1092
1096 virtual void turnLightOn(s32 lightIndex, bool turnOn) =0;
1097
1099
1101 virtual const wchar_t* getName() const =0;
1102
1104
1110 virtual void addExternalImageLoader(IImageLoader* loader) =0;
1111
1113
1119 virtual void addExternalImageWriter(IImageWriter* writer) =0;
1120
1122
1125 virtual u32 getMaximalPrimitiveCount() const =0;
1126
1128
1137 virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true) =0;
1138
1140
1144
1146
1154 virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) = 0;
1155
1157
1166
1168
1177 {
1178 core::array<IImage*> imageArray = createImagesFromFile(filename);
1179
1180 for (u32 i = 1; i < imageArray.size(); ++i)
1181 imageArray[i]->drop();
1182
1183 return (imageArray.size() > 0) ? imageArray[0] : 0;
1184 }
1185
1187
1195 {
1196 core::array<IImage*> imageArray = createImagesFromFile(file);
1197
1198 for (u32 i = 1; i < imageArray.size(); ++i)
1199 imageArray[i]->drop();
1200
1201 return (imageArray.size() > 0) ? imageArray[0] : 0;
1202 }
1203
1205
1212 virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0;
1213
1215
1223 virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0;
1224
1226
1244 const core::dimension2d<u32>& size, void *data, bool ownForeignMemory = false,
1245 bool deleteMemory = true) = 0;
1246
1248
1254 virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) =0;
1255
1257
1263 NIRT_DEPRECATED virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0;
1264
1266
1273 NIRT_DEPRECATED virtual IImage* createImage(IImage* imageToCopy,
1274 const core::position2d<s32>& pos,
1275 const core::dimension2d<u32>& size) =0;
1276
1278
1285 virtual IImage* createImage(ITexture* texture,
1286 const core::position2d<s32>& pos,
1287 const core::dimension2d<u32>& size) =0;
1288
1290
1292 virtual void OnResize(const core::dimension2d<u32>& size) =0;
1293
1295
1315 virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0;
1316
1318
1323
1325
1326 virtual u32 getMaterialRendererCount() const =0;
1327
1329
1338 virtual const c8* getMaterialRendererName(u32 idx) const =0;
1339
1341
1346 virtual void setMaterialRendererName(u32 idx, const c8* name) =0;
1347
1349
1356 virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames=true) = 0;
1357
1359
1369 io::SAttributeReadWriteOptions* options=0) =0;
1370
1372
1379
1381
1385
1387
1388 virtual E_DRIVER_TYPE getDriverType() const =0;
1389
1391
1395
1398
1400 virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0;
1401
1403 NIRT_DEPRECATED void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
1404 {
1405 u16 flag = 0;
1406
1407 if (backBuffer)
1408 flag |= ECBF_COLOR;
1409
1410 if (depthBuffer)
1411 flag |= ECBF_DEPTH;
1412
1413 if (stencilBuffer)
1414 flag |= ECBF_STENCIL;
1415
1416 clearBuffers(flag, color);
1417 }
1418
1420
1427 {
1428 clearBuffers(ECBF_DEPTH, SColor(255,0,0,0), 1.f, 0);
1429 }
1430
1432
1436
1438
1442 virtual video::ITexture* findTexture(const io::path& filename) = 0;
1443
1445
1453 virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0;
1454
1456
1462 virtual void enableClipPlane(u32 index, bool enable) =0;
1463
1465
1466 virtual void setMinHardwareBufferVertexCount(u32 count) =0;
1467
1469
1474
1476
1490
1492
1494 virtual void enableMaterial2D(bool enable=true) =0;
1495
1498
1500
1503 virtual void setAmbientLight(const SColorf& color) =0;
1504
1506
1509 virtual void setAllowZWriteOnTransparent(bool flag) =0;
1510
1513
1515
1524 virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
1525 void* dP, ECOLOR_FORMAT dF) const =0;
1526
1528
1529 virtual bool queryTextureFormat(ECOLOR_FORMAT format) const = 0;
1530
1532 virtual bool needsTransparentRenderPass(const nirt::video::SMaterial& material) const = 0;
1533 };
1534
1535} // end namespace video
1536} // end namespace nirt
1537
1538
1539#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.hpp:126
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
Self reallocating template array (like stl vector) with additional features.
Definition irrArray.hpp:23
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
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 s32 getFPS() const =0
Returns current frames per second value.
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.
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.
virtual u32 getMaximalPrimitiveCount() const =0
Returns the maximum amount of primitives.
virtual scene::IMeshManipulator * getMeshManipulator()=0
Returns a pointer to the mesh manipulator.
virtual void updateOcclusionQuery(scene::ISceneNode *node, bool block=true)=0
Update occlusion query. Retrieves results from GPU.
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 const SLight & getDynamicLight(u32 idx) const =0
Returns light data which was previously set by IVideoDriver::addDynamicLight().
virtual void addExternalImageWriter(IImageWriter *writer)=0
Adds an external image writer to the engine.
virtual void setViewPort(const core::rect< s32 > &area)=0
Sets a new viewport.
IImage * createImageFromFile(io::IReadFile *file)
Creates a software image from a file.
Definition IVideoDriver.hpp:1194
NIRT_DEPRECATED ITexture * addTexture(const io::path &name, IImage *image, void *mipmapData)
Creates a texture from an IImage.
Definition IVideoDriver.hpp:333
void drawIndexedTriangleFan(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:718
virtual const core::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
virtual const wchar_t * getName() const =0
Gets name of this video driver.
virtual void addOcclusionQuery(scene::ISceneNode *node, const scene::IMesh *mesh=0)=0
Create occlusion query.
virtual bool checkDriverReset()=0
Check if the driver was recently reset.
virtual ITexture * addTexture(const io::path &name, IImage *image)=0
Creates a texture from an IImage.
virtual void OnResize(const core::dimension2d< u32 > &size)=0
Event handler for resize events. Only used by the engine internally.
virtual void draw2DImageBatch(const video::ITexture *texture, const core::array< core::position2d< s32 > > &positions, const core::array< core::rect< s32 > > &sourceRects, 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.
virtual void removeAllOcclusionQueries()=0
Remove all occlusion queries.
virtual void setMinHardwareBufferVertexCount(u32 count)=0
Set the minimum number of vertices for which a hw buffer will be created.
virtual void convertColor(const void *sP, ECOLOR_FORMAT sF, s32 sN, void *dP, ECOLOR_FORMAT dF) const =0
Color conversion convenience function.
void drawIndexedTriangleList(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:658
virtual const core::dimension2d< u32 > & getCurrentRenderTargetSize() const =0
Get the size of the current render target.
virtual const core::rect< s32 > & getViewPort() const =0
Gets the area of the current viewport.
virtual IGPUProgrammingServices * getGPUProgrammingServices()=0
Gets the IGPUProgrammingServices interface.
virtual u32 getMaterialRendererCount() const =0
Get amount of currently available material renderers.
void clearZBuffer()
Clears the ZBuffer.
Definition IVideoDriver.hpp:1426
IImage * createImageFromFile(const io::path &filename)
Creates a software image from a file.
Definition IVideoDriver.hpp:1176
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 void drawMeshBuffer(const scene::IMeshBuffer *mb)=0
Draws a mesh buffer.
virtual void renameTexture(ITexture *texture, const io::path &newName)=0
Renames a texture.
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true)=0
Enables or disables a texture creation flag.
virtual const io::IAttributes & getDriverAttributes() const =0
Get attributes of the actual video driver.
virtual ITexture * addRenderTargetTextureCubemap(const nirt::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.
virtual bool writeImageToFile(IImage *image, const io::path &filename, u32 param=0)=0
Writes the provided image to a file.
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0
Returns if a texture creation flag is enabled or disabled.
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 u32 getOcclusionQueryResult(const scene::ISceneNode *node) const =0
Return query result.
virtual core::array< IImage * > createImagesFromFile(const io::path &filename, E_TEXTURE_TYPE *type=0)=0
Creates a software images from a file.
virtual void removeAllHardwareBuffers()=0
Remove all hardware buffers.
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 video::ITexture * findTexture(const io::path &filename)=0
Check if the image is already loaded.
virtual NIRT_DEPRECATED IImage * createImage(IImage *imageToCopy, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0
Creates a software image from a part of another image.
virtual ECOLOR_FORMAT getColorFormat() const =0
Get the current color format of the color buffer.
virtual void draw2DRectangle(SColor color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0
Draws a 2d rectangle.
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 disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true)=0
Disable a feature of the driver.
virtual io::IAttributes * createAttributesFromMaterial(const video::SMaterial &material, io::SAttributeReadWriteOptions *options=0)=0
Creates material attributes list from a material.
virtual void drawPixel(u32 x, u32 y, const SColor &color)=0
Draws a pixel.
void drawIndexedTriangleFan(const S3DVertex *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:703
virtual void draw3DBox(const core::aabbox3d< f32 > &box, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d axis aligned box.
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.
virtual u32 getImageLoaderCount() const =0
Retrieve the number of image loaders.
virtual void turnLightOn(s32 lightIndex, bool turnOn)=0
void drawIndexedTriangleList(const S3DVertex2TCoords *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:673
virtual void removeHardwareBuffer(const scene::IMeshBuffer *mb)=0
Remove hardware buffer.
bool setRenderTarget(ITexture *texture, bool clearBackBuffer, bool clearZBuffer, SColor color=SColor(255, 0, 0, 0))
Definition IVideoDriver.hpp:579
virtual ITexture * getTexture(io::IReadFile *file)=0
Get access to a named texture.
virtual NIRT_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, io::IWriteFile *file, u32 param=0)=0
Writes the provided image to a file.
virtual void setAllowZWriteOnTransparent(bool flag)=0
Only used by the engine internally.
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 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 IImage * createImage(ITexture *texture, const core::position2d< s32 > &pos, const core::dimension2d< u32 > &size)=0
Creates a software image from a part of a texture.
virtual IImageWriter * getImageWriter(u32 n)=0
Retrieve the given image writer.
void drawIndexedTriangleList(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle list.
Definition IVideoDriver.hpp:688
virtual core::array< IImage * > createImagesFromFile(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 s32 addMaterialRenderer(IMaterialRenderer *renderer, const c8 *name=0)=0
Adds a new material renderer to the video device.
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.
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 void draw2DImage(const video::ITexture *texture, const core::rect< s32 > &destRect, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect=0, const 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 IImage * createImage(ECOLOR_FORMAT format, const core::dimension2d< u32 > &size)=0
Creates an empty software image.
virtual void setAmbientLight(const SColorf &color)=0
Only used by the engine internally.
virtual void removeRenderTarget(IRenderTarget *renderTarget)=0
Remove render target.
virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames=true)=0
Swap the material renderers used for certain id's.
virtual u32 getImageWriterCount() const =0
Retrieve the number of image writers.
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0
Queries the features of the driver.
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 fillMaterialStructureFromAttributes(video::SMaterial &outMaterial, io::IAttributes *attributes)=0
Fills an SMaterial class from attributes.
virtual bool needsTransparentRenderPass(const nirt::video::SMaterial &material) const =0
Used by some SceneNodes to check if a material should be rendered in the transparent render pass.
virtual IMaterialRenderer * getMaterialRenderer(u32 idx) const =0
Get access to a material renderer by index.
virtual void runOcclusionQuery(scene::ISceneNode *node, bool visible=false)=0
Run occlusion query. Draws mesh stored in query.
virtual SMaterial & getMaterial2D()=0
Get the 2d override material for altering its values.
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 void draw3DLine(const core::vector3df &start, const core::vector3df &end, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d line.
virtual E_DRIVER_TYPE getDriverType() const =0
Get type of video driver.
virtual void drawMeshBufferNormals(const scene::IMeshBuffer *mb, f32 length=10.f, SColor color=0xffffffff)=0
Draws normals of a mesh buffer.
virtual void draw3DTriangle(const core::triangle3df &triangle, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d triangle.
void drawIndexedTriangleFan(const S3DVertexTangents *vertices, u32 vertexCount, const u16 *indexList, u32 triangleCount)
Draws an indexed triangle fan.
Definition IVideoDriver.hpp:733
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.
virtual const core::dimension2d< u32 > & getScreenSize() const =0
Get the size of the screen or render window.
virtual void updateAllOcclusionQueries(bool block=true)=0
Update all occlusion queries. Retrieves results from GPU.
virtual void enableMaterial2D(bool enable=true)=0
Enable the 2d override material.
virtual ITexture * getTexture(const io::path &filename)=0
Get access to a named texture.
virtual s32 addDynamicLight(const SLight &light)=0
virtual void makeNormalMapTexture(video::ITexture *texture, f32 amplitude=1.0f) const =0
Creates a normal map from a height map texture.
virtual void removeTexture(ITexture *texture)=0
Removes a texture from the texture cache and deletes it.
virtual void draw2DRectangleOutline(const core::recti &pos, SColor color=SColor(255, 255, 255, 255))=0
Draws the outline of a 2D rectangle.
virtual SOverrideMaterial & getOverrideMaterial()=0
Get the global Material, which might override local materials.
virtual bool queryTextureFormat(ECOLOR_FORMAT format) const =0
Check if the driver supports creating textures with the given color format.
virtual void removeOcclusionQuery(scene::ISceneNode *node)=0
Remove occlusion query.
virtual ITexture * addTextureCubemap(const nirt::u32 sideLen, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
Creates an empty cubemap texture of specified size.
virtual u32 getTextureCount() const =0
Returns amount of textures currently loaded.
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 core::stringc getVendorInfo()=0
Get the graphics card vendor name.
virtual void makeColorKeyTexture(video::ITexture *texture, core::position2d< s32 > colorKeyPixelPos, bool zeroTexels=false) const =0
Sets a boolean alpha channel on the texture based on the color at a position.
virtual IImageLoader * getImageLoader(u32 n)=0
Retrieve the given image loader.
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 IRenderTarget * addRenderTarget()=0
Create render target.
virtual void enableClipPlane(u32 index, bool enable)=0
Enable or disable a clipping plane.
virtual void removeAllTextures()=0
Removes all textures from the texture cache and deletes them.
NIRT_DEPRECATED void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
Clear the color, depth and/or stencil buffers.
Definition IVideoDriver.hpp:1403
virtual void addExternalImageLoader(IImageLoader *loader)=0
Adds an external image loader to the engine.
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.
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.hpp:173
virtual void setMaterial(const SMaterial &material)=0
Sets a material.
virtual void draw2DImage(const video::ITexture *texture, const core::position2d< s32 > &destPos, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect=0, SColor color=SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture=false)=0
Draws a 2d image using a color.
virtual u32 getDynamicLightCount() const =0
Returns amount of dynamic lights currently set.
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.
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0
Sets transformation matrices.
virtual void removeAllRenderTargets()=0
Remove all render targets.
virtual u32 getPrimitiveCountDrawn(u32 mode=0) const =0
Returns amount of primitives (mostly triangles) which were drawn in the last frame.
virtual ITexture * getTextureByIndex(u32 index)=0
Returns a texture by index.
virtual const c8 * getMaterialRendererName(u32 idx) const =0
Get name of a material renderer.
virtual u32 getMaximalDynamicLightAmount() const =0
Returns the maximal amount of dynamic lights the device can handle.
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 bool setClipPlane(u32 index, const core::plane3df &plane, bool enable=false)=0
Set or unset a clipping plane.
virtual void setMaterialRendererName(u32 idx, const c8 *name)=0
Sets the name of a material renderer.
virtual void deleteAllDynamicLights()=0
Deletes all dynamic lights which were previously added with addDynamicLight().
virtual bool endScene()=0
Presents the rendered image to the screen.
virtual void draw2DRectangle(const core::rect< s32 > &pos, SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, const core::rect< s32 > *clip=0)=0
Draws a 2d rectangle with a gradient.
virtual void runAllOcclusionQueries(bool visible=false)=0
Run all occlusion queries. Draws all meshes stored in queries.
virtual core::dimension2du getMaxTextureSize() const =0
Get the maximum texture size supported.
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 Nirtcpp 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_TRIANGLES
Explicitly set all vertices for each triangle.
Definition EPrimitiveTypes.hpp:37
@ EPT_TRIANGLE_FAN
Definition EPrimitiveTypes.hpp:34
E_TRANSFORMATION_STATE
enumeration for geometry transformation states
Definition IVideoDriver.hpp:54
@ ETS_TEXTURE_1
Texture transformation.
Definition IVideoDriver.hpp:64
@ ETS_VIEW
View transformation.
Definition IVideoDriver.hpp:56
@ ETS_WORLD
World transformation.
Definition IVideoDriver.hpp:58
@ ETS_TEXTURE_3
Texture transformation.
Definition IVideoDriver.hpp:68
@ ETS_TEXTURE_2
Texture transformation.
Definition IVideoDriver.hpp:66
@ ETS_PROJECTION
Projection transformation.
Definition IVideoDriver.hpp:60
@ ETS_TEXTURE_0
Texture transformation.
Definition IVideoDriver.hpp:62
@ ETS_COUNT
Only used internally.
Definition IVideoDriver.hpp:86
E_CLEAR_BUFFER_FLAG
Enum for the flags of clear buffer.
Definition IVideoDriver.hpp:119
E_RENDER_TARGET
Special render targets, which usually map to dedicated hardware.
Definition IVideoDriver.hpp:92
@ ERT_AUX_BUFFER3
Auxiliary buffer 3.
Definition IVideoDriver.hpp:112
@ ERT_STEREO_BOTH_BUFFERS
Render to both stereo buffers at once.
Definition IVideoDriver.hpp:104
@ ERT_AUX_BUFFER1
Auxiliary buffer 1.
Definition IVideoDriver.hpp:108
@ ERT_FRAME_BUFFER
Render target is the main color frame buffer.
Definition IVideoDriver.hpp:94
@ ERT_MULTI_RENDER_TEXTURES
Multi-Render target textures.
Definition IVideoDriver.hpp:98
@ ERT_RENDER_TEXTURE
Render target is a render texture.
Definition IVideoDriver.hpp:96
@ ERT_AUX_BUFFER0
Auxiliary buffer 0.
Definition IVideoDriver.hpp:106
@ ERT_AUX_BUFFER2
Auxiliary buffer 2.
Definition IVideoDriver.hpp:110
@ ERT_STEREO_RIGHT_BUFFER
Render target is the right color buffer (left is the main buffer)
Definition IVideoDriver.hpp:102
@ ERT_STEREO_LEFT_BUFFER
Render target is the main color frame buffer.
Definition IVideoDriver.hpp:100
@ ERT_AUX_BUFFER4
Auxiliary buffer 4.
Definition IVideoDriver.hpp:114
ECOLOR_FORMAT
An enum for the color format of textures used by the Nirtcpp Engine.
Definition SColor.hpp:21
@ ECF_UNKNOWN
Unknown color format:
Definition SColor.hpp:132
@ ECF_A8R8G8B8
Definition SColor.hpp:38
E_DRIVER_TYPE
An enum for all types of drivers the Nirtcpp Engine supports.
Definition EDriverTypes.hpp:17
E_TEXTURE_TYPE
Enumeration describing the type of ITexture.
Definition ITexture.hpp:168
E_VIDEO_DRIVER_FEATURE
enumeration for querying features of the video driver.
Definition EDriverFeatures.hpp:15
E_FOG_TYPE
Enum for the types of fog distributions to choose from.
Definition IVideoDriver.hpp:129
E_TEXTURE_CREATION_FLAG
Enumeration flags used to tell the video driver with setTextureCreationFlag in which format textures ...
Definition ITexture.hpp:23
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.hpp:19
@ EVT_2TCOORDS
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Definition S3DVertex.hpp:25
@ EVT_STANDARD
Standard vertex type used by the Nirtcpp engine, video::S3DVertex.
Definition S3DVertex.hpp:21
@ EVT_TANGENTS
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
Definition S3DVertex.hpp:31
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned short u16
16 bit unsigned variable.
Definition irrTypes.hpp:46
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned char u8
8 bit unsigned variable.
Definition irrTypes.hpp:24
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
char c8
8 bit character variable.
Definition irrTypes.hpp:37
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print