35#include <NDEVR/KeyController.h>
36#include <NDEVR/Pointer.h>
40 class GraphicsUpdateArguments;
44 class MouseController;
45 class DesignObjectLookup;
54 WindowInstance(UUID camera, DesignObjectLookup* lookup);
56 MouseController& getMouseController();
57 KeyController& getKeyController();
58 void setLookup(DesignObjectLookup* lookup) { m_lookup = lookup; }
59 virtual Vector<2, uint04> pixelSize()
const {
return (m_device_pixel_ratio * m_size.as<2, fltp08>()).as<2,
uint04>(); };
60 virtual Vector<2, uint04> logicalSize()
const {
return m_size; };
61 virtual fltp08 referenceSize() {
return m_reference_size; }
62 virtual fltp08 referencePixelSize() {
return m_device_pixel_ratio * m_reference_size;}
63 virtual void setSize(
const Vector<2, uint04>& size);
64 virtual void setReferenceSize(fltp08 size);
65 void addResizeEvent(
const std::function<
void(Vector<2, uint04>)>& resize_event) { m_resize_events.add(resize_event); };
66 void addMouseEvent(
const std::function<
void(MouseEvent)>& mouse_event) { m_mouse_events.add(mouse_event); }
67 void addKeyboardEvent(
const std::function<
void(KeyEvent)>& key_event) { m_key_events.add(key_event); };
68 virtual bool visible()
const {
return true; }
69 virtual bool shouldExit()
const {
return false; }
70 virtual void* getSurface() = 0;
71 virtual void updateInstance() {};
72 Time getSurfaceUpdateTime()
const {
return m_surface_update_time; }
73 virtual uint04 getGrabImageSize() {
return 0; }
74 virtual void finishFrame(GraphicsUpdateArguments&) {};
75 virtual void setCamera(
const UUID& camera);
76 virtual ConstPointer<Camera> getCamera()
const;
77 virtual DynamicPointer<Camera> getCamera();
78 const void* lockptr()
const {
return this; }
79 void createEvent(
const MouseEvent& event);
80 void createEvent(
const KeyEvent& event);
81 void createResizeEvent(
const Vector<2, uint04>& event);
82 void setDevicePixelRatio(
const fltp08 ratio) { m_device_pixel_ratio = ratio; };
83 fltp08 devicePixelRatio()
const {
return m_device_pixel_ratio; }
84 const UUID& cameraID()
const {
return m_camera; }
86 Buffer<std::function<void(Vector<2, uint04>)>> m_resize_events;
87 Buffer<std::function<void(MouseEvent)>> m_mouse_events;
88 Buffer<std::function<void(KeyEvent)>> m_key_events;
89 fltp08 m_device_pixel_ratio;
91 Vector<2, uint04> m_size;
93 Time m_surface_update_time;
95 DesignObjectLookup* m_lookup;
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149