NDEVR
API Documentation
GLESBufferManager.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Graphics
28File: VulkanVertexManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "GLESGraphicsDevice.h"
34#include <NDEVR/Model.h>
35#include "GLBuffer.h"
36
37namespace NDEVR
38{
45 {
46 public:
50 GLESVertexManager(const GLESVertexManager& m_pipeline) = delete;
55 Time lastDependencyUpdate() const { return m_last_push_update_time; }
58 Time lastUpdateTime() const { return m_last_updated_time; }
59
63
66 void setScene(const Scene& scene);
68 void commit();
72 void updateExtraBuffer(GraphicsUpdateArguments& args, const StringView& extra_property);
77 void updateExtraBuffer(GraphicsUpdateArguments& args, const Scene& scene, const StringView& extra_property);
88 BitFlag vertexFlags() const { return m_vertex_flags; };
99 uint04 vertexSize() const { return m_vertex_buffer[cast<uint04>(VertexProperty::Position)]->size(); }
102 UUID scene() const { return m_scene; }
103 private:
107 void updateBuffer(const Scene& scene, GraphicsUpdateArguments& args);
111 void updateIndexBuffer(const Scene& scene, GraphicsUpdateArguments& args);
116 void updateVertexBuffer(const Scene& scene, GraphicsUpdateArguments& args, VertexProperty property);
117 private:
119 mutable DynamicPointer<GraphicsBuffer> m_index_buffer;
120 mutable DynamicPointer<GraphicsBuffer> m_vertex_flags_buffer;
122 mutable Dictionary<String, DynamicPointer<GraphicsBuffer>> m_extra_properties;
123 UUID m_scene;
124 Time m_last_updated_time;
125 Time m_last_push_update_time;
126 BitFlag m_vertex_flags;
127 bool m_needs_pipeline_update;
128 bool m_needs_index_buffer_update;
129 };
130}
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition Pointer.hpp:276
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
DynamicPointer< GraphicsBuffer > indexBuffer() const
Returns the index buffer for this vertex manager.
GLESVertexManager(const DynamicPointer< GLESGraphicsDevice > &device)
Constructs a GLESVertexManager for the given graphics device.
void createPipeline(GraphicsUpdateArguments &args)
Creates or recreates the rendering pipeline for the current scene.
void setScene(const Scene &scene)
Sets the scene whose vertex data this manager tracks.
Time lastDependencyUpdate() const
Returns the last time a dependency was pushed to GPU.
void commit()
Commits pending vertex data changes to the GPU.
ConstPointer< GraphicsBuffer > getRenderBuffer(const Scene &scene, const StringView &channel) const
Returns the render buffer for a specific scene and channel.
void updateExtraBuffer(GraphicsUpdateArguments &args, const Scene &scene, const StringView &extra_property)
Updates an extra vertex property buffer for a specific scene.
Time lastUpdateTime() const
Returns the last time vertex data was updated.
Buffer< DynamicPointer< OpenGLBuffer > > getRenderBuffers(GraphicsUpdateArguments &args, const StringView &extra_property) const
Returns all render buffers needed for the given extra property.
void updateExtraBuffer(GraphicsUpdateArguments &args, const StringView &extra_property)
Updates an extra vertex property buffer for the current scene.
UUID scene() const
Returns the UUID of the scene being managed.
BitFlag vertexFlags() const
Returns the active vertex property flags.
~GLESVertexManager()
Destroys the vertex manager and frees GPU resources.
void updateUniformBuffer(GraphicsUpdateArguments &args)
Updates uniform buffer data from the current scene state.
uint04 vertexSize() const
Returns the number of vertices in the position buffer.
Options that are used for performing an update on a Graphics Engine call.
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Scene.h:52
The core String View class for the NDEVR API.
Definition StringView.h:58
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
VertexProperty
Per-vertex data channels that can be stored in the vertex table to be used by Geometry.
@ Position
XYZ position of the vertex.
@ BitFlag
Per-vertex bit flags (selected, hidden, etc.).
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Definition Angle.h:408