public PlatformIdle(WindowInfo info) { switch (System.Environment.OSVersion.Platform) { case PlatformID.Unix: case (PlatformID)128: implementation = new X11PlatformIdle(info); break; case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: implementation = new WinPlatformIdle(info); break; default: throw new PlatformNotSupportedException(); } }
/// <summary> /// Creates a GLContext and attaches it to this GLControl. /// </summary> public void CreateContext() { if (display_mode == null) display_mode = new DisplayMode(); WindowInfo info = new WindowInfo(this); if (!this.DesignMode) { // Mono's implementation of Windows.Forms on X11 does not allow the context to // have a different colordepth from the parent. To combat this, we do not set a // specific depth for the DisplayMode - we let the driver select one instead. display_mode.Color = new ColorMode(0); context = new GLContext(display_mode, info); idle = new PlatformIdle(info); } else { context = new DummyGLContext(display_mode); idle = new DummyPlatformIdle(); } }