NDEVR
API Documentation
GLESGraphicsDevice.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/GraphicsDevice.h>
4#include <QOpenGLContext>
5#include <QOpenGLExtraFunctions>
6#include <QOpenGLFunctions>
7class QSurface;
8class QOpenGLDebugLogger;
9namespace NDEVR
10{
26
30 class GLESGraphicsDevice : public GraphicsDevice, public QOpenGLExtraFunctions
31 {
32 public:
39 virtual UUID id() const override { return m_id; };
42 virtual bool isValid() const override
43 {
44 return true;
45 }
46
48 QOpenGLContext* context()
49 {
50 return m_context;
51 }
52
54 virtual uint04 maxSupportedSamples() const override
55 {
56 return 1U;
57 }
58
59 virtual void init() override
60 {
61
62 }
63
66 virtual bool isReady() const override
67 {
68 return m_is_init;
69
70 };
71
73 virtual bool isInitialized() const override
74 {
75 return true;
76 }
77
79 virtual bool updateFromLookup() const override
80 {
81 return false;
82 }
83
85 virtual const void* initLockPtr() const override
86 {
87 return this;
88 }
89
91 const GLCapabilities& capabilities() const { return m_capabilities; }
95 bool makeCurrent(QSurface* surface);
98 QSurfaceFormat surfaceFormat() const;
102 protected:
106 QSurface* m_surface = nullptr;
107 QOpenGLContext* m_context = nullptr;
108 QOpenGLDebugLogger* m_logger = nullptr;
110 bool m_is_init = false;
111 protected:
113
114 };
115}
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
QSurfaceFormat surfaceFormat() const
Returns the surface format used by this device.
virtual bool updateFromLookup() const override
Checks whether this device updates from a lookup.
virtual const void * initLockPtr() const override
Returns a pointer used for initialization locking.
UUID m_id
Unique identifier for this device.
bool m_is_init
Whether the device has been initialized.
virtual bool isReady() const override
Checks whether the device is ready for rendering.
bool makeCurrent(QSurface *surface)
Makes the OpenGL context current for the given surface.
virtual UUID id() const override
Returns the unique identifier for this graphics device.
GLESGraphicsDevice()
Default constructor.
virtual ~GLESGraphicsDevice()
Destructor.
virtual bool isInitialized() const override
Checks whether the device has been initialized.
const GLCapabilities & capabilities() const
Returns the hardware capabilities of this device.
QOpenGLDebugLogger * m_logger
Optional OpenGL debug logger.
QOpenGLContext * m_context
The Qt OpenGL context.
virtual void init() override
Initializes the graphics device.
virtual bool isValid() const override
Checks whether this device is valid.
QOpenGLContext * context()
Returns the Qt OpenGL context.
void initialize()
Performs one-time OpenGL initialization and queries device capabilities.
static const DynamicPointer< GLESGraphicsDevice > & DefaultGLESDevice()
Returns the default shared GLES graphics device singleton.
virtual uint04 maxSupportedSamples() const override
Returns the maximum number of MSAA samples supported.
QSurface * m_surface
The current rendering surface.
static DynamicPointer< GraphicsDevice > s_default_graphics_device
The singleton default graphics device.
GLCapabilities m_capabilities
Hardware capability limits.
GraphicsDevice()
Default constructor.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Capabilities provided by a GLESGraphicsDevice.
GLint max_primitive_indices
Maximum number of primitive indices.
GLint uniform_buffer_align_size
Required uniform buffer alignment in bytes.
GLint max_fragment_uniform_vectors
Maximum fragment shader uniform vectors.
GLint max_vertex_uniform_vectors
Maximum vertex shader uniform vectors.
Vector< 2, fltp04 > aliased_line_width_range
Supported line width range.
GLint max_vertices
Maximum number of vertices per draw call.
Vector< 2, fltp04 > aliased_point_size_range
Supported point size range.
GLint max_texture_size
Maximum texture dimension in pixels.
GLint uniform_buffer_min_size
Minimum uniform buffer size in bytes.