static void runFullScreen(iGraphicsEngine engine, SampleBase sample) { iVideoSetup videoSetup = new Utils.VideoSetup(idealDrmFormat); var dispatcher = engine.dispatcher(); ThreadPool.QueueUserWorkItem(obj => { Console.ReadKey(); dispatcher.postQuitMessage(0); }); engine.renderFullScreen(sample.context, fullscreenResolution, videoSetup); }
public static void print(iGraphicsEngine engine) { using (var dispatcher = engine.dispatcher()) using (var gpuEnum = engine.createGpuEnumerator()) using (var gpu = gpuEnum.openFirstAdapter()) { int count = gpu.getInfo().numConnectors; for (int i = 0; i < count; i++) { using (var c = gpu.openConnector(i)) Console.WriteLine(c.getInfo().ToString()); } } }
/// <summary>Create a window on desktop, and run the application rendering into that window.</summary> /// <remarks>This works on both Windows and Linux. On Linux you need a desktop manager for this, "Raspbian Buster Lite" distro doesn’t have it.</remarks> public static void renderWindowed(this iGraphicsEngine engine, Context content, string windowTitle = null, iWindowSetup windowSetup = null) { if (null == currentEngine) { currentEngine = new WeakReference <iGraphicsEngine>(engine); } var deviceType = RuntimeEnvironment.defaultDevice; engine.loadKeySyms(); using (var dispatcher = engine.dispatcher()) using (var window = dispatcher.nativeDispatcher.createWindow(content, windowSetup, deviceType)) { content.initialize(window, null); // Wire up the input setupWindowedInput(window, content); // Set the title window.windowTitle = windowTitle ?? $"{ content.ToString() } ( { deviceType } )"; // Run the main loop dispatcher.run(content); } content.flushShadersCache(); }