feature: Add dummy mode

This commit is contained in:
Tera << 8 2025-06-27 12:26:54 -04:00
parent f79657afc2
commit 8b482cecd5
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
40 changed files with 323 additions and 141 deletions

View file

@ -0,0 +1,40 @@
//go:build dummy_ar
// +build dummy_ar
package dummy
import (
"git.terah.dev/UnrealXR/unrealxr/ardriver/commons"
)
var IsDummyDeviceEnabled = true
// Implements commons.ARDevice
type DummyDevice struct {
}
func (device *DummyDevice) Initialize() error {
return nil
}
func (device *DummyDevice) End() error {
return nil
}
func (device *DummyDevice) IsPollingLibrary() bool {
return false
}
func (device *DummyDevice) IsEventBasedLibrary() bool {
return false
}
func (device *DummyDevice) Poll() error {
return nil
}
func (device *DummyDevice) RegisterEventListeners(*commons.AREventListener) {}
func New() (*DummyDevice, error) {
return &DummyDevice{}, nil
}

View file

@ -0,0 +1,42 @@
//go:build !dummy_ar
// +build !dummy_ar
package dummy
import (
"fmt"
"git.terah.dev/UnrealXR/unrealxr/ardriver/commons"
)
var IsDummyDeviceEnabled = false
// Implements commons.ARDevice
type DummyDevice struct {
}
func (device *DummyDevice) Initialize() error {
return fmt.Errorf("dummy device is not enabled")
}
func (device *DummyDevice) End() error {
return fmt.Errorf("dummy device is not enabled")
}
func (device *DummyDevice) IsPollingLibrary() bool {
return false
}
func (device *DummyDevice) IsEventBasedLibrary() bool {
return false
}
func (device *DummyDevice) Poll() error {
return fmt.Errorf("dummy device is not enabled")
}
func (device *DummyDevice) RegisterEventListeners(*commons.AREventListener) {}
func New() (*DummyDevice, error) {
return nil, fmt.Errorf("dummy device is not enabled")
}