Fillwave  10.0.0
CacheBuffer.h
1 #pragma once
2 
3 /*
4  * The MIT License (MIT)
5  *
6  * Copyright (c) 2018 Filip Wasil and Fillwave community members
7  *
8  * Permission is hereby granted, free of charge, to any person
9  * obtaining a copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation the rights
11  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
12  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included
15  * in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
24 #include <flw/flc/buffers/mVertexBufferPosition.h>
25 #include <flw/flc/buffers/mVertexBufferFloat.h>
26 #include <flw/flc/buffers/mVertexBufferDebug.h>
27 #include <flw/flc/extended/buffers/VertexBufferParticlesGPU.h>
28 #include <flw/flc/buffers/mVertexBufferParticles.h>
29 
30 #include <flw/flf/models/base/IReloadable.h>
31 #include <flw/flf/management/base/TCache.h>
32 
33 namespace flw {
34 namespace flf {
35 
39 struct CacheBuffer {
40  TCache<MAX_CACHE_SIZE
42  , IReloadable *> mVertexArrays;
43 
44  TCache<MAX_CACHE_SIZE
46  , flc::VertexArray*
47  , std::function<float(float x, float y)>
48  , GLint, GLfloat
49  , const std::vector<GLuint> &> mVertices;
50 
51  TCache<MAX_CACHE_SIZE
53  , flc::VertexArray*
54  , const std::vector<GLuint> &> mIndices;
55 
56  TCache<MAX_CACHE_SIZE
58  , flc::VertexArray*
59  , const std::vector<GLfloat>&
60  , const std::vector<GLfloat> &> mVerticesText;
61 
62 #if defined(FILLWAVE_BACKEND_OPENGL_ES_20)
63 #else
64  TCache<MAX_CACHE_SIZE
65  , std::vector<pu<flc::VertexBufferParticlesGPU>>
66  , flc::VertexArray*
67  , const std::vector<flc::VertexParticleGPU> &> mVerticesParticlesGPU;
68 
69 #endif
70  TCache<MAX_CACHE_SIZE
72  , flc::VertexArray*
73  , std::vector<GLfloat>&
74  , std::vector<GLfloat>&
75  , std::vector<GLfloat> &> mVerticesParticles;
76 
77  TCache<MAX_CACHE_SIZE
79  , flc::VertexArray*
80  , GLfloat> mVerticesDebugger;
81 
82  TCache<MAX_CACHE_SIZE
84  , flc::VertexArray*
85  , std::vector<flc::VertexFloat> &> mVerticesFloat;
86 
87  TCache<MAX_CACHE_SIZE
89  , flc::VertexArray*
90  , std::vector<flc::VertexPosition> &> mVerticesPosition;
91 };
92 
93 } /* flf */
94 } /* flw */
Definition: Aliases.h:30
Encapsulates reloadable objects.
Definition: IReloadable.h:35
Vertex buffer specialized with VertexText data structure.
Definition: mVertexBufferText.h:42
Vertex buffer specialized with VertexParticle data structure.
Definition: mVertexBufferParticles.h:43
Not used. Vertex buffer specialized with VertexPosition data structure.
Definition: mVertexBufferPosition.h:41
Basic manager of composites.
Definition: TCache.h:44
VertexArrayObject - VAO.
Definition: VertexArray.h:33
IndexBufferObject - IBO.
Definition: IndexBuffer.h:35
Vertex buffer specialized with VertexDebug data structure.
Definition: mVertexBufferDebug.h:42
Vertex buffer specialized with VertexBasic data structure.
Definition: mVertexBufferBasic.h:61
Connects VAO pointer and VAO&#39;s user pointer in single class.
Definition: CacheBuffer.h:39
Vertex buffer specialized with GLfloat data structure.
Definition: mVertexBufferFloat.h:41