Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to make it compile with vsg 1.1.2 #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
changes to make it work with vsg 1.1.2
  • Loading branch information
MauFranco committed Apr 11, 2024
commit 5b5848dd9cf57c1558c4cb51c4e77c5792ed6155
6 changes: 5 additions & 1 deletion vsgvr/include/vsgvr/app/Viewer.h
Original file line number Diff line number Diff line change
@@ -100,13 +100,17 @@ namespace vsgvr {
/// to avoid exceptions being thrown on subsequence calls
auto pollEvents() -> PollEventsResult;

/// hint for setting the FrameStamp::simulationTime to time since start_point()
static constexpr double UseTimeSinceStartPoint = std::numeric_limits<double>::max();

/// Similar to vsg::Viewer, advance the framebuffers and prepare for rendering
///
/// Internally this will acquire a frame / swapchain image from OpenXR. The application
/// **must** call releaseFrame() once after rendering, even if this method returns false.
///
/// @return Whether the application should render.
bool advanceToNextFrame();
///
bool advanceToNextFrame(double simulationTime= UseTimeSinceStartPoint);

/// Submit rendering tasks to Vulkan
void recordAndSubmit();
2 changes: 2 additions & 0 deletions vsgvr/src/vsgvr/app/CompositionLayer.cpp
Original file line number Diff line number Diff line change
@@ -35,6 +35,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <vsg/vk/SubmitCommands.h>
#include <vsg/commands/PipelineBarrier.h>

#include <vsg/Lighting/Light.h>

#include "../xr/Macros.cpp"

namespace vsgvr {
6 changes: 3 additions & 3 deletions vsgvr/src/vsgvr/app/Viewer.cpp
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ namespace vsgvr
return PollEventsResult::RunningDontRender;
}

bool Viewer::advanceToNextFrame()
bool Viewer::advanceToNextFrame(double simulationTime)
{
// Viewer::acquireNextFrame
_frameState = XrFrameState();
@@ -128,12 +128,12 @@ namespace vsgvr
if (!_frameStamp)
{
// first frame, initialize to frame count and indices to 0
_frameStamp = vsg::FrameStamp::create(t, 0);
_frameStamp = vsg::FrameStamp::create(t, 0, simulationTime);
}
else
{
// after first frame so increment frame count and indices
_frameStamp = vsg::FrameStamp::create(t, _frameStamp->frameCount + 1);
_frameStamp = vsg::FrameStamp::create(t, _frameStamp->frameCount + 1, simulationTime);
}

for (auto& layer : compositionLayers)