mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 19:25:35 +00:00
37c40f16eb
Update X11 stack to use System.Windows.Forms.XPlatUI for its Display, Screen and RootWindow. Fixed mode setting for X11GLControl. Fixed X11 shutdown (was generating X11 errors). Added DeviceContext getter to WinWindowInfo. Made IWindowInfo disposable. Added documentation to many public methods. Worked around a Mono 1.2.4 bug with Handle creation on Windows.Forms.Control. Updated GL.BuildExtensionList to correctly parse GL_VERSION when in indirect rendering mode. Fixed crash errors in X11GLContext.CreateContext and X11GraphicsMode. Added a ref overload to Glx.ChooseVisual() IGraphicsContext.MakeCurrent now takes an IWindowInfo parameter. This allows the user to change to window is context is bound to (untested). Renamed XyzWindowInfo.Handle to XyzWindowInfo.WindowHandle.
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
#region --- License ---
|
|
/* Licensed under the MIT/X11 license.
|
|
* Copyright (c) 2006-2008 the OpenTK Team.
|
|
* This notice may not be removed from any source distribution.
|
|
* See license.txt for licensing detailed licensing details.
|
|
*/
|
|
#endregion
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace OpenTK.Platform.Windows
|
|
{
|
|
/// <internal />
|
|
/// <summary>Utility to obtain IWindowInfo from a System.Windows.Forms.Control on win32.</summary>
|
|
internal sealed class WinGLControlHelper : IGLControlHelper
|
|
{
|
|
MSG msg = new MSG();
|
|
Control control;
|
|
|
|
#region --- Constructors ---
|
|
|
|
public WinGLControlHelper(Control c)
|
|
{
|
|
control = c;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region --- IGLControlHelper Members ---
|
|
|
|
/// <summary>Returns an OpenTK.Platform.IWindowInfo describing this control.</summary>
|
|
public IWindowInfo WindowInfo { get { return new WinWindowInfo(control.Handle, null); } }
|
|
|
|
/// <summary>Returns true if no messages are pending in the event loop.</summary>
|
|
public bool IsIdle
|
|
{
|
|
get { return !OpenTK.Platform.Windows.Functions.PeekMessage(ref msg, IntPtr.Zero, 0, 0, 0); }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|