• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Razakhel / RaZ / 11823221355

13 Nov 2024 06:08PM UTC coverage: 74.338% (-0.06%) from 74.4%
11823221355

push

github

Razakhel
[XR/XrSession] Delayed the session's actual creation

- This allows creating an XR system & context, therefore allowing getting the XR device's info like its views dimensions, before initializing anything related to rendering
  - The optimal view width & height (the recommended image rect. size for the device's views) can be recovered from the XrSystem
  - These dimensions are used to create the window in the XR demo

- Due to the necessary delayed rendering initialization, the swapchain copy pass is now a static local variable in the corresponding function, just like the window copy pass

0 of 76 new or added lines in 4 files covered. (0.0%)

3 existing lines in 2 files now uncovered.

8059 of 10841 relevant lines covered (74.34%)

1816.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/include/RaZ/XR/XrSystem.hpp
1
#pragma once
2

3
#ifndef RAZ_XRSYSTEM_HPP
4
#define RAZ_XRSYSTEM_HPP
5

6
#include "RaZ/System.hpp"
7
#include "RaZ/XR/XrContext.hpp"
8
#include "RaZ/XR/XrSession.hpp"
9

10
#include <vector>
11

12
struct XrEventDataSessionStateChanged;
13
struct XrViewConfigurationView;
14

15
namespace Raz {
16

17
class XrSystem final : public System {
18
  friend class RenderSystem;
19

20
public:
21
  explicit XrSystem(const std::string& appName);
22

NEW
23
  unsigned int getOptimalViewWidth() const { return m_optimalViewWidth; }
×
NEW
24
  unsigned int getOptimalViewHeight() const { return m_optimalViewHeight; }
×
25

26
  bool update(const FrameTimeInfo&) override;
27

28
  ~XrSystem() override;
29

30
private:
31
  void recoverViewConfigurations();
32
  void recoverEnvironmentBlendModes();
33
  void initializeSession();
34
  bool renderFrame(const ViewRenderFunc& viewRenderFunc);
35
  bool processSessionStateChanged(const XrEventDataSessionStateChanged& sessionStateChanged);
36

37
  XrContext m_context;
38
  XrSession m_session;
39

40
  std::vector<unsigned int> m_viewConfigTypes;
41
  unsigned int m_viewConfigType {};
42
  std::vector<XrViewConfigurationView> m_viewConfigViews;
43
  unsigned int m_optimalViewWidth {};
44
  unsigned int m_optimalViewHeight {};
45

46
  std::vector<unsigned int> m_environmentBlendModes;
47
  unsigned int m_environmentBlendMode {};
48
};
49

50
} // namespace Raz
51

52
#endif // RAZ_XRSYSTEM_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc