Ocean
Loading...
Searching...
No Matches
VRTableMenu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_PLATFORM_META_QUEST_OPENXR_APPLICATION_VR_TABLE_MENU_H
9#define META_OCEAN_PLATFORM_META_QUEST_OPENXR_APPLICATION_VR_TABLE_MENU_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Platform
21{
22
23namespace Meta
24{
25
26namespace Quest
27{
28
29namespace OpenXR
30{
31
32namespace Application
33{
34
35/**
36 * The class implements a simple table-based menu for VR application.
37 * The menu is composed of sections and menu entries.<br>
38 * Based on controller tracking, the menu entries can be selected.
39 * @ingroup platformmetaquestopenxrapplication
40 */
41class OCEAN_PLATFORM_META_QUEST_OPENXR_APPLICATION_EXPORT VRTableMenu final : public Quest::Application::VRTableMenuBase
42{
43 public:
44
45 /**
46 * Creates a new invalid menu object.
47 */
48 VRTableMenu() = default;
49
50 /**
51 * Move constructor.
52 * @param menu The menu object to be moved
53 */
54 VRTableMenu(VRTableMenu&& menu) = default;
55
56 /**
57 * Creates a new valid menu object.
58 * @param engine The rendering engine which will be used to render the menu, must be valid
59 * @param framebuffer The framebuffer associated with the rendering engine to which the menu will be rendered
60 */
61 inline VRTableMenu(const Rendering::EngineRef& engine, const Rendering::FramebufferRef& framebuffer);
62
63 /**
64 * Events function called before the menu is rendered.
65 * @param trackedController The tracked controller providing access to the controller tracking, must be valid
66 * @param renderTimestamp The timestamp when the menu will be rendered
67 * @param url The resulting menu entry url in case an entry was selected
68 * @return True, if an entry was selected; False, if no entry was selected
69 */
70 bool onPreRender(TrackedController& trackedController, const Timestamp& renderTimestamp, std::string& url);
71
72 /**
73 * Move operator.
74 * @param menu The menu object to be moved
75 * @return Reference to this object
76 */
77 VRTableMenu& operator=(VRTableMenu&& menu) = default;
78
79 protected:
80
81 /**
82 * Disabled copy constructor.
83 */
84 VRTableMenu(const VRTableMenu&) = delete;
85
86 /**
87 * Disabled copy operator.
88 * @param menu The menu object which would be copied
89 * @return The reference to this object
90 */
91 VRTableMenu& operator=(const VRTableMenu& menu) = delete;
92};
93
95 VRTableMenuBase(engine, framebuffer)
96{
97 // nothing to do here
98}
99
100}
101
102}
103
104}
105
106}
107
108}
109
110}
111
112#endif // META_OCEAN_PLATFORM_META_QUEST_OPENXR_APPLICATION_VR_TABLE_MENU_H
The class implements the base class for a simple table-based menu for VR application.
Definition VRTableMenuBase.h:45
The class implements a simple table-based menu for VR application.
Definition VRTableMenu.h:42
VRTableMenu()=default
Creates a new invalid menu object.
VRTableMenu & operator=(const VRTableMenu &menu)=delete
Disabled copy operator.
VRTableMenu(VRTableMenu &&menu)=default
Move constructor.
VRTableMenu & operator=(VRTableMenu &&menu)=default
Move operator.
bool onPreRender(TrackedController &trackedController, const Timestamp &renderTimestamp, std::string &url)
Events function called before the menu is rendered.
VRTableMenu(const VRTableMenu &)=delete
Disabled copy constructor.
This class implements a wrapper for tracker controllers.
Definition TrackedController.h:40
This class implements a timestamp.
Definition Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition Accessor.h:15