public void Run()
    {
        var dataDir          = UnpackedArchiveDirectory.Make(new DirectoryInfo("work"));
        var device           = new Device(DriverType.Hardware, DeviceCreationFlags.None, FeatureLevel.Level_11_1);
        var shaderCache      = new ShaderCache(device);
        var standardSamplers = new StandardSamplers(device);
        var targetSize       = new Size2(1024, 1024);

        using (var framePreparer = new FramePreparer(dataDir, device, shaderCache, standardSamplers, targetSize)) {
            OpenVRExtensions.Init(EVRApplicationType.VRApplication_Other);
            Run(framePreparer);
            OpenVR.Shutdown();
        }
    }
Beispiel #2
0
    public VRApp(IArchiveDirectory dataDir, string title)
    {
        OpenVRExtensions.Init();

        device           = CreateDevice();
        shaderCache      = new ShaderCache(device);
        standardSamplers = new StandardSamplers(device);

        companionWindow = new CompanionWindow(device, shaderCache, standardSamplers, title, dataDir);

        immediateContext = device.ImmediateContext;

        timeKeeper = new OpenVRTimeKeeper();

        hiddenAreaMeshes = new HiddenAreaMeshes(device);

        Size2 targetSize = OpenVR.System.GetRecommendedRenderTargetSize();

        framePreparer      = new FramePreparer(dataDir, device, shaderCache, standardSamplers, targetSize);
        asyncFramePreparer = new AsyncFramePreparer(framePreparer);
    }