TDME2
1.9.121
src
tdme
engine
subsystems
manager
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
>
7
#include <
tdme/engine/subsystems/manager/fwd-tdme.h
>
8
#include <
tdme/engine/subsystems/renderer/fwd-tdme.h
>
9
#include <
tdme/os/threading/ReadWriteLock.h
>
10
#include <
tdme/utilities/fwd-tdme.h
>
11
12
using
std::string;
13
using
std::unordered_map;
14
15
using
tdme::engine::subsystems::manager::VBOManager_VBOManaged
;
16
using
tdme::engine::subsystems::renderer::Renderer
;
17
using
tdme::os::threading::ReadWriteLock
;
18
19
/**
20
* VBO manager
21
* @author Andreas Drewke
22
* @version $Id$
23
*/
24
class
tdme::engine::subsystems::manager::VBOManager
final
25
{
26
friend
class
VBOManager_VBOManaged
;
27
28
private
:
29
Renderer
*
renderer
{
nullptr
};
30
unordered_map<string, VBOManager_VBOManaged*>
vbos
;
31
ReadWriteLock
rwLock
;
32
33
public
:
34
/**
35
* Public constructor
36
*/
37
VBOManager
(
Renderer
*
renderer
);
38
39
/**
40
* Destructor
41
*/
42
~VBOManager
();
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
};
ReadWriteLock.h
tdme::engine::subsystems::manager::VBOManager_VBOManaged
Managed VBO entity.
Definition:
VBOManager_VBOManaged.h:19
tdme::engine::subsystems::manager::VBOManager
VBO manager.
Definition:
VBOManager.h:25
tdme::engine::subsystems::manager::VBOManager::VBOManager
VBOManager(Renderer *renderer)
Public constructor.
Definition:
VBOManager.cpp:21
tdme::engine::subsystems::manager::VBOManager::~VBOManager
~VBOManager()
Destructor.
Definition:
VBOManager.cpp:25
tdme::engine::subsystems::manager::VBOManager::rwLock
ReadWriteLock rwLock
Definition:
VBOManager.h:31
tdme::engine::subsystems::manager::VBOManager::vbos
unordered_map< string, VBOManager_VBOManaged * > vbos
Definition:
VBOManager.h:30
tdme::engine::subsystems::manager::VBOManager::addVBO
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
tdme::engine::subsystems::manager::VBOManager::getVBO
VBOManager_VBOManaged * getVBO(const string &vboId)
Retrieves a VBO managed from manager.
Definition:
VBOManager.cpp:57
tdme::engine::subsystems::manager::VBOManager::renderer
Renderer * renderer
Definition:
VBOManager.h:29
tdme::engine::subsystems::manager::VBOManager::removeVBO
void removeVBO(const string &vboId)
Removes a VBO from manager.
Definition:
VBOManager.cpp:73
tdme::engine::subsystems::renderer::Renderer
Renderer interface.
Definition:
Renderer.h:45
tdme::os::threading::ReadWriteLock
Implementation for read/write lock.
Definition:
ReadWriteLock.h:21
fwd-tdme.h
fwd-tdme.h
tdme.h
fwd-tdme.h
Generated by
1.9.3