Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
fix pointers disappearing
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Jul 28, 2023
1 parent edb2288 commit 22a97a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions Backend/OVR/OVROverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public sealed class OVROverlay : IOverlay
private Overlay? _childOverlay;

private bool _created;
private bool _textureUploaded;

/// <summary>
/// Transforms texture UV (rect) to overlay UV (square)
Expand Down Expand Up @@ -164,14 +163,10 @@ private bool TryTransformToLocal(Vector2 uvIn, out Vector2 uvOut)

public void Render()
{
if (_overlay == null)
if (_overlay == null || _parent.Texture == null)
return;

if (_parent.Texture!.IsDynamic() || !_textureUploaded)
{
UploadTexture(_overlay, _parent.Texture);
_textureUploaded = true;
}
UploadTexture(_overlay, _parent.Texture);
}

public void Show()
Expand All @@ -195,7 +190,6 @@ public void Hide()
_overlay!.Destroy();
_overlay = null;
_created = false;
_textureUploaded = false;
}
else
_overlay!.Hide();
Expand Down
4 changes: 2 additions & 2 deletions Core/Interactions/Internal/PointerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal void UpdateState()
Before = Now;
XrBackend.Current.Input.InputState(Pointer.Hand, ref Now);

#if DEBUG
#if DEBUG_INPUT
if (Before.Click != Now.Click)
Console.WriteLine($"[Dbg] {Pointer.Hand} Click {Before.Click} -> {Now.Click}");
if (Before.Grab != Now.Grab)
Expand Down Expand Up @@ -161,4 +161,4 @@ internal void TryDrop(InteractionData data)
if (_grabbedTarget == data)
_grabbedTarget = data;
}
}
}

0 comments on commit 22a97a6

Please sign in to comment.