TDME2 1.9.121
VBOManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <unordered_map>
5
6#include <tdme/tdme.h>
11
12using std::string;
13using std::unordered_map;
14
18
19/**
20 * VBO manager
21 * @author Andreas Drewke
22 * @version $Id$
23 */
25{
27
28private:
29 Renderer* renderer { nullptr };
30 unordered_map<string, VBOManager_VBOManaged*> vbos;
32
33public:
34 /**
35 * Public constructor
36 */
38
39 /**
40 * Destructor
41 */
43
44 /**
45 * Adds a VBO to manager or retrieve VBO if existing
46 * @param vboId VBO id
47 * @param ids VBOs to allocate
48 * @param useGPUMemory use GPU memory
49 * @param shared shared between different threads
50 * @param created returns if VBO was just created
51 */
52 VBOManager_VBOManaged* addVBO(const string& vboId, int32_t ids, bool useGPUMemory, bool shared, bool& created);
53
54 /**
55 * Retrieves a VBO managed from manager
56 * @param vboId VBO id
57 * @return VBO managed or nullptr
58 */
59 VBOManager_VBOManaged* getVBO(const string& vboId);
60
61 /**
62 * Removes a VBO from manager
63 * @param vboId VBO id
64 */
65 void removeVBO(const string& vboId);
66
67};
VBOManager(Renderer *renderer)
Public constructor.
Definition: VBOManager.cpp:21
unordered_map< string, VBOManager_VBOManaged * > vbos
Definition: VBOManager.h:30
VBOManager_VBOManaged * addVBO(const string &vboId, int32_t ids, bool useGPUMemory, bool shared, bool &created)
Adds a VBO to manager or retrieve VBO if existing.
Definition: VBOManager.cpp:31
VBOManager_VBOManaged * getVBO(const string &vboId)
Retrieves a VBO managed from manager.
Definition: VBOManager.cpp:57
void removeVBO(const string &vboId)
Removes a VBO from manager.
Definition: VBOManager.cpp:73
Implementation for read/write lock.
Definition: ReadWriteLock.h:21