Esempio n. 1
0
        public ProjectorFormLoader(String path)
        {
            Forms = new List <ProjectorForm>();

            // load ensemble.xml
            string directory = Path.GetDirectoryName(path);
            var    ensemble  = ProjectorCameraEnsemble.FromFile(path);

            // create d3d device
            var factory = new Factory1();
            var adapter = factory.Adapters[0];

            // When using DeviceCreationFlags.Debug on Windows 10, ensure that "Graphics Tools" are installed via Settings/System/Apps & features/Manage optional features.
            // Also, when debugging in VS, "Enable native code debugging" must be selected on the project.
            var device = new SharpDX.Direct3D11.Device(adapter, DeviceCreationFlags.None);

            Object renderLock = new Object();

            // create a form for each projector
            foreach (var projector in ensemble.projectors)
            {
                var form = new ProjectorForm(factory, device, renderLock, projector);
                form.FullScreen = FULLSCREEN_ENABLED; // TODO: fix this so can be called after Show
                form.Show();
                Forms.Add(form);
            }
        }
Esempio n. 2
0
 void LoadEnsemble()
 {
     lock (renderLock)
     {
         try
         {
             ensemble = ProjectorCameraEnsemble.FromFile(path);
             Console.WriteLine("Loaded " + path);
         }
         catch (Exception ex)
         {
             Console.WriteLine("Could not read file from disk.\n" + ex);
             return;
         }
         EnsembleChanged();
     }
 }