feature: Add dummy mode
This commit is contained in:
parent
f79657afc2
commit
8b482cecd5
40 changed files with 323 additions and 141 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"git.terah.dev/UnrealXR/unrealxr/ardriver/commons"
|
||||
"git.terah.dev/UnrealXR/unrealxr/ardriver/dummy"
|
||||
"git.terah.dev/UnrealXR/unrealxr/ardriver/xreal"
|
||||
)
|
||||
|
||||
|
@ -19,5 +20,16 @@ func GetDevice() (commons.ARDevice, error) {
|
|||
return device, nil
|
||||
}
|
||||
|
||||
if dummy.IsDummyDeviceEnabled {
|
||||
device, err := dummy.New()
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("failed to initialize dummy device: %w\n", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return device, nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("failed to initialize any device")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue