Branching code
- Last UpdatedDec 06, 2023
- 1 minute read
In some cases, you might want to look for the rendering output used by the application and then branch code based on it.
You can do this by looking at the system.stereoMode define that can be set to OpenVR, Oculus, or other. This is particularly useful to embed debug functionalities to test things without using VR systems.
Code example
This is a code example for using system.stereoMode define.
<if condition="@def:system.stereoMode@!=oculus^@def:system.stereoMode@!=openvr" >
<Keysensor key="R" active="true" name="rkey" />
<route from="rkey.keyDown" to="cmd_delayShowMessage.execute" value="1" />
</if>