Skip to content

Commit

Permalink
Update the gdscript logic used to retrieve the GDExtension singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Jan 17, 2024
1 parent c1569d3 commit b104dbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions demo/main.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extends Node3D

var xr_interface : XRInterface = null
var scene_capture: OpenXRFbSceneCaptureExtensionWrapper = null

# Called when the node enters the scene tree for the first time.
func _ready():
Expand All @@ -10,15 +9,17 @@ func _ready():
var vp: Viewport = get_viewport()
vp.use_xr = true

scene_capture = Engine.get_singleton("OpenXRFbSceneCaptureExtensionWrapper")
scene_capture.connect("scene_capture_completed", _on_scene_capture_completed)
var scene_capture := Engine.get_singleton("OpenXRFbSceneCaptureExtensionWrapper")
if scene_capture:
scene_capture.connect("scene_capture_completed", _on_scene_capture_completed)


func _on_scene_capture_completed():
print("Scene Capture completed")


func _on_left_hand_button_pressed(name):
var scene_capture := Engine.get_singleton("OpenXRFbSceneCaptureExtensionWrapper")
if name == "menu_button" and scene_capture:
print("Triggering scene capture")
scene_capture.request_scene_capture()

0 comments on commit b104dbb

Please sign in to comment.