MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / SimpleOculusTarget

Class SimpleOculusTarget

src/main/java/trace/graphics/SimpleOculusTarget.kt:16–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14import fieldbox.boxes.Boxes.window
15import fieldbox.ui.GlfwCallbackDelegate
16import fieldagent.Main.OS
17import trace.graphics.remote.RemoteServer
18
19class SimpleOculusTarget {
20
21 companion object {
22
23 @JvmStatic
24 var disable = !Stage.VR
25 @JvmStatic
26 var openvr = true
27
28 var window: Window? = null
29 var o: OculusDrawTarget2? = null
30 var o2: OpenVRDrawTarget? = null
31// var fake: FakeOculusDrawTarget? = null
32
33 val queue = mutableListOf<() -> Unit>()
34
35 @JvmField
36 val camera: SimpleCamera? = null
37
38 init {
39
40 if (disable)
41 {
42
43 }
44 else {
45 window = object : Window(0, 0, 1024, 512, "Field / VR preview") {
46 override fun makeCallback(): GlfwCallback {
47
48 return object : GlfwCallbackDelegate(super.makeCallback()) {
49 override fun windowRefresh(l: Long) {
50 requestRepaint()
51 }
52
53 override fun windowClose(l: Long): Boolean {
54 return true
55 }
56 }
57 }
58 }
59
60 window!!.setBounds(0, 0, 1024, 512)
61 }
62
63 if (!disable and Main.OS.isWindows() and !openvr) {
64 o = OculusDrawTarget2()
65 o!!.debugBlit = true
66 // o.debugFBO = true
67 o!!.init(window!!.scene)
68 } else if (!disable and Main.OS.isWindows() and openvr) {
69 o2 = OpenVRDrawTarget()
70 o2!!.debug = true
71 o2!!.init(window!!.scene)
72 } else if (!disable) {
73// fake = FakeOculusDrawTarget(1344, 1600)

Callers

nothing calls this directly

Calls 9

OculusDrawTarget2Class · 0.85
OpenVRDrawTargetClass · 0.85
itFunction · 0.85
setBoundsMethod · 0.80
isWindowsMethod · 0.80
initMethod · 0.45
attachMethod · 0.45
forEachMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected