Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
Created September 25, 2016 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save migueldeicaza/8de4f89b182588927ba16f31b214e35a to your computer and use it in GitHub Desktop.
Save migueldeicaza/8de4f89b182588927ba16f31b214e35a to your computer and use it in GitHub Desktop.
Minimal HoloLens app with UrhoSharp.
using System;
using Windows.ApplicationModel.Core;
using Urho;
using Urho.Holographics;
using Urho.HoloLens;
internal class Program
{
[MTAThread]
private static void Main()
{
CoreApplication.Run(new AppViewSource());
}
class AppViewSource : IFrameworkViewSource
{
public IFrameworkView CreateView() => UrhoAppView.Create<HelloWorldApplication>(null);
}
}
public class HelloWorldApplication : HoloApplication
{
public HelloWorldApplication(string pak, bool emulator) : base(pak, emulator) { }
protected override void Start()
{
base.Start();
var boxNode = Scene.CreateChild();
boxNode.Position = new Vector3(0, 0, 1); //one meter away
boxNode.SetScale(0.2f); //20cm
boxNode.CreateComponent<Urho.Shapes.Box>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment