Skip to content

Commit

Permalink
feat(SDK): allow Android support for Oculus SDK
Browse files Browse the repository at this point in the history
The Oculus SDK has been updated to also support the Android build
platform. This means that building with the Oculus SDK will allow
to be deployed on Android for GearVR.
  • Loading branch information
thestonefox committed Jul 16, 2017
1 parent 881e6ec commit eb01c51
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions Assets/VRTK/SDK/Oculus/SDK_OculusBoundaries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace VRTK
/// The Oculus Boundaries SDK script provides a bridge to the Oculus SDK play area.
/// </summary>
[SDK_Description(typeof(SDK_OculusSystem))]
[SDK_Description(typeof(SDK_OculusSystem), 1)]
public class SDK_OculusBoundaries
#if VRTK_DEFINE_SDK_OCULUS
: SDK_BaseBoundaries
Expand Down
1 change: 1 addition & 0 deletions Assets/VRTK/SDK/Oculus/SDK_OculusController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace VRTK
/// The Oculus Controller SDK script provides a bridge to SDK methods that deal with the input devices.
/// </summary>
[SDK_Description(typeof(SDK_OculusSystem))]
[SDK_Description(typeof(SDK_OculusSystem), 1)]
public class SDK_OculusController
#if VRTK_DEFINE_SDK_OCULUS
: SDK_BaseController
Expand Down
17 changes: 10 additions & 7 deletions Assets/VRTK/SDK/Oculus/SDK_OculusDefines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ public static class SDK_OculusDefines
/// </summary>
public const string AvatarScriptingDefineSymbol = SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_OCULUS_AVATAR";

private const string BuildTargetGroupName = "Standalone";

[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_12_0_OR_NEWER", BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, "Standalone")]
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, "Android")]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_12_0_OR_NEWER", "Standalone")]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_12_0_OR_NEWER", "Android")]
private static bool IsUtilitiesVersion1120OrNewer()
{
Version wrapperVersion = GetOculusWrapperVersion();
return wrapperVersion != null && wrapperVersion >= new Version(1, 12, 0);
}

[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_11_0_OR_OLDER", BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, "Standalone")]
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, "Android")]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_11_0_OR_OLDER", "Standalone")]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "OCULUS_UTILITIES_1_11_0_OR_OLDER", "Android")]
private static bool IsUtilitiesVersion1110OrOlder()
{
Version wrapperVersion = GetOculusWrapperVersion();
return wrapperVersion != null && wrapperVersion < new Version(1, 12, 0);
}

[SDK_ScriptingDefineSymbolPredicate(AvatarScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(AvatarScriptingDefineSymbol, "Standalone")]
[SDK_ScriptingDefineSymbolPredicate(AvatarScriptingDefineSymbol, "Android")]
private static bool IsAvatarAvailable()
{
return (IsUtilitiesVersion1120OrNewer() || IsUtilitiesVersion1110OrOlder())
Expand Down
1 change: 1 addition & 0 deletions Assets/VRTK/SDK/Oculus/SDK_OculusHeadset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace VRTK
/// The Oculus Headset SDK script provides a bridge to the Oculus SDK.
/// </summary>
[SDK_Description(typeof(SDK_OculusSystem))]
[SDK_Description(typeof(SDK_OculusSystem), 1)]
public class SDK_OculusHeadset
#if VRTK_DEFINE_SDK_OCULUS
: SDK_BaseHeadset
Expand Down
3 changes: 2 additions & 1 deletion Assets/VRTK/SDK/Oculus/SDK_OculusSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace VRTK
/// <summary>
/// The Oculus System SDK script provides a bridge to the Oculus SDK.
/// </summary>
[SDK_Description("Oculus", SDK_OculusDefines.ScriptingDefineSymbol, "Oculus", "Standalone")]
[SDK_Description("Oculus (Rift)", SDK_OculusDefines.ScriptingDefineSymbol, "Oculus", "Standalone")]
[SDK_Description("Oculus (GearVR)", SDK_OculusDefines.ScriptingDefineSymbol, "Oculus", "Android", 1)]
public class SDK_OculusSystem
#if VRTK_DEFINE_SDK_OCULUS
: SDK_BaseSystem
Expand Down

0 comments on commit eb01c51

Please sign in to comment.