vsg 1.1.3
VulkanSceneGraph library
Loading...
Searching...
No Matches
PlayEvents.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2018 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
13</editor-fold> */
14
15#include <vsg/ui/KeyEvent.h>
16#include <vsg/ui/PointerEvent.h>
17#include <vsg/ui/ScrollWheelEvent.h>
18
19namespace vsg
20{
21
24 class VSG_DECLSPEC PlayEvents : public vsg::Inherit<vsg::Visitor, PlayEvents>
25 {
26 public:
27 PlayEvents(vsg::ref_ptr<vsg::Object> object, vsg::clock::time_point::duration delta);
28
29 bool resetHandled = true;
30
31 using Events = std::list<vsg::ref_ptr<vsg::UIEvent>>;
32 Events events;
33 Events::iterator events_itr;
34 bool frameEnd = false;
35
36 // cache of events to dispatch for current frame.
37 Events frameEvents;
38
39 bool dispatchFrameEvents(vsg::UIEvents& viewer_events);
40
41 void apply(vsg::UIEvent& event) override;
42 void apply(vsg::FrameEvent& event) override;
43 void apply(vsg::ConfigureWindowEvent& event) override;
44 void apply(vsg::ExposeWindowEvent& event) override;
45 };
46 VSG_type_name(vsg::PlayEvents);
47
48} // namespace vsg
ConfigureWindowEvent represents a window configure event - such as changes to the size of the window.
Definition WindowEvent.h:64
ExposeWindowEvent represents a window expose event.
Definition WindowEvent.h:41
Definition ApplicationEvent.h:37
Definition Inherit.h:28
Definition PlayEvents.h:25
UIEvent is a base class for user interface events.
Definition UIEvent.h:28
Definition ref_ptr.h:22