2#include "GLESGraphicsDevice.h"
3#include "GLESCameraManager.h"
5#include <NDEVR/GraphicsSession.h>
6#include <NDEVR/ViewportOptions.h>
7#include <NDEVR/GraphicsUpdateArguments.h>
8#include <NDEVR/Dictionary.h>
10#include <QOpenGLTexture>
11#include <QOpenGLBuffer>
12#include <QOpenGLVertexArrayObject>
55 if (s_session.isNull())
61 s_session->setActive(active);
63 GraphicsDevice::SetDefaultGraphicsDevice(s_session->device());
147 bool m_is_init =
false;
148 bool m_needs_pipeline_update =
false;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
static const DynamicPointer< GLESGraphicsDevice > & DefaultGLESDevice()
Returns the default shared GLES graphics device singleton.
virtual void init(GraphicsUpdateArguments &args) override
Initializes the graphics session for rendering.
DynamicPointer< GLESImageManager > m_image_manager
The shared image manager.
virtual bool runCommand(GraphicsUpdateArguments &) override
No-op command runner for the GLES session.
bool checkPipeline(GeometryUpdateObject &geo_prop, bool add_if_needed)
Validates and optionally creates the pipeline for a specific geometry.
DynamicPointer< GLESCameraManager > getCameraManager(const UUID &camera)
Returns or creates a camera manager for the given camera UUID.
Dictionary< UUID, DynamicPointer< GLESVertexManager > > m_vertex_managers
Per-scene vertex managers.
virtual bool hasCommand() const override
Checks whether there is a pending command.
virtual void drawFrame(GraphicsUpdateArguments &args) override
Draws one complete frame.
virtual void updateUniformBuffer(GraphicsUpdateArguments &args) override
Updates all uniform buffers for the current frame.
virtual const ConstPointer< GraphicsDevice > & device() const override
Returns the graphics device as a const pointer.
virtual void setWindowInstance(WindowInstance *) override
No-op window instance setter.
virtual ~GLESGraphicsSession() override
Destroys the session and releases all managed resources.
bool addRenderGeometry(const Geometry &geo) override
Adds a geometry to the render pipeline.
virtual bool createPipeline(GraphicsUpdateArguments &args) override
Creates or recreates the rendering pipeline.
virtual UUID uuid() override
Returns the UUID of this graphics session.
DynamicPointer< GLESGraphicsDevice > m_device
The GLES graphics device.
virtual DynamicPointer< GraphicsPipeline > createRenderPipeline() override
Creates a new render pipeline for a viewport.
Buffer< GeometryUpdateObject > m_geometries
All tracked geometry update objects.
static const DynamicPointer< GraphicsSession > & DefaultSession()
Returns the default singleton graphics session.
GLESGraphicsSession(const DynamicPointer< GLESGraphicsDevice > &device)
Constructs a GLESGraphicsSession for the given device.
virtual const DynamicPointer< GraphicsDevice > & device() override
Returns the graphics device as a mutable pointer.
void clearAll()
Clears all render objects, managers, and cached state.
Dictionary< UUID, DynamicPointer< GLESCameraManager > > m_camera_managers
Per-camera camera managers.
void removeRenderGeometry(const Geometry &geo) override
Removes a geometry from the render pipeline.
virtual void cleanup() override
No-op cleanup.
virtual void postClearAll() override
No-op post-clear callback.
virtual void cleanResources() override
No-op resource cleanup.
Dictionary< uint08, DynamicPointer< GLESMaterialManager > > m_material_managers
Per-material material managers.
DynamicPointer< GLESShaderManager > m_shader_manager
The shared shader manager.
static UUID GLESRenderEngineID()
Returns the UUID identifying the GLES render engine.
bool checkPipeline(bool add_if_needed)
Validates and optionally creates the render pipeline.
virtual void ensureLastRenderComplete() override
No-op to ensure the last render is complete.
DynamicPointer< GraphicsDevice > m_graphics_device
The abstract graphics device.
Dictionary< uint08, GLESRenderObject * > m_pipelines
Per-material render object pipelines.
virtual void commit(GraphicsUpdateArguments &args) override
Commits all pending changes to the GPU.
virtual void readShader(const StringView &) override
No-op shader reader for the GLES session.
virtual void checkModelStructure(GraphicsUpdateArguments &args)
Checks whether the model structure has changed and updates accordingly.
Structure responsible for handling the OpenGL data surrounding a particular Material object.
A root render Object for OpenGL, which consists of a set Material, Model, and Geometry that is used t...
A Shader for rendering default OpenGL logic to the graphics card.
Manages vertex buffers for the OpenGL engine.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
Options that are used for performing an update on a Graphics Engine call.
Buffer for storing data in the OpenGL engine, usually for rendering.
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
The core String View class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Contains core information about a Viewport.
The primary namespace for the NDEVR SDK.
Tracks a geometry and its last modification time for incremental updates.
static ApplicationOption< UUID > default_render_engine
The UUID of the default rendering engine to use.