NDEVR
API Documentation
GLESGraphicsWindow

The core Window used to render a viewport with OpenGL. More...

Inheritance diagram for GLESGraphicsWindow:
[legend]
Collaboration diagram for GLESGraphicsWindow:
[legend]

Public Member Functions

 GLESGraphicsWindow (QWindow *parent, Qt::WindowFlags flags)
 Constructs a GLESGraphicsWindow.
 ~GLESGraphicsWindow ()
 Destroys the window and releases OpenGL resources.
bool event (QEvent *event) override
 Handles general window events.
void exposeEvent (QExposeEvent *) override
 Handles window expose events to trigger repaints.
void finishFrame (GraphicsUpdateArguments &args) final override
 Completes the current frame by swapping buffers.
void * getSurface () override
 Returns the rendering surface for this window.
void initialize () override
 Initializes the OpenGL context and device for this window.
virtual void makeCurrent () override
 Makes the OpenGL context current for this window.
void paintGL (GraphicsUpdateArguments &args)
 Performs the OpenGL paint pass for the current frame.
void updateInstance () override
 No-op instance update for the GLES window.
Public Member Functions inherited from QTGraphicsWindow
 QTGraphicsWindow (const DynamicPointer< GraphicsDevice > &device, QWindow *parent, Qt::WindowFlags flags)
 Constructs the graphics window.
 ~QTGraphicsWindow ()
 Destructor.
void contextMenu (const QPoint &pos)
 Shows a context menu at the given position.
const DynamicPointer< GraphicsDevice > & device () const
 Returns the graphics device.
void exposeEvent (QExposeEvent *e) override
 Handles expose events to trigger rendering.
void finishFrame (GraphicsUpdateArguments &args) override
 Called after a frame is finished for post-processing.
QImage getImage () const
 Returns the last rendered frame as a QImage.
void hideContextMenuSignal ()
 Emitted to hide the context menu.
void mouseInScreenSignal (bool mouse_in_screen)
 Emitted when the mouse enters or leaves the window.
void onClearAll ()
 Handles a clear-all event from the scene.
void onFocusChanged (UUID focus, bool focussed)
 Handles a focus change.
void onSelectedSignal (Buffer< UUID > selected)
 Emitted when objects are selected.
void onSelectionChanged (Buffer< UUID > selection, bool selected)
 Handles a selection change.
void pause (const TimeSpan &span)
 Pauses rendering for a duration.
void renderShowing ()
 Emitted when the render window is first shown.
void renderSlot ()
 Slot that triggers a render pass.
void requestContextMenu (const QPoint &pos)
 Emitted to request a context menu display.
void resizeEvent (QResizeEvent *resize_event) override
 Handles window resize events.
void setAnimating (bool animating)
 Sets whether the window continuously animates.
void setCamera (const DynamicPointer< Camera > &camera) override
 Sets the camera for rendering.
virtual void setModelManager (QTModelManager *manager)
 Sets the model manager for this window.
void setOverrideMaterial (UUID material)
 Sets a material override for the renderer.
void setSize (const Vector< 2, uint04 > &size) final override
 Sets the viewport size.
virtual bool shouldExit () const override
 Checks whether the window should exit.
void updateFallbackStore ()
 Updates the fallback backing store for the window.
void updateSize ()
 Updates the internal size from the window geometry.
virtual bool visible () const override
 Checks whether the window is visible.
Public Member Functions inherited from WindowInstance
 WindowInstance ()
 Default constructor.
 WindowInstance (const DynamicPointer< Camera > &camera, DesignObjectLookup *lookup)
 Constructs a WindowInstance with a given camera and design object lookup.
 ~WindowInstance ()
 Destructor.
void addKeyboardEvent (const std::function< void(KeyEvent)> &key_event)
 Registers a callback to be invoked when a keyboard event occurs.
void addMouseEvent (const std::function< void(MouseEvent)> &mouse_event)
 Registers a callback to be invoked when a mouse event occurs.
virtual const DynamicPointer< Camera > & camera ()
 Returns a reference to the dynamic camera pointer.
virtual ConstPointer< Cameracamera () const
 Returns a const pointer to the current camera.
void createEvent (const KeyEvent &event)
 Dispatches a keyboard event to all registered keyboard event callbacks.
void createEvent (const MouseEvent &event)
 Dispatches a mouse event to all registered mouse event callbacks.
fltp08 devicePixelRatio () const
 Returns the current device pixel ratio.
virtual uint04 getGrabImageSize ()
 Returns the size for image grabbing operations.
KeyControllergetKeyController ()
 Returns the keyboard controller associated with this window.
MouseControllergetMouseController ()
 Returns the mouse controller associated with this window.
Time getSurfaceUpdateTime () const
 Returns the timestamp of the last surface update.
const void * lockptr () const
 Returns a pointer that can be used as a lock identifier for this instance.
virtual Vector< 2, uint04logicalSize () const
 Returns the logical (device-independent) size of the window.
virtual Vector< 2, uint04pixelSize () const
 Returns the size of the window in physical pixels, accounting for the device pixel ratio.
virtual fltp08 referencePixelSize ()
 Returns the reference size in physical pixels, accounting for the device pixel ratio.
virtual fltp08 referenceSize ()
 Returns the reference size used for scaling calculations.
void setDevicePixelRatio (const fltp08 ratio)
 Sets the device pixel ratio (physical pixels per logical pixel).
void setLookup (DesignObjectLookup *lookup)
 Sets the design object lookup used for scene queries.
virtual void setReferenceSize (fltp08 size)
 Sets the reference size used for scaling calculations.

Additional Inherited Members

Protected Member Functions inherited from WindowInstance
void setExposed (bool exposed)
 Sets whether the window surface is currently exposed (visible and ready for rendering).
Protected Attributes inherited from QTGraphicsWindow
bool m_animating
 Whether continuous animation is active.
QBackingStore * m_backing_store = nullptr
 Fallback backing store for the window.
DynamicPointer< GraphicsDevicem_device
 The graphics device.
QTimer * m_fps_timer = nullptr
 Timer driving FPS-limited rendering.
bool m_has_valid_khr
 Whether a valid Vulkan surface (KHR) exists.
bool m_initiation_failure
 Whether initialization failed.
bool m_instance_valid = false
 Whether the graphics instance is valid.
bool m_is_init
 Whether the window has been initialized.
bool m_is_size_valid
 Whether the current window size is valid.
QRect m_last_render_size
 The size used for the last render.
QTModelManagerm_manager
 The model manager.
QTResourceListenerm_mouse_manager_listener
 Listener for mouse manager changes.
Rendererm_render
 The renderer for this window.
bool m_touch_alternate = false
 Alternate touch mode flag.
QPointF m_touch_begin_point
 Starting point of a touch gesture.
QTimer * m_touch_context_timer = nullptr
 Timer for long-press touch context menu.
Protected Attributes inherited from WindowInstance
DynamicPointer< Cameram_camera
 The camera used for rendering in this window.
fltp08 m_device_pixel_ratio
 Ratio of physical pixels to logical pixels.
bool m_is_exposed = false
 Whether the window surface is currently exposed.
Buffer< std::function< void(KeyEvent)> > m_key_events
 Registered keyboard event callbacks.
DesignObjectLookupm_lookup
 Pointer to the design object lookup for scene queries.
Buffer< std::function< void(MouseEvent)> > m_mouse_events
 Registered mouse event callbacks.
fltp08 m_reference_size
 Reference size used for scaling calculations.
Vector< 2, uint04m_size
 Logical size of the window.
Time m_surface_update_time
 Timestamp of the last surface update.

Detailed Description

The core Window used to render a viewport with OpenGL.


Definition at line 22 of file GLESGraphicsWindow.h.

Constructor & Destructor Documentation

◆ GLESGraphicsWindow()

GLESGraphicsWindow::GLESGraphicsWindow ( QWindow * parent,
Qt::WindowFlags flags )
explicit

Constructs a GLESGraphicsWindow.

Parameters
[in]parentThe parent QWindow.
[in]flagsThe Qt window flags.

Member Function Documentation

◆ event()

bool GLESGraphicsWindow::event ( QEvent * event)
override

Handles general window events.

Parameters
[in]eventThe event to process.
Returns
True if the event was handled.

References event().

Referenced by event().

◆ exposeEvent()

void GLESGraphicsWindow::exposeEvent ( QExposeEvent * )
override

Handles window expose events to trigger repaints.

Parameters
[in]eventThe expose event (unused parameter name).

◆ finishFrame()

void GLESGraphicsWindow::finishFrame ( GraphicsUpdateArguments & args)
finaloverridevirtual

Completes the current frame by swapping buffers.

Parameters
[in]argsThe graphics update context.

Reimplemented from WindowInstance.

◆ getSurface()

void * GLESGraphicsWindow::getSurface ( )
overridevirtual

Returns the rendering surface for this window.

Returns
A void pointer to the QSurface.

Implements WindowInstance.

◆ paintGL()

void GLESGraphicsWindow::paintGL ( GraphicsUpdateArguments & args)

Performs the OpenGL paint pass for the current frame.

Parameters
[in]argsThe graphics update context.

The documentation for this class was generated from the following file: