VR-Engage  2.2
Loading...
Searching...
No Matches
vreVirtualRealityChannel.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreVirtualRealityChannel.h
7//! \brief Defines specialized virtual reality channel for VR-Engage
8//!
9//! This file contains the DtVreVirtualRealityChannel class which extends the
10//! base DtVirtualRealityChannel class to provide VR-Engage specific behavior
11//! for head-mounted display (HMD) rendering. It ensures proper render-to-texture
12//! functionality for VR visualization and handles texture format updates.
13//! \ingroup vreVirtualReality
14
15#pragma once
16
18#include <vrvVirtualReality/DtVirtualRealityChannel.h>
19
20namespace makVre
21{
22//! \brief Specialized virtual reality channel for VR-Engage
23//!
24//! DtVreVirtualRealityChannel extends the base DtVirtualRealityChannel to provide
25//! VR-Engage specific behavior for head-mounted display (HMD) rendering. It enforces
26//! render-to-texture mode which is essential for proper VR visualization, and
27//! provides methods to rebuild the render texture when needed. This class ensures
28//! that the post-processing manager cannot disable render-to-texture mode, which
29//! would break VR functionality.
30//! \ingroup vreVirtualReality
31class PLAYERSTATION_DLL DtVreVirtualRealityChannel : public makVrv::DtVirtualRealityChannel
32{
33public:
34 //! \brief Constructor
35 //! \param de Reference to the display engine
36 //! \param window Pointer to the OSG window this channel renders to
37 //! \param config Channel configuration parameters
38 //!
39 //! Creates a new virtual reality channel for the specified window and configuration.
40 //! This initializes a channel that renders the scene from the perspective of an
41 //! HMD eye position.
42 DtVreVirtualRealityChannel(makVrv::DtDe& de, makVrv::DtOsgWindow* window, makVrv::DtChannelConfiguration& config);
43
44 //! \brief Destructor
45 //!
46 //! Cleans up resources used by the virtual reality channel.
47 virtual ~DtVreVirtualRealityChannel() override;
48
49 //! \brief Controls render-to-texture mode for this channel
50 //! \param enabled Whether render-to-texture should be enabled
51 //!
52 //! Overridden to enforce render-to-texture mode for VR channels. This
53 //! implementation ignores attempts to disable render-to-texture, since
54 //! VR channels are only useful with render-to-texture enabled. This
55 //! prevents the post-processing manager from automatically disabling it
56 //! when there are no active post-processors, which would break VR functionality.
57 virtual void setRenderToTexture(bool enabled) override;
58
59 //! \brief Initializes or reinitializes the render texture
60 //!
61 //! Overridden to provide additional signaling when the texture changes.
62 //! This ensures that any components depending on the texture are notified
63 //! when it's recreated, allowing them to update their references accordingly.
64 virtual void initializeRenderTexture() override;
65
66 //! \brief Forces a rebuild of the render texture
67 //!
68 //! Marks the render texture format as dirty, which will cause it to be
69 //! rebuilt during the next frame. This is useful when the texture format
70 //! needs to be updated due to changes in rendering requirements or when
71 //! the texture needs to be recreated for any other reason.
73};
74
75//! \brief Factory class for creating VR-Engage virtual reality channels
76//!
77//! DtVreVirtualRealityChannelCreator implements the factory pattern for creating
78//! DtVreVirtualRealityChannel instances. It allows the channel system to create
79//! virtual reality channels without knowing the specific implementation details.
80//! \ingroup vreVirtualReality
81class PLAYERSTATION_DLL DtVreVirtualRealityChannelCreator : public makVrv::DtChannelCreator
82{
83public:
84 //! \brief Creates a new virtual reality channel
85 //! \param de Reference to the display engine
86 //! \param window Pointer to the window this channel will render to
87 //! \param config Channel configuration parameters
88 //! \return Pointer to the newly created channel
89 //!
90 //! Factory method that creates a new DtVreVirtualRealityChannel instance
91 //! with the specified parameters.
92 virtual makVrv::DtChannel* create(
93 makVrv::DtDe& de, makVrv::DtWindow* window, makVrv::DtChannelConfiguration& config) override;
94};
95} // namespace makVre
Factory class for creating VR-Engage virtual reality channels.
Definition vreVirtualRealityChannel.h:82
virtual makVrv::DtChannel * create(makVrv::DtDe &de, makVrv::DtWindow *window, makVrv::DtChannelConfiguration &config) override
Creates a new virtual reality channel.
virtual ~DtVreVirtualRealityChannel() override
Destructor.
DtVreVirtualRealityChannel(makVrv::DtDe &de, makVrv::DtOsgWindow *window, makVrv::DtChannelConfiguration &config)
Constructor.
virtual void dirtyRenderTextureFormat()
Forces a rebuild of the render texture.
virtual void setRenderToTexture(bool enabled) override
Controls render-to-texture mode for this channel.
virtual void initializeRenderTexture() override
Initializes or reinitializes the render texture.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.