API Documentation
Loading...
Searching...
No Matches
GLESGraphicsSession.h
Go to the documentation of this file.
1#pragma once
7#include "Base/Headers/UUID.h"
8#include <QOpenGLTexture>
9#include <QOpenGLBuffer>
10#include <QOpenGLVertexArrayObject>
11namespace NDEVR
12{
13 class OpenGLBuffer;
14 class GLESShader;
15 class GLESRenderObject;
16 class GLESVertexManager;
17 class GLESMaterialManager;
18 /**--------------------------------------------------------------------------------------------------
19 \brief Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered
20 data in the OpenGL engine.
21 *-----------------------------------------------------------------------------------------------**/
22 class GLESGraphicsSession : public QObject, public GraphicsSession
23 {
24 Q_OBJECT
25 public:
27 virtual ~GLESGraphicsSession() override;
28 void clearAll();
29 virtual void readShader(const String&) override {}
30 virtual void removeModel(const UUID&) override { m_needs_model_refresh = true; }
31 virtual void removeMaterial(const UUID&) override { m_needs_model_refresh = true; }
32 virtual void removeGeometry(const UUID&) override { m_needs_model_refresh = true; }
35 virtual void postClearAll() override
36 {
37
38 }
39 virtual void setupScene(GraphicsUpdateArguments& args) override;
40 void addRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property) override;
41
42 virtual UUID uuid() override
43 {
44 return m_device->id();
45 };
46
47
48 virtual bool runCommand(GraphicsUpdateArguments&) override
49 {
50 return true;
51 }
53 virtual void commit(GraphicsUpdateArguments& args) override;
54 virtual void updateUniformBuffer(GraphicsUpdateArguments& args) override;
55 virtual bool createPipeline(GraphicsUpdateArguments& args) override;
56 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) = 0;
57 virtual const ConstPointer<GraphicsDevice>& device() const override;
58 virtual const DynamicPointer<GraphicsDevice>& device() override;
59 virtual bool hasCommand() const override
60 {
61 return true;
62 }
63 virtual void drawFrame(GraphicsUpdateArguments& args) override;
64 virtual void ensureLastRenderComplete() override {};
65 virtual void cleanup() override {};
66 virtual void setWindowInstance(WindowInstance*) override {};
67 virtual void cleanResources() override {};
68 virtual void init(GraphicsUpdateArguments& args) override;
69 protected:
77 private:
78 bool m_is_init = false;
79 };
80
81}
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered.
Definition GLESGraphicsSession.h:23
virtual UUID uuid() override
Definition GLESGraphicsSession.h:42
virtual void setWindowInstance(WindowInstance *) override
Definition GLESGraphicsSession.h:66
virtual ~GLESGraphicsSession() override
Definition GLESGraphicsSession.cpp:19
virtual void cleanup() override
Definition GLESGraphicsSession.h:65
Dictionary< UUID, DynamicPointer< GLESMaterialManager > > m_material_managers
Definition GLESGraphicsSession.h:72
virtual void readShader(const String &) override
Definition GLESGraphicsSession.h:29
virtual void ensureLastRenderComplete() override
Definition GLESGraphicsSession.h:64
virtual void postClearAll() override
Definition GLESGraphicsSession.h:35
virtual void init(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:174
virtual void cleanResources() override
Definition GLESGraphicsSession.h:67
virtual void setupScene(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:179
virtual void drawFrame(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:153
virtual void updateUniformBuffer(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:65
void clearAll()
Definition GLESGraphicsSession.cpp:221
GLESGraphicsSession(const DynamicPointer< GLESGraphicsDevice > &device)
Definition GLESGraphicsSession.cpp:12
DynamicPointer< GLESGraphicsDevice > m_device
Definition GLESGraphicsSession.h:74
Dictionary< UUID, DynamicPointer< GLESVertexManager > > m_vertex_managers
Definition GLESGraphicsSession.h:71
virtual DynamicPointer< GraphicsPipeline > createRenderPipeline() override
Definition GLESGraphicsSession.cpp:29
virtual void removeMaterial(const UUID &) override
Definition GLESGraphicsSession.h:31
DynamicPointer< GraphicsDevice > m_graphics_device
Definition GLESGraphicsSession.h:75
virtual void commit(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:56
virtual void removeModel(const UUID &) override
Definition GLESGraphicsSession.h:30
virtual const ConstPointer< GraphicsDevice > & device() const override
Definition GLESGraphicsSession.cpp:145
Dictionary< UUID, DynamicPointer< GLESCameraManager > > m_camera_managers
Definition GLESGraphicsSession.h:70
Dictionary< UUID, GLESRenderObject * > m_pipelines
Definition GLESGraphicsSession.h:73
DynamicPointer< GLESShaderManager > m_shader_manager
Definition GLESGraphicsSession.h:76
virtual bool createPipeline(GraphicsUpdateArguments &args) override
Definition GLESGraphicsSession.cpp:106
DynamicPointer< GLESCameraManager > getCameraManager(const UUID &camera)
Definition GLESGraphicsSession.cpp:34
virtual bool hasCommand() const override
Definition GLESGraphicsSession.h:59
virtual bool runCommand(GraphicsUpdateArguments &) override
Definition GLESGraphicsSession.h:48
virtual void checkModelStructure(GraphicsUpdateArguments &args)
Definition GLESGraphicsSession.cpp:46
void addRenderObject(const Scene &scene, const Model &model, const Material &mat, const Geometry &mesh, PrimitiveProperty property) override
Definition GLESGraphicsSession.cpp:189
virtual void removeGeometry(const UUID &) override
Definition GLESGraphicsSession.h:32
A core class within the model heirarchy containing data (Usually 3D data) within a set container.
Definition Geometry.h:54
Definition GraphicsSession.h:16
bool m_needs_model_refresh
Definition GraphicsSession.h:38
Definition GraphicsUpdateArguments.h:40
Definition Material.h:45
Definition Model.h:54
Definition Model.h:491
The core String class for the software.
Definition String.h:47
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:62
Definition ACIColor.h:37
PrimitiveProperty
Definition DesignObjectBase.h:44
QAction * mesh(nullptr)