35#include <NDEVR/KeyController.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/Camera.h>
The equivelent of std::vector but with a bit more control.
A core object representing a user view as well as convenience functions for moving this view through ...
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Options that are used for performing an update on a Graphics Engine call.
A top-level controller that dispatches key events to registered sub-controllers.
Describes a user key press event used to trigger behavior in the NDEVR API.
Contains logic for executing actions based on user mouse inputs.
Describes a mouse or touch input event with position, button, and modifier information.
Represents a timestamp with utilities for manipulation and conversion.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
constexpr decltype(auto) as() const
Returns the vector as a new time of vector.
Buffer< std::function< void(KeyEvent)> > m_key_events
Registered keyboard event callbacks.
virtual void setSize(const Vector< 2, uint04 > &size)
Sets the logical size of the window.
void setLookup(DesignObjectLookup *lookup)
Sets the design object lookup used for scene queries.
Time m_surface_update_time
Timestamp of the last surface update.
fltp08 devicePixelRatio() const
Returns the current device pixel ratio.
void addKeyboardEvent(const std::function< void(KeyEvent)> &key_event)
Registers a callback to be invoked when a keyboard event occurs.
bool m_is_exposed
Whether the window surface is currently exposed.
void createEvent(const KeyEvent &event)
Dispatches a keyboard event to all registered keyboard event callbacks.
WindowInstance(const DynamicPointer< Camera > &camera, DesignObjectLookup *lookup)
Constructs a WindowInstance with a given camera and design object lookup.
virtual void finishFrame(GraphicsUpdateArguments &args)
Called at the end of a frame to perform any finalization work.
virtual void setReferenceSize(fltp08 size)
Sets the reference size used for scaling calculations.
virtual void updateInstance()
Called to update the window instance state.
void setDevicePixelRatio(const fltp08 ratio)
Sets the device pixel ratio (physical pixels per logical pixel).
virtual ConstPointer< Camera > camera() const
Returns a const pointer to the current camera.
void addMouseEvent(const std::function< void(MouseEvent)> &mouse_event)
Registers a callback to be invoked when a mouse event occurs.
virtual Vector< 2, uint04 > pixelSize() const
Returns the size of the window in physical pixels, accounting for the device pixel ratio.
virtual void * getSurface()=0
Returns a platform-specific pointer to the rendering surface.
Time getSurfaceUpdateTime() const
Returns the timestamp of the last surface update.
WindowInstance()
Default constructor.
fltp08 m_reference_size
Reference size used for scaling calculations.
virtual Vector< 2, uint04 > logicalSize() const
Returns the logical (device-independent) size of the window.
virtual fltp08 referencePixelSize()
Returns the reference size in physical pixels, accounting for the device pixel ratio.
virtual void setCamera(const DynamicPointer< Camera > &camera)
Sets the camera associated with this window.
virtual fltp08 referenceSize()
Returns the reference size used for scaling calculations.
Vector< 2, uint04 > m_size
Logical size of the window.
MouseController & getMouseController()
Returns the mouse controller associated with this window.
virtual bool shouldExit() const
Returns whether this window should exit or close.
virtual uint04 getGrabImageSize()
Returns the size for image grabbing operations.
~WindowInstance()
Destructor.
virtual const DynamicPointer< Camera > & camera()
Returns a reference to the dynamic camera pointer.
DesignObjectLookup * m_lookup
Pointer to the design object lookup for scene queries.
KeyController & getKeyController()
Returns the keyboard controller associated with this window.
DynamicPointer< Camera > m_camera
The camera used for rendering in this window.
void setExposed(bool exposed)
Sets whether the window surface is currently exposed (visible and ready for rendering).
void createEvent(const MouseEvent &event)
Dispatches a mouse event to all registered mouse event callbacks.
Buffer< std::function< void(MouseEvent)> > m_mouse_events
Registered mouse event callbacks.
virtual bool visible() const
Returns whether this window is currently visible.
const void * lockptr() const
Returns a pointer that can be used as a lock identifier for this instance.
fltp08 m_device_pixel_ratio
Ratio of physical pixels to logical pixels.
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...
double fltp08
Defines an alias representing an 8 byte floating-point number.