mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-26 17:25:37 +00:00
Changed the INativeGLWindow.CreateWindow interface to return an IGLContext instead of a GLContext.
This commit is contained in:
parent
c08d2785ce
commit
a2673bf5ff
|
@ -71,7 +71,7 @@ namespace OpenTK
|
||||||
|
|
||||||
//InputDriver input_driver;
|
//InputDriver input_driver;
|
||||||
|
|
||||||
GLContext glContext;
|
IGLContext glContext;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ namespace OpenTK
|
||||||
/// Returns the opengl IGLontext associated with the current GameWindow.
|
/// Returns the opengl IGLontext associated with the current GameWindow.
|
||||||
/// Forces window creation.
|
/// Forces window creation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GLContext Context
|
public IGLContext Context
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenTK.Platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
interface INativeGLWindow : IResizable, IDisposable
|
interface INativeGLWindow : IResizable, IDisposable
|
||||||
{
|
{
|
||||||
void CreateWindow(DisplayMode mode, out GLContext context);
|
void CreateWindow(DisplayMode mode, out IGLContext context);
|
||||||
void DestroyWindow();
|
void DestroyWindow();
|
||||||
void ProcessEvents();
|
void ProcessEvents();
|
||||||
void PointToClient(ref System.Drawing.Point p);
|
void PointToClient(ref System.Drawing.Point p);
|
||||||
|
|
|
@ -277,9 +277,9 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode, out GLContext context)
|
#region public void CreateWindow(DisplayMode mode, out IGLContext context)
|
||||||
|
|
||||||
public void CreateWindow(DisplayMode windowMode, out GLContext context)
|
public void CreateWindow(DisplayMode windowMode, out IGLContext context)
|
||||||
{
|
{
|
||||||
Debug.Print("Creating native window with mode: {0}", windowMode.ToString());
|
Debug.Print("Creating native window with mode: {0}", windowMode.ToString());
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
|
@ -336,8 +336,13 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
Functions.SetWindowPos(this.Handle, WindowPlacementOptions.TOP, Left, Top, cp.Width, cp.Height, SetWindowPosFlags.SHOWWINDOW);
|
Functions.SetWindowPos(this.Handle, WindowPlacementOptions.TOP, Left, Top, cp.Width, cp.Height, SetWindowPosFlags.SHOWWINDOW);
|
||||||
|
|
||||||
context = new GLContext(mode, window);
|
//context = new GLContext(mode, window);
|
||||||
context.CreateContext();
|
//context.CreateContext();
|
||||||
|
|
||||||
|
context = new WinGLContext();
|
||||||
|
(context as IGLContextCreationHack).SetWindowHandle(window.Handle);
|
||||||
|
(context as IGLContextCreationHack).SelectDisplayMode(mode, window);
|
||||||
|
context.CreateContext(true, null);
|
||||||
|
|
||||||
Debug.Unindent();
|
Debug.Unindent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode, out GLContext glContext)
|
#region public void CreateWindow(DisplayMode mode, out IGLContext glContext)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens a new render window with the given DisplayMode.
|
/// Opens a new render window with the given DisplayMode.
|
||||||
|
@ -347,7 +347,7 @@ namespace OpenTK.Platform.X11
|
||||||
/// Colormap creation is currently disabled.
|
/// Colormap creation is currently disabled.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public void CreateWindow(DisplayMode mode, out GLContext glContext)
|
public void CreateWindow(DisplayMode mode, out IGLContext glContext)
|
||||||
{
|
{
|
||||||
if (exists)
|
if (exists)
|
||||||
throw new ApplicationException("Render window already exists!");
|
throw new ApplicationException("Render window already exists!");
|
||||||
|
@ -355,12 +355,12 @@ namespace OpenTK.Platform.X11
|
||||||
Debug.Print("Creating GameWindow with mode: {0}", mode != null ? mode.ToString() : "default");
|
Debug.Print("Creating GameWindow with mode: {0}", mode != null ? mode.ToString() : "default");
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
|
|
||||||
glContext = new GLContext(mode, window);
|
glContext = new X11GLContext();
|
||||||
(glContext as IGLContextCreationHack).SelectDisplayMode(mode, window);
|
(glContext as IGLContextCreationHack).SelectDisplayMode(mode, window);
|
||||||
if (glContext == null)
|
if (glContext == null)
|
||||||
throw new ApplicationException("Could not create GLContext");
|
throw new ApplicationException("Could not create GLContext");
|
||||||
Debug.Print("Created GLContext");
|
Debug.Print("Created GLContext");
|
||||||
window.VisualInfo = ((glContext as IGLContextInternal).Info as X11.WindowInfo).VisualInfo;
|
window.VisualInfo = ((X11.WindowInfo)(glContext as IGLContextInternal).Info).VisualInfo;
|
||||||
//window.VisualInfo = Marshal.PtrToStructure(Glx.ChooseVisual(window.Display, window.Screen,
|
//window.VisualInfo = Marshal.PtrToStructure(Glx.ChooseVisual(window.Display, window.Screen,
|
||||||
|
|
||||||
// Create a window on this display using the visual above
|
// Create a window on this display using the visual above
|
||||||
|
|
Loading…
Reference in a new issue