Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IVertexBuffer.hpp
1// Copyright (C) 2008-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_VERTEX_BUFFER_HPP_INCLUDED
6#define NIRT_I_VERTEX_BUFFER_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/irrArray.hpp>
10#include <nirtcpp/core/engine/EHardwareBufferFlags.hpp>
11#include <nirtcpp/core/engine/S3DVertex.hpp>
12
13namespace nirt
14{
15namespace scene
16{
17
18 class IVertexBuffer : public virtual IReferenceCounted
19 {
20 public:
22 virtual void* getData() =0;
23
25 virtual const void* getData() const =0;
26
28 virtual void* pointer() { return getData(); }
29
30 virtual video::E_VERTEX_TYPE getType() const =0;
31 virtual void setType(video::E_VERTEX_TYPE vertexType) =0;
32
34 virtual u32 stride() const =0;
35
37 virtual u32 size() const =0;
38
40 //* Note that if you pass another type than the currently used vertex type then information can be lost */
41 virtual void push_back(const video::S3DVertex &element) =0;
42 virtual void push_back(const video::S3DVertex2TCoords &element) =0;
43 virtual void push_back(const video::S3DVertexTangents &element) =0;
44
46 //* Note that if you pass another type than the currently used vertex type then information can be lost */
47 virtual void setValue(u32 index, const video::S3DVertex &value) =0;
48 virtual void setValue(u32 index, const video::S3DVertex2TCoords &value) =0;
49 virtual void setValue(u32 index, const video::S3DVertexTangents &value) =0;
50
52
54 virtual video::S3DVertex& operator[](u32 index) = 0;
55 virtual video::S3DVertex& operator[](const u32 index) const =0;
56 virtual video::S3DVertex& getLast() =0;
57
58 virtual void set_used(u32 usedNow) =0;
59 virtual void reallocate(u32 new_size, bool canShrink=true) =0;
60 virtual u32 allocated_size() const =0;
61
64
66 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
67
69 virtual void setDirty() =0;
70
72
73 virtual u32 getChangedID() const = 0;
74 };
75
76
77} // end namespace scene
78} // end namespace nirt
79
80#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
Definition IVertexBuffer.hpp:19
virtual void push_back(const video::S3DVertex &element)=0
Add vertex to end.
virtual u32 stride() const =0
Number of bytes per element.
virtual const void * getData() const =0
Const pointer to first element.
virtual void setDirty()=0
flags the meshbuffer as changed, reloads hardware buffers
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0
get the current hardware mapping hint
virtual u32 getChangedID() const =0
Get the currently used ID for identification of changes.
virtual void * pointer()
Same as getData.
Definition IVertexBuffer.hpp:28
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)=0
set the hardware mapping hint, for driver
virtual u32 size() const =0
Number of elements.
virtual void setValue(u32 index, const video::S3DVertex &value)=0
Set value at index. Buffer must be already large enough that element exists.
virtual video::S3DVertex & operator[](u32 index)=0
Direct access to elements. Risky to use!
virtual void * getData()=0
Pointer to first element of vertex data.
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
E_HARDWARE_MAPPING
Definition EHardwareBufferFlags.hpp:14
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.hpp:19
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print