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