LibCarna Version 3.4.0
Loading...
Searching...
No Matches
VertexBuffer.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef VERTEXBUFFER_H_6014714286
16#define VERTEXBUFFER_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
20#include <iterator>
21
27namespace LibCarna
28{
29
30namespace base
31{
32
33
34
35// ----------------------------------------------------------------------------------
36// VertexBufferBase
37// ----------------------------------------------------------------------------------
38
45class LIBCARNA VertexBufferBase : public BaseBuffer
46{
47
48protected:
49
54 void copy( const void* bufferPtr, std::size_t bufferSize, std::size_t verticesCount );
55
56public:
57
62
63}; // VertexBufferBase
64
65
66
67// ----------------------------------------------------------------------------------
68// VertexBuffer
69// ----------------------------------------------------------------------------------
70
76template< typename VertexType >
78{
79
80public:
81
86
91 void copy( const Vertex* verticesPtr, const std::size_t verticesCount );
92
93}; // VertexBuffer
94
95
96template< typename VertexType >
101
102
103
104} // namespace LibCarna :: base
105
106} // namespace LibCarna
107
108#endif // VERTEXBUFFER_H_6014714286
Defines LibCarna::base::BaseBuffer.
Contains forward-declarations.
Represents an association.
Implements OpenGL buffer objects maintenance RAII base class.
Maintains GL_ARRAY_BUFFER object that holds vertices. This class realizes the RAII-idiom.
VertexBufferBase()
Creates GL_ARRAY_BUFFER object.
void copy(const void *bufferPtr, std::size_t bufferSize, std::size_t verticesCount)
Copies verticesCount vertices referenced by bufferPtr to the maintained vertex buffer object.
Specializes VertexBufferBase for particular VertexType.
void copy(const Vertex *verticesPtr, const std::size_t verticesCount)
Copies verticesCount vertices referenced by verticesPtr to the maintained vertex buffer object.
VertexType Vertex
Holds the vertex type maintained by this vertex buffer object.