mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-08 10:10:00 +00:00
Added setter to GLContext.CurrentContext and all implementations, so that the user can clear the context of any thread.
Updated GameWindow and its implementations to use GraphicsFormat instead of the obsolete DisplayMode. Updated license. Updated some docs. Fixed CLSCopmliant warnings in XRamExtension.cs
This commit is contained in:
parent
3b61ea541c
commit
5c6a261030
|
@ -1,6 +1,8 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Licensed under the MIT/X11 license.
|
||||||
* See license.txt for license info
|
* 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
|
#endregion
|
||||||
|
|
||||||
|
@ -17,6 +19,7 @@ namespace OpenTK
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
/// <summary>Defines the display mode for a render window.</summary>
|
/// <summary>Defines the display mode for a render window.</summary>
|
||||||
|
[Obsolete]
|
||||||
public sealed class DisplayMode
|
public sealed class DisplayMode
|
||||||
{
|
{
|
||||||
#region --- Private Variables ---
|
#region --- Private Variables ---
|
||||||
|
@ -36,72 +39,11 @@ namespace OpenTK
|
||||||
|
|
||||||
#region --- Constructors ---
|
#region --- Constructors ---
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructs a new DisplayMode from the given DisplayMode.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mode"></param>
|
|
||||||
public DisplayMode(DisplayMode mode)
|
public DisplayMode(DisplayMode mode)
|
||||||
: this(mode.ColorFormat, mode.Depth, mode.Stencil, mode.AuxilliaryColorFormat, mode.Buffers, mode.Stereo) { }
|
: this(mode.width, mode.height, mode.color_format, mode.depthBits, mode.stencilBits, mode.auxilliary_color_format.BitsPerPixel,
|
||||||
|
mode.buffers, mode.fullscreen, mode.stereo, mode.vsync, mode.refreshRate) { }
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with sensible default parameters.</summary>
|
public DisplayMode() : this(640, 480) { }
|
||||||
public DisplayMode()
|
|
||||||
: this(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 2, false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
public DisplayMode(ColorMode color)
|
|
||||||
: this(color, 16, 0, 0, 2, false) { }
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
|
||||||
public DisplayMode(ColorMode color, int depth)
|
|
||||||
: this(color, depth, 0, 0, 2, false) { }
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
|
||||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
|
||||||
public DisplayMode(ColorMode color, int depth, int stencil)
|
|
||||||
: this(color, depth, stencil, 0, 2, false) { }
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
|
||||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
|
||||||
/// <param name="aux">The ColorMode of the auxilliary buffer.</param>
|
|
||||||
public DisplayMode(ColorMode color, int depth, int stencil, ColorMode aux)
|
|
||||||
: this(color, depth, stencil, aux, 2, false) { }
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
|
||||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
|
||||||
/// <param name="aux">The ColorMode of the auxilliary buffer.</param>
|
|
||||||
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
|
||||||
public DisplayMode(ColorMode color, int depth, int stencil, ColorMode aux, int buffers)
|
|
||||||
: this(color, depth, stencil, aux, buffers, false) { }
|
|
||||||
|
|
||||||
/// <summary>Constructs a new DisplayMode with the specified parameters.</summary>
|
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
|
||||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
|
||||||
/// <param name="aux">The ColorMode of the auxilliary buffer.</param>
|
|
||||||
/// <param name="stereo">Set to true for a DisplayMode with stereographic capabilities.</param>
|
|
||||||
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
|
||||||
public DisplayMode(ColorMode color, int depth, int stencil, ColorMode aux, int buffers, bool stereo)
|
|
||||||
{
|
|
||||||
this.ColorFormat = color;
|
|
||||||
this.Depth = depth;
|
|
||||||
this.Stencil = stencil;
|
|
||||||
this.AuxilliaryColorFormat = aux;
|
|
||||||
this.Buffers = buffers;
|
|
||||||
this.Stereo = stereo;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Obsolete Constructors
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs a new DisplayMode from the specified parameters.
|
/// Constructs a new DisplayMode from the specified parameters.
|
||||||
|
@ -117,7 +59,6 @@ namespace OpenTK
|
||||||
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
||||||
/// <param name="vsync">Set to true to sync the updates to the screen refresh rate.</param>
|
/// <param name="vsync">Set to true to sync the updates to the screen refresh rate.</param>
|
||||||
/// <param name="refresh">The desired RefreshRate. Taken into account only for Fullscreen DisplayModes.</param>
|
/// <param name="refresh">The desired RefreshRate. Taken into account only for Fullscreen DisplayModes.</param>
|
||||||
[Obsolete]
|
|
||||||
public DisplayMode(int width, int height, ColorMode color, int depth, int stencil, int aux, int buffers,
|
public DisplayMode(int width, int height, ColorMode color, int depth, int stencil, int aux, int buffers,
|
||||||
bool fullscreen, bool stereo, bool vsync, float refresh)
|
bool fullscreen, bool stereo, bool vsync, float refresh)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +80,6 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="width">The Width of the DisplayMode in pixels.</param>
|
/// <param name="width">The Width of the DisplayMode in pixels.</param>
|
||||||
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
||||||
[Obsolete]
|
|
||||||
public DisplayMode(int width, int height)
|
public DisplayMode(int width, int height)
|
||||||
: this(width, height, DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, false, false, false, 0.0f)
|
: this(width, height, DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, false, false, false, 0.0f)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +91,6 @@ namespace OpenTK
|
||||||
/// <param name="width">The Width of the DisplayMode in pixels.</param>
|
/// <param name="width">The Width of the DisplayMode in pixels.</param>
|
||||||
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
/// <param name="color">The ColorMode of the color buffer.</param>
|
||||||
[Obsolete]
|
|
||||||
public DisplayMode(int width, int height, ColorMode color)
|
public DisplayMode(int width, int height, ColorMode color)
|
||||||
: this(width, height, color, 16, 0, 0, 0, false, false, false, 0.0f)
|
: this(width, height, color, 16, 0, 0, 0, false, false, false, 0.0f)
|
||||||
{
|
{
|
||||||
|
@ -164,7 +103,6 @@ namespace OpenTK
|
||||||
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
/// <param name="color">The ColorMode of the color buffer.</param>
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
/// <param name="depth">The number of bits in the depth buffer.</param>
|
||||||
[Obsolete]
|
|
||||||
public DisplayMode(int width, int height, ColorMode color, int depth)
|
public DisplayMode(int width, int height, ColorMode color, int depth)
|
||||||
: this(width, height, color, depth, 0, 0, 0, false, false, false, 0.0f)
|
: this(width, height, color, depth, 0, 0, 0, false, false, false, 0.0f)
|
||||||
{
|
{
|
||||||
|
@ -178,7 +116,6 @@ namespace OpenTK
|
||||||
/// <param name="color">The ColorMode of the color buffer.</param>
|
/// <param name="color">The ColorMode of the color buffer.</param>
|
||||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
/// <param name="depth">The number of bits in the depth buffer.</param>
|
||||||
/// <param name="fullscreen">True for a fullscreen DisplayMode, false otherwise.</param>
|
/// <param name="fullscreen">True for a fullscreen DisplayMode, false otherwise.</param>
|
||||||
[Obsolete]
|
|
||||||
public DisplayMode(int width, int height, ColorMode color, int depth, bool fullscreen)
|
public DisplayMode(int width, int height, ColorMode color, int depth, bool fullscreen)
|
||||||
: this(width, height, color, depth, 0, 0, 0, fullscreen, false, false, 0.0f)
|
: this(width, height, color, depth, 0, 0, 0, fullscreen, false, false, 0.0f)
|
||||||
{
|
{
|
||||||
|
@ -186,10 +123,8 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region --- Public Properties ---
|
#region --- Public Properties ---
|
||||||
|
#if false
|
||||||
#region public int ColorFormat
|
#region public int ColorFormat
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -243,12 +178,15 @@ namespace OpenTK
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
#endif
|
||||||
|
#region Obsolete Properties
|
||||||
|
|
||||||
#region public bool Stereo
|
#region public bool Stereo
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a System.Boolean indicating whether this DisplayMode is stereoscopic.
|
/// Gets a System.Boolean indicating whether this DisplayMode is stereoscopic.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use GraphicsFormat.Stereo instead.")]
|
||||||
public bool Stereo
|
public bool Stereo
|
||||||
{
|
{
|
||||||
get { return this.stereo; }
|
get { return this.stereo; }
|
||||||
|
@ -263,6 +201,7 @@ namespace OpenTK
|
||||||
/// Gets a System.Int32 containing the number of buffers associated with this
|
/// Gets a System.Int32 containing the number of buffers associated with this
|
||||||
/// DisplayMode.
|
/// DisplayMode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use GraphicsFormat.Buffers instead.")]
|
||||||
public int Buffers
|
public int Buffers
|
||||||
{
|
{
|
||||||
get { return this.buffers; }
|
get { return this.buffers; }
|
||||||
|
@ -271,8 +210,6 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Obsolete Properties
|
|
||||||
|
|
||||||
[Obsolete("Use GameWindow.Fullscreen instead.")]
|
[Obsolete("Use GameWindow.Fullscreen instead.")]
|
||||||
public bool Fullscreen
|
public bool Fullscreen
|
||||||
{
|
{
|
||||||
|
@ -287,7 +224,7 @@ namespace OpenTK
|
||||||
internal set { this.vsync = value; }
|
internal set { this.vsync = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use OpenTK.Graphics.Display.RefreshRate instead.")]
|
[Obsolete("Use OpenTK.Graphics.DisplayDevice.RefreshRate instead.")]
|
||||||
public float RefreshRate
|
public float RefreshRate
|
||||||
{
|
{
|
||||||
get { return this.refreshRate; }
|
get { return this.refreshRate; }
|
||||||
|
@ -296,7 +233,7 @@ namespace OpenTK
|
||||||
|
|
||||||
#region public ColorDepth Color
|
#region public ColorDepth Color
|
||||||
|
|
||||||
[Obsolete("Use DisplayMode.ColorFormat instead.")]
|
[Obsolete("Use GraphicsFormat.Color instead.")]
|
||||||
public ColorMode Color
|
public ColorMode Color
|
||||||
{
|
{
|
||||||
get { return this.color_format; }
|
get { return this.color_format; }
|
||||||
|
@ -345,31 +282,36 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
[Obsolete("Use DisplayMode.Depth instead.")]
|
[Obsolete("Use GraphicsFormat.Depth instead.")]
|
||||||
public int DepthBits
|
public int DepthBits
|
||||||
{
|
{
|
||||||
get { return this.depthBits; }
|
get { return this.depthBits; }
|
||||||
internal set { this.depthBits = value; }
|
internal set { this.depthBits = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use DisplayMode.Stencil instead.")]
|
[Obsolete("Use GraphicsFormat.Stencil instead.")]
|
||||||
public int StencilBits
|
public int StencilBits
|
||||||
{
|
{
|
||||||
get { return this.stencilBits; }
|
get { return this.stencilBits; }
|
||||||
internal set { this.stencilBits = value; }
|
internal set { this.stencilBits = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use DisplayMode.AuxilliaryColorFormat instead.")]
|
[Obsolete("Use GraphicsFormat.AuxilliaryColorFormat instead.")]
|
||||||
public int AuxBits
|
public int AuxBits
|
||||||
{
|
{
|
||||||
get { return this.AuxilliaryColorFormat.BitsPerPixel; }
|
get { return this.auxilliary_color_format.BitsPerPixel; }
|
||||||
internal set { this.AuxilliaryColorFormat = value; }
|
internal set { this.auxilliary_color_format = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
internal GraphicsFormat ToGraphicsFormat()
|
||||||
|
{
|
||||||
|
return new GraphicsFormat(this.Color, this.DepthBits, this.StencilBits, this.AuxBits, this.Buffers, this.Stereo);
|
||||||
|
}
|
||||||
|
|
||||||
#region --- Overrides ---
|
#region --- Overrides ---
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace OpenTK
|
||||||
internal static GetCurrentContextDelegate GetCurrentContext;
|
internal static GetCurrentContextDelegate GetCurrentContext;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the context which is current in the calling thread.
|
/// Gets or sets the current GraphicsContext in the calling thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static GLContext CurrentContext
|
public static GLContext CurrentContext
|
||||||
{
|
{
|
||||||
|
@ -112,6 +112,13 @@ namespace OpenTK
|
||||||
return null;
|
return null;
|
||||||
//return (GLContext)available_contexts[StaticGetCurrentContext().ToInt64()].Target;
|
//return (GLContext)available_contexts[StaticGetCurrentContext().ToInt64()].Target;
|
||||||
}
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
value.MakeCurrent();
|
||||||
|
else if (CurrentContext != null)
|
||||||
|
CurrentContext.IsCurrent = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -204,6 +211,7 @@ namespace OpenTK
|
||||||
public bool IsCurrent
|
public bool IsCurrent
|
||||||
{
|
{
|
||||||
get { return implementation.IsCurrent; }
|
get { return implementation.IsCurrent; }
|
||||||
|
set { implementation.IsCurrent = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -253,15 +261,15 @@ namespace OpenTK
|
||||||
get { return (implementation as IGLContextInternal).Mode; }
|
get { return (implementation as IGLContextInternal).Mode; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
||||||
/// calling thread, or IntPtr.Zero if no OpenGL context is current.
|
///// calling thread, or IntPtr.Zero if no OpenGL context is current.
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
///// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
||||||
ContextHandle IGLContextInternal.GetCurrentContext()
|
//ContextHandle IGLContextInternal.GetCurrentContext()
|
||||||
{
|
//{
|
||||||
return (implementation as IGLContextInternal).GetCurrentContext();
|
// return (implementation as IGLContextInternal).GetCurrentContext();
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers an OpenGL resource for disposal.
|
/// Registers an OpenGL resource for disposal.
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Licensed under the MIT/X11 license.
|
||||||
* See license.txt for license info
|
* 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
|
#endregion
|
||||||
|
|
||||||
|
@ -8,12 +10,13 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
using OpenTK.Platform;
|
using OpenTK.Platform;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Threading;
|
|
||||||
using OpenTK.OpenGL;
|
using OpenTK.OpenGL;
|
||||||
using OpenTK.OpenGL.Enums;
|
using OpenTK.OpenGL.Enums;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace OpenTK
|
namespace OpenTK
|
||||||
{
|
{
|
||||||
|
@ -86,25 +89,23 @@ namespace OpenTK
|
||||||
|
|
||||||
#region --- Contructors ---
|
#region --- Contructors ---
|
||||||
|
|
||||||
/// <summary>
|
public GameWindow() : this("OpenTK Game Window", 640, 480, null, GraphicsFormat.Default) { }
|
||||||
/// Constructs a new GameWindow using a safe DisplayMode.
|
|
||||||
/// </summary>
|
|
||||||
public GameWindow() : this(new DisplayMode(640, 480, 0, 16, false), "OpenTK game window")
|
|
||||||
{ }
|
|
||||||
|
|
||||||
/// <summary>
|
public GameWindow(string title) : this(title, 640, 480, null, GraphicsFormat.Default) { }
|
||||||
/// Constructs a new GameWindow, and opens a render window with the specified DisplayMode.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mode">The DisplayMode of the GameWindow.</param>
|
|
||||||
public GameWindow(DisplayMode mode) : this(mode, "OpenTK game window") { }
|
|
||||||
|
|
||||||
/// <summary>
|
public GameWindow(string title, int width, int height)
|
||||||
/// Constructs a new GameWindow with the specified title, and opens a render window with the
|
: this(title, width, height, null, GraphicsFormat.Default) { }
|
||||||
/// specified DisplayMode.
|
|
||||||
/// </summary>
|
public GameWindow(string title, int width, int height, GraphicsFormat format)
|
||||||
/// <param name="mode">The DisplayMode of the GameWindow.</param>
|
: this(title, width, height, null, format) { }
|
||||||
/// <param name="title">The Title of the GameWindow.</param>
|
|
||||||
public GameWindow(DisplayMode mode, string title)
|
public GameWindow(string title, DisplayResolution resolution)
|
||||||
|
: this(title, resolution.Width, resolution.Height, resolution, GraphicsFormat.Default) { }
|
||||||
|
|
||||||
|
public GameWindow(string title, DisplayResolution resolution, GraphicsFormat format)
|
||||||
|
: this(title, resolution.Width, resolution.Height, resolution, format) { }
|
||||||
|
|
||||||
|
GameWindow(string title, int width, int height, DisplayResolution resolution, GraphicsFormat format)
|
||||||
{
|
{
|
||||||
switch (Environment.OSVersion.Platform)
|
switch (Environment.OSVersion.Platform)
|
||||||
{
|
{
|
||||||
|
@ -122,15 +123,43 @@ namespace OpenTK
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new PlatformNotSupportedException(
|
throw new PlatformNotSupportedException(
|
||||||
"Your platform is not supported currently. Please, refer to http://opentk.sourceforge.net for more information.");
|
"Your platform is not supported currently. Please, refer to http://www.opentk.com for more information.");
|
||||||
}
|
}
|
||||||
|
|
||||||
glWindow.Destroy += glWindow_Destroy;
|
glWindow.Destroy += glWindow_Destroy;
|
||||||
|
|
||||||
CreateWindow(mode, title);
|
// TODO: GLContext is created inside this call.
|
||||||
|
glWindow.CreateWindow(width, height, format, out glContext);
|
||||||
|
this.Title = title;
|
||||||
|
|
||||||
//this.vsync = VSyncMode.Adaptive;
|
if (resolution != null)
|
||||||
this.VSync = VSyncMode.On;
|
{
|
||||||
|
DisplayDevice.PrimaryDisplay.ChangeResolution(resolution);
|
||||||
|
this.Fullscreen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.VSync = VSyncMode.On; //VSyncMode.Adaptive;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a new GameWindow, and opens a render window with the specified DisplayMode.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mode">The DisplayMode of the GameWindow.</param>
|
||||||
|
[Obsolete]
|
||||||
|
public GameWindow(DisplayMode mode)
|
||||||
|
: this("OpenTK Game Window", mode.Width, mode.Height,
|
||||||
|
mode.Fullscreen ? DisplayDevice.PrimaryDisplay.SelectResolution(
|
||||||
|
mode.Width, mode.Height, mode.Color.BitsPerPixel, 0) : null, mode.ToGraphicsFormat()) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a new GameWindow with the specified title, and opens a render window with the
|
||||||
|
/// specified DisplayMode.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mode">The DisplayMode of the GameWindow.</param>
|
||||||
|
/// <param name="title">The Title of the GameWindow.</param>
|
||||||
|
[Obsolete]
|
||||||
|
public GameWindow(DisplayMode mode, string title)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void glWindow_Destroy(object sender, EventArgs e)
|
void glWindow_Destroy(object sender, EventArgs e)
|
||||||
|
@ -215,17 +244,7 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IGLContext Context
|
public IGLContext Context
|
||||||
{
|
{
|
||||||
get
|
get { return glContext; }
|
||||||
{
|
|
||||||
if (!this.Exists && !this.IsExiting)
|
|
||||||
{
|
|
||||||
Debug.WriteLine("WARNING: OpenGL Context accessed before creating a render window. This may indicate a programming error. Force-creating a render window.");
|
|
||||||
mode = new DisplayMode(640, 480);
|
|
||||||
this.CreateWindow(mode);
|
|
||||||
}
|
|
||||||
//return glWindow.Context;
|
|
||||||
return glContext;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -311,38 +330,6 @@ namespace OpenTK
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode)
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a render window for the calling GameWindow.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mode">The DisplayMode of the render window.</param>
|
|
||||||
/// <remarks>
|
|
||||||
/// It is an error to call this function when a render window already exists.
|
|
||||||
/// <para>Call DestroyWindow to close the render window.</para>
|
|
||||||
/// </remarks>
|
|
||||||
/// <exception cref="ApplicationException">Occurs when a render window already exists.</exception>
|
|
||||||
public void CreateWindow(DisplayMode mode)
|
|
||||||
{
|
|
||||||
if (!Exists)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
glWindow.CreateWindow(mode.Width, mode.Height, mode, out glContext);
|
|
||||||
}
|
|
||||||
catch (ApplicationException expt)
|
|
||||||
{
|
|
||||||
Debug.Print(expt.ToString());
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new ApplicationException("A render window already exists for this GameWindow.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region public void DestroyWindow()
|
#region public void DestroyWindow()
|
||||||
|
|
||||||
|
@ -362,34 +349,7 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- GameWindow Methods ---
|
#region --- Public Methods ---
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode, string title)
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a render window for the calling GameWindow, with the specified DisplayMode and Title.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mode">The DisplayMode of the render window.</param>
|
|
||||||
/// <param name="title">The Title of the render window.</param>
|
|
||||||
/// <remarks>
|
|
||||||
/// It is an error to call this function when a render window already exists.
|
|
||||||
/// <para>Call DestroyWindow to close the render window.</para>
|
|
||||||
/// </remarks>
|
|
||||||
/// <exception cref="ApplicationException">Occurs when a render window already exists.</exception>
|
|
||||||
private void CreateWindow(DisplayMode mode, string title)
|
|
||||||
{
|
|
||||||
if (!Exists)
|
|
||||||
{
|
|
||||||
// TODO: This is a hack - reslove in 0.3.15 once and for all!
|
|
||||||
// GLContext is created inside the CreateWindow call.
|
|
||||||
glWindow.CreateWindow(mode.Width, mode.Height, mode, out glContext);
|
|
||||||
this.Title = title;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
throw new InvalidOperationException("A render window already exists for this GameWindow.");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region void Run()
|
#region void Run()
|
||||||
|
|
||||||
|
@ -519,7 +479,7 @@ namespace OpenTK
|
||||||
if (VSync == VSyncMode.Adaptive)
|
if (VSync == VSyncMode.Adaptive)
|
||||||
{
|
{
|
||||||
// Check if we have enough time for a vsync
|
// Check if we have enough time for a vsync
|
||||||
if (RenderTime > 2.0 * TargetRenderPeriod)
|
if (TargetRenderPeriod != 0 && RenderTime > 2.0 * TargetRenderPeriod)
|
||||||
Context.VSync = false;
|
Context.VSync = false;
|
||||||
else
|
else
|
||||||
Context.VSync = true;
|
Context.VSync = true;
|
||||||
|
@ -609,12 +569,6 @@ namespace OpenTK
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void OnRenderFrameInternal(RenderFrameEventArgs e)
|
private void OnRenderFrameInternal(RenderFrameEventArgs e)
|
||||||
{
|
{
|
||||||
if (!this.Exists && !this.IsExiting)
|
|
||||||
{
|
|
||||||
Debug.Print("WARNING: RenderFrame event raised, without a valid render window. This may indicate a programming error. Creating render window.");
|
|
||||||
mode = new DisplayMode(640, 480);
|
|
||||||
this.CreateWindow(mode);
|
|
||||||
}
|
|
||||||
if (RenderFrame != null)
|
if (RenderFrame != null)
|
||||||
RenderFrame(this, e);
|
RenderFrame(this, e);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace OpenTK.OpenAL
|
||||||
|
|
||||||
#region X-RAM Function pointer definitions
|
#region X-RAM Function pointer definitions
|
||||||
|
|
||||||
[CLSCompliant( false )]
|
//[CLSCompliant(false)]
|
||||||
private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value );
|
private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value );
|
||||||
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace OpenTK.Platform
|
||||||
|
|
||||||
public void SwapBuffers() { }
|
public void SwapBuffers() { }
|
||||||
public void MakeCurrent() { }
|
public void MakeCurrent() { }
|
||||||
public bool IsCurrent { get { return true; } }
|
public bool IsCurrent { get { return true; } set { } }
|
||||||
public IntPtr GetCurrentContext() { return IntPtr.Zero; }
|
public IntPtr GetCurrentContext() { return IntPtr.Zero; }
|
||||||
|
|
||||||
public event DestroyEvent<IGLContext> Destroy;
|
public event DestroyEvent<IGLContext> Destroy;
|
||||||
|
|
|
@ -24,20 +24,20 @@ namespace OpenTK.Platform
|
||||||
/// <seealso cref="CreateContext(bool)"/>
|
/// <seealso cref="CreateContext(bool)"/>
|
||||||
void CreateContext(bool direct, IGLContext source);
|
void CreateContext(bool direct, IGLContext source);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Swaps buffers, presenting the rendered scene to the user.</summary>
|
||||||
/// Swaps buffers, presenting the rendered scene to the user.
|
|
||||||
/// </summary>
|
|
||||||
void SwapBuffers();
|
void SwapBuffers();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Makes the GraphicsContext current in the calling thread.</summary>
|
||||||
/// Makes the Context current in the calling thread, i.e. future OpenGL commands will affect this Context.
|
/// <remarks>
|
||||||
/// </summary>
|
/// <para>OpenGL commands in one thread, affect the GraphicsContext which is current in that thread.</para>
|
||||||
|
/// <para>It is an error to issue an OpenGL command in a thread without a current GraphicsContext.</para>
|
||||||
|
/// </remarks>
|
||||||
void MakeCurrent();
|
void MakeCurrent();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a System.Boolean indicating whether this Context is current in the calling thread.
|
/// Gets or sets a System.Boolean indicating whether the GraphicsContext is current in the calling thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool IsCurrent { get; }
|
bool IsCurrent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when a Context is destroyed.
|
/// Raised when a Context is destroyed.
|
||||||
|
@ -79,12 +79,12 @@ namespace OpenTK.Platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DisplayMode Mode { get; }
|
DisplayMode Mode { get; }
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
||||||
/// calling thread, or IntPtr.Zero if no OpenGL context is current.
|
///// calling thread, or IntPtr.Zero if no OpenGL context is current.
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
///// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
||||||
ContextHandle GetCurrentContext();
|
//ContextHandle GetCurrentContext();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers an OpenGL resource for disposal.
|
/// Registers an OpenGL resource for disposal.
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Licensed under the MIT/X11 license.
|
||||||
* See license.txt for license info
|
* 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
|
#endregion
|
||||||
|
|
||||||
|
@ -9,15 +11,17 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace OpenTK.Platform
|
namespace OpenTK.Platform
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This interface supports OpenTK, and is not intended for use by OpenTK programs.
|
/// This interface supports OpenTK, and is not intended for use by OpenTK programs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
interface INativeGLWindow : IResizable, IDisposable
|
internal interface INativeGLWindow : IResizable, IDisposable
|
||||||
{
|
{
|
||||||
void CreateWindow(int width, int height, DisplayMode mode, out IGLContext context);
|
//void CreateWindow(int width, int height, DisplayMode mode, out IGLContext context);
|
||||||
|
void CreateWindow(int width, int height, GraphicsFormat 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);
|
||||||
|
|
|
@ -38,13 +38,15 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#region --- Contructors ---
|
#region --- Contructors ---
|
||||||
|
|
||||||
/// <summary>
|
static WinGLContext()
|
||||||
/// Constructs a new WinGLContext object.
|
{
|
||||||
/// </summary>
|
// Set the GetCurrentContext implementation.
|
||||||
|
if (GLContext.GetCurrentContext == null)
|
||||||
|
GLContext.GetCurrentContext = WinGLContext.GetCurrentContext;
|
||||||
|
}
|
||||||
|
|
||||||
public WinGLContext()
|
public WinGLContext()
|
||||||
{
|
{
|
||||||
if (GLContext.GetCurrentContext == null)
|
|
||||||
GLContext.GetCurrentContext = this.GetCurrentContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -127,15 +129,14 @@ namespace OpenTK.Platform.Windows
|
||||||
public bool IsCurrent
|
public bool IsCurrent
|
||||||
{
|
{
|
||||||
get { return Wgl.GetCurrentContext() == this.renderContext; }
|
get { return Wgl.GetCurrentContext() == this.renderContext; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
Wgl.MakeCurrent(this.deviceContext, this.renderContext);
|
||||||
|
else
|
||||||
|
Wgl.MakeCurrent(IntPtr.Zero, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region public ContextHandle GetCurrentContext()
|
|
||||||
|
|
||||||
public ContextHandle GetCurrentContext()
|
|
||||||
{
|
|
||||||
return Wgl.GetCurrentContext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -292,10 +293,10 @@ namespace OpenTK.Platform.Windows
|
||||||
pixelFormat.AccumAlphaBits = (byte)accum.Alpha;
|
pixelFormat.AccumAlphaBits = (byte)accum.Alpha;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
pixelFormat.DepthBits = (byte)mode.Depth;
|
pixelFormat.DepthBits = (byte)mode.DepthBits;
|
||||||
pixelFormat.StencilBits = (byte)mode.Stencil;
|
pixelFormat.StencilBits = (byte)mode.StencilBits;
|
||||||
|
|
||||||
if (mode.Depth <= 0)
|
if (mode.DepthBits <= 0)
|
||||||
{
|
{
|
||||||
pixelFormat.Flags |= PixelFormatDescriptorFlags.DEPTH_DONTCARE;
|
pixelFormat.Flags |= PixelFormatDescriptorFlags.DEPTH_DONTCARE;
|
||||||
}
|
}
|
||||||
|
@ -348,7 +349,7 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- Internal Members ---
|
#region --- Methods ---
|
||||||
|
|
||||||
#region internal IntPtr Device
|
#region internal IntPtr Device
|
||||||
|
|
||||||
|
@ -356,6 +357,15 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region static ContextHandle GetCurrentContext()
|
||||||
|
|
||||||
|
static ContextHandle GetCurrentContext()
|
||||||
|
{
|
||||||
|
return Wgl.GetCurrentContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IDisposable Members ---
|
#region --- IDisposable Members ---
|
||||||
|
|
|
@ -14,6 +14,7 @@ using System.Windows.Forms;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using OpenTK.OpenGL;
|
using OpenTK.OpenGL;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -306,12 +307,13 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode, out IGLContext context)
|
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext context)
|
||||||
|
|
||||||
public void CreateWindow(int width, int height, DisplayMode windowMode, out IGLContext context)
|
public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext context)
|
||||||
{
|
{
|
||||||
Debug.Print("Creating native window with mode: {0}", windowMode.ToString());
|
Debug.Print("Creating native window.");
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
|
Debug.Print("GraphicsFormat: {0}", format.ToString());
|
||||||
|
|
||||||
CreateParams cp = new CreateParams();
|
CreateParams cp = new CreateParams();
|
||||||
cp.ClassStyle =
|
cp.ClassStyle =
|
||||||
|
|
|
@ -679,16 +679,22 @@ XF86VidModeGetGammaRampSize(
|
||||||
|
|
||||||
#region internal struct XRRScreenSize
|
#region internal struct XRRScreenSize
|
||||||
|
|
||||||
|
#pragma warning disable 0169, 0649
|
||||||
|
|
||||||
internal struct XRRScreenSize
|
internal struct XRRScreenSize
|
||||||
{
|
{
|
||||||
internal int Width, Height;
|
internal int Width, Height;
|
||||||
internal int MWidth, MHeight;
|
internal int MWidth, MHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma warning restore 0169, 0649
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region unsafe internal struct Screen
|
#region unsafe internal struct Screen
|
||||||
|
|
||||||
|
#pragma warning disable 0169
|
||||||
|
|
||||||
unsafe internal struct Screen
|
unsafe internal struct Screen
|
||||||
{
|
{
|
||||||
XExtData ext_data; /* hook for extension to hang data */
|
XExtData ext_data; /* hook for extension to hang data */
|
||||||
|
@ -710,10 +716,14 @@ XF86VidModeGetGammaRampSize(
|
||||||
long root_input_mask; /* initial root input mask */
|
long root_input_mask; /* initial root input mask */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma warning restore 0169
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region unsafe internal class XExtData
|
#region unsafe internal class XExtData
|
||||||
|
|
||||||
|
#pragma warning disable 0169
|
||||||
|
|
||||||
unsafe internal class XExtData
|
unsafe internal class XExtData
|
||||||
{
|
{
|
||||||
int number; /* number returned by XRegisterExtension */
|
int number; /* number returned by XRegisterExtension */
|
||||||
|
@ -723,6 +733,8 @@ XF86VidModeGetGammaRampSize(
|
||||||
XPointer private_data; /* data private to this extension. */
|
XPointer private_data; /* data private to this extension. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma warning restore 0169
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1263,7 +1275,7 @@ XF86VidModeGetGammaRampSize(
|
||||||
/// <para>The XCreateSimpleWindow function creates an unmapped InputOutput subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a CreateNotify event. The created window is placed on top in the stacking order with respect to siblings. Any part of the window that extends outside its parent window is clipped. The border_width for an InputOnly window must be zero, or a BadMatch error results. XCreateSimpleWindow inherits its depth, class, and visual from its parent. All other window attributes, except background and border, have their default values. </para>
|
/// <para>The XCreateSimpleWindow function creates an unmapped InputOutput subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a CreateNotify event. The created window is placed on top in the stacking order with respect to siblings. Any part of the window that extends outside its parent window is clipped. The border_width for an InputOnly window must be zero, or a BadMatch error results. XCreateSimpleWindow inherits its depth, class, and visual from its parent. All other window attributes, except background and border, have their default values. </para>
|
||||||
/// <para>XCreateSimpleWindow can generate BadAlloc, BadMatch, BadValue, and BadWindow errors.</para>
|
/// <para>XCreateSimpleWindow can generate BadAlloc, BadMatch, BadValue, and BadWindow errors.</para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[DllImport(X11Library, EntryPoint = "XCreateWindow"), CLSCompliant(false)]
|
[DllImport(X11Library, EntryPoint = "XCreateWindow")]//, CLSCompliant(false)]
|
||||||
public extern static Window XCreateWindow(Display display, Window parent,
|
public extern static Window XCreateWindow(Display display, Window parent,
|
||||||
int x, int y, int width, int height, int border_width, int depth,
|
int x, int y, int width, int height, int border_width, int depth,
|
||||||
int @class, IntPtr visual, UIntPtr valuemask, ref XSetWindowAttributes attributes);
|
int @class, IntPtr visual, UIntPtr valuemask, ref XSetWindowAttributes attributes);
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XCreateWindow")]
|
[DllImport("libX11", EntryPoint = "XCreateWindow")]
|
||||||
public extern static IntPtr XCreateWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, int depth, int xclass, IntPtr visual, IntPtr valuemask, ref XSetWindowAttributes attributes);
|
public extern static IntPtr XCreateWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, int depth, int xclass, IntPtr visual, IntPtr valuemask, ref XSetWindowAttributes attributes);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XCreateSimpleWindow"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XCreateSimpleWindow")]//, CLSCompliant(false)]
|
||||||
public extern static IntPtr XCreateSimpleWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, UIntPtr border, UIntPtr background);
|
public extern static IntPtr XCreateSimpleWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, UIntPtr border, UIntPtr background);
|
||||||
[DllImport("libX11", EntryPoint = "XCreateSimpleWindow")]
|
[DllImport("libX11", EntryPoint = "XCreateSimpleWindow")]
|
||||||
public extern static IntPtr XCreateSimpleWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, IntPtr border, IntPtr background);
|
public extern static IntPtr XCreateSimpleWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, IntPtr border, IntPtr background);
|
||||||
|
@ -81,10 +81,10 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XRaiseWindow")]
|
[DllImport("libX11", EntryPoint = "XRaiseWindow")]
|
||||||
public extern static int XRaiseWindow(IntPtr display, IntPtr window);
|
public extern static int XRaiseWindow(IntPtr display, IntPtr window);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XLowerWindow"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XLowerWindow")]//, CLSCompliant(false)]
|
||||||
public extern static uint XLowerWindow(IntPtr display, IntPtr window);
|
public extern static uint XLowerWindow(IntPtr display, IntPtr window);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XConfigureWindow"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XConfigureWindow")]//, CLSCompliant(false)]
|
||||||
public extern static uint XConfigureWindow(IntPtr display, IntPtr window, ChangeWindowAttributes value_mask, ref XWindowChanges values);
|
public extern static uint XConfigureWindow(IntPtr display, IntPtr window, ChangeWindowAttributes value_mask, ref XWindowChanges values);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XInternAtom")]
|
[DllImport("libX11", EntryPoint = "XInternAtom")]
|
||||||
|
@ -120,7 +120,7 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XGetGeometry")]
|
[DllImport("libX11", EntryPoint = "XGetGeometry")]
|
||||||
public extern static bool XGetGeometry(IntPtr display, IntPtr window, IntPtr root, IntPtr x, IntPtr y, out int width, out int height, IntPtr border_width, IntPtr depth);
|
public extern static bool XGetGeometry(IntPtr display, IntPtr window, IntPtr root, IntPtr x, IntPtr y, out int width, out int height, IntPtr border_width, IntPtr depth);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XWarpPointer"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XWarpPointer")]//, CLSCompliant(false)]
|
||||||
public extern static uint XWarpPointer(IntPtr display, IntPtr src_w, IntPtr dest_w, int src_x, int src_y, uint src_width, uint src_height, int dest_x, int dest_y);
|
public extern static uint XWarpPointer(IntPtr display, IntPtr src_w, IntPtr dest_w, int src_x, int src_y, uint src_width, uint src_height, int dest_x, int dest_y);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XClearWindow")]
|
[DllImport("libX11", EntryPoint = "XClearWindow")]
|
||||||
|
@ -139,7 +139,7 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XDefaultVisual")]
|
[DllImport("libX11", EntryPoint = "XDefaultVisual")]
|
||||||
public extern static IntPtr XDefaultVisual(IntPtr display, int screen_number);
|
public extern static IntPtr XDefaultVisual(IntPtr display, int screen_number);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XDefaultDepth"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XDefaultDepth")]//, CLSCompliant(false)]
|
||||||
public extern static uint XDefaultDepth(IntPtr display, int screen_number);
|
public extern static uint XDefaultDepth(IntPtr display, int screen_number);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XDefaultScreen")]
|
[DllImport("libX11", EntryPoint = "XDefaultScreen")]
|
||||||
|
@ -148,10 +148,10 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XDefaultColormap")]
|
[DllImport("libX11", EntryPoint = "XDefaultColormap")]
|
||||||
public extern static IntPtr XDefaultColormap(IntPtr display, int screen_number);
|
public extern static IntPtr XDefaultColormap(IntPtr display, int screen_number);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XLookupColor"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XLookupColor")]//, CLSCompliant(false)]
|
||||||
public extern static int XLookupColor(IntPtr display, IntPtr Colormap, string Coloranem, ref XColor exact_def_color, ref XColor screen_def_color);
|
public extern static int XLookupColor(IntPtr display, IntPtr Colormap, string Coloranem, ref XColor exact_def_color, ref XColor screen_def_color);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XAllocColor"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XAllocColor")]//, CLSCompliant(false)]
|
||||||
public extern static int XAllocColor(IntPtr display, IntPtr Colormap, ref XColor colorcell_def);
|
public extern static int XAllocColor(IntPtr display, IntPtr Colormap, ref XColor colorcell_def);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XSetTransientForHint")]
|
[DllImport("libX11", EntryPoint = "XSetTransientForHint")]
|
||||||
|
@ -160,15 +160,15 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
||||||
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref MotifWmHints data, int nelements);
|
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref MotifWmHints data, int nelements);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]//, CLSCompliant(false)]
|
||||||
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref uint value, int nelements);
|
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref uint value, int nelements);
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
||||||
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref int value, int nelements);
|
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref int value, int nelements);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]//, CLSCompliant(false)]
|
||||||
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref IntPtr value, int nelements);
|
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, ref IntPtr value, int nelements);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]//, CLSCompliant(false)]
|
||||||
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, uint[] data, int nelements);
|
public extern static int XChangeProperty(IntPtr display, IntPtr window, IntPtr property, IntPtr type, int format, PropertyMode mode, uint[] data, int nelements);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
[DllImport("libX11", EntryPoint = "XChangeProperty")]
|
||||||
|
@ -235,7 +235,7 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XCreateFontCursor")]
|
[DllImport("libX11", EntryPoint = "XCreateFontCursor")]
|
||||||
public extern static IntPtr XCreateFontCursor(IntPtr display, CursorFontShape shape);
|
public extern static IntPtr XCreateFontCursor(IntPtr display, CursorFontShape shape);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XCreatePixmapCursor"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XCreatePixmapCursor")]//, CLSCompliant(false)]
|
||||||
public extern static IntPtr XCreatePixmapCursor(IntPtr display, IntPtr source, IntPtr mask, ref XColor foreground_color, ref XColor background_color, int x_hot, int y_hot);
|
public extern static IntPtr XCreatePixmapCursor(IntPtr display, IntPtr source, IntPtr mask, ref XColor foreground_color, ref XColor background_color, int x_hot, int y_hot);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XCreatePixmapFromBitmapData")]
|
[DllImport("libX11", EntryPoint = "XCreatePixmapFromBitmapData")]
|
||||||
|
@ -301,12 +301,12 @@ namespace OpenTK.Platform.X11
|
||||||
[DllImport("libX11", EntryPoint = "XSetPlaneMask")]
|
[DllImport("libX11", EntryPoint = "XSetPlaneMask")]
|
||||||
public extern static int XSetPlaneMask(IntPtr display, IntPtr gc, IntPtr mask);
|
public extern static int XSetPlaneMask(IntPtr display, IntPtr gc, IntPtr mask);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XSetForeground"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XSetForeground")]//, CLSCompliant(false)]
|
||||||
public extern static int XSetForeground(IntPtr display, IntPtr gc, UIntPtr foreground);
|
public extern static int XSetForeground(IntPtr display, IntPtr gc, UIntPtr foreground);
|
||||||
[DllImport("libX11", EntryPoint = "XSetForeground")]
|
[DllImport("libX11", EntryPoint = "XSetForeground")]
|
||||||
public extern static int XSetForeground(IntPtr display, IntPtr gc, IntPtr foreground);
|
public extern static int XSetForeground(IntPtr display, IntPtr gc, IntPtr foreground);
|
||||||
|
|
||||||
[DllImport("libX11", EntryPoint = "XSetBackground"), CLSCompliant(false)]
|
[DllImport("libX11", EntryPoint = "XSetBackground")]//, CLSCompliant(false)]
|
||||||
public extern static int XSetBackground(IntPtr display, IntPtr gc, UIntPtr background);
|
public extern static int XSetBackground(IntPtr display, IntPtr gc, UIntPtr background);
|
||||||
[DllImport("libX11", EntryPoint = "XSetBackground")]
|
[DllImport("libX11", EntryPoint = "XSetBackground")]
|
||||||
public extern static int XSetBackground(IntPtr display, IntPtr gc, IntPtr background);
|
public extern static int XSetBackground(IntPtr display, IntPtr gc, IntPtr background);
|
||||||
|
|
|
@ -31,9 +31,15 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#region --- Constructors ---
|
#region --- Constructors ---
|
||||||
|
|
||||||
/// <summary>
|
static X11GLContext()
|
||||||
/// Constructs a new X11GLContext object.
|
{
|
||||||
/// </summary>
|
// Set the GetCurrentContext implementation.
|
||||||
|
if (GLContext.GetCurrentContext == null)
|
||||||
|
GLContext.GetCurrentContext = X11GLContext.GetCurrentContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <private />
|
||||||
|
/// <summary>Constructs a new X11GLContext object.</summary>
|
||||||
public X11GLContext() { }
|
public X11GLContext() { }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -85,7 +91,7 @@ namespace OpenTK.Platform.X11
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
|
||||||
visualAttributes.Add((int)mode.Color.Alpha);
|
visualAttributes.Add((int)mode.Color.Alpha);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
|
||||||
visualAttributes.Add((int)mode.Depth);
|
visualAttributes.Add((int)mode.DepthBits);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
||||||
visualAttributes.Add((int)0);
|
visualAttributes.Add((int)0);
|
||||||
}
|
}
|
||||||
|
@ -130,16 +136,24 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region public void CreateContext()
|
||||||
|
|
||||||
public void CreateContext()
|
public void CreateContext()
|
||||||
{
|
{
|
||||||
this.CreateContext(true, null);
|
this.CreateContext(true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public void CreateContext(bool direct)
|
||||||
|
|
||||||
public void CreateContext(bool direct)
|
public void CreateContext(bool direct)
|
||||||
{
|
{
|
||||||
this.CreateContext(direct, null);
|
this.CreateContext(direct, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region public void CreateContext(bool direct, IGLContext shareContext)
|
#region public void CreateContext(bool direct, IGLContext shareContext)
|
||||||
|
|
||||||
public void CreateContext(bool direct, IGLContext shareContext)
|
public void CreateContext(bool direct, IGLContext shareContext)
|
||||||
|
@ -241,6 +255,13 @@ namespace OpenTK.Platform.X11
|
||||||
public bool IsCurrent
|
public bool IsCurrent
|
||||||
{
|
{
|
||||||
get { return Glx.GetCurrentContext() == this.context; }
|
get { return Glx.GetCurrentContext() == this.context; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
Glx.MakeCurrent(windowInfo.Display, windowInfo.Handle, context);
|
||||||
|
else
|
||||||
|
Glx.MakeCurrent(windowInfo.Handle, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -313,18 +334,9 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ContextHandle IGLContextInternal.GetCurrentContext()
|
|
||||||
|
|
||||||
ContextHandle IGLContextInternal.GetCurrentContext()
|
|
||||||
{
|
|
||||||
return (ContextHandle)Glx.GetCurrentContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#region --- Methods ---
|
||||||
|
|
||||||
#region --- Public Methods ---
|
|
||||||
|
|
||||||
void OnDestroy()
|
void OnDestroy()
|
||||||
{
|
{
|
||||||
|
@ -332,6 +344,15 @@ namespace OpenTK.Platform.X11
|
||||||
Destroy(this, EventArgs.Empty);
|
Destroy(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region static ContextHandle GetCurrentContext()
|
||||||
|
|
||||||
|
static ContextHandle GetCurrentContext()
|
||||||
|
{
|
||||||
|
return (ContextHandle)Glx.GetCurrentContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IDisposable Members ---
|
#region --- IDisposable Members ---
|
||||||
|
|
|
@ -392,20 +392,9 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(DisplayMode mode, out IGLContext glContext)
|
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext glContext)
|
||||||
|
|
||||||
/// <summary>
|
public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext glContext)
|
||||||
/// Opens a new render window with the given DisplayMode.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mode">The DisplayMode of the render window.</param>
|
|
||||||
/// <remarks>
|
|
||||||
/// Creates the window visual and colormap. Associates the colormap/visual
|
|
||||||
/// with the window and raises the window on top of the window stack.
|
|
||||||
/// <para>
|
|
||||||
/// Colormap creation is currently disabled.
|
|
||||||
/// </para>
|
|
||||||
/// </remarks>
|
|
||||||
public void CreateWindow(int width, int height, DisplayMode mode, out IGLContext glContext)
|
|
||||||
{
|
{
|
||||||
if (exists)
|
if (exists)
|
||||||
throw new ApplicationException("Render window already exists!");
|
throw new ApplicationException("Render window already exists!");
|
||||||
|
@ -489,6 +478,26 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region public void CreateWindow(int width, int height, DisplayMode mode, out IGLContext glContext)
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens a new render window with the given DisplayMode.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mode">The DisplayMode of the render window.</param>
|
||||||
|
/// <remarks>
|
||||||
|
/// Creates the window visual and colormap. Associates the colormap/visual
|
||||||
|
/// with the window and raises the window on top of the window stack.
|
||||||
|
/// <para>
|
||||||
|
/// Colormap creation is currently disabled.
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public void CreateWindow(int width, int height, DisplayMode mode, out IGLContext glContext)
|
||||||
|
{
|
||||||
|
this.CreateWindow(width, height, new GraphicsFormat(), out glContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region OnCreate
|
#region OnCreate
|
||||||
|
|
||||||
public event CreateEvent Create;
|
public event CreateEvent Create;
|
||||||
|
@ -727,8 +736,8 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
MotifWmHints hints = new MotifWmHints();
|
MotifWmHints hints = new MotifWmHints();
|
||||||
hints.flags = (IntPtr)MotifFlags.Decorations;
|
hints.flags = (IntPtr)MotifFlags.Decorations;
|
||||||
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
|
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints, 5
|
||||||
Marshal.SizeOf(hints) / 4);
|
/*Marshal.SizeOf(hints) / 4*/);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -763,7 +772,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
IntPtr hints = IntPtr.Zero;
|
IntPtr hints = IntPtr.Zero;
|
||||||
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
|
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
|
||||||
Marshal.SizeOf(hints) / 4);
|
/*Marshal.SizeOf(hints) / 4*/ 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,8 +789,8 @@ namespace OpenTK.Platform.X11
|
||||||
if (atom != IntPtr.Zero)
|
if (atom != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
IntPtr hints = Functions.XInternAtom(this.window.Display, "_NET_WM_STATE_FULLSCREEN", true);
|
IntPtr hints = Functions.XInternAtom(this.window.Display, "_NET_WM_STATE_FULLSCREEN", true);
|
||||||
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
|
Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints, 1
|
||||||
Marshal.SizeOf(hints) / 4);
|
/*Marshal.SizeOf(hints) / 4*/);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Licensed under the MIT/X11 license.
|
/* Licensed under the MIT/X11 license.
|
||||||
* Copyright (c) 2006-2008 the OpenTK team.
|
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||||
* This notice may not be removed.
|
* This notice may not be removed from any source distribution.
|
||||||
* See license.txt for licensing detailed licensing details.
|
* See license.txt for licensing detailed licensing details.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -18,8 +18,6 @@ namespace OpenTK.Platform.X11
|
||||||
internal class X11XrandrDisplayDevice : IDisplayDeviceDriver
|
internal class X11XrandrDisplayDevice : IDisplayDeviceDriver
|
||||||
{
|
{
|
||||||
static object display_lock = new object();
|
static object display_lock = new object();
|
||||||
int current_size = -1; // current_size == -1 means it hasn't been changed.
|
|
||||||
int current_refresh;
|
|
||||||
// Store a mapping between resolutions and their respective
|
// Store a mapping between resolutions and their respective
|
||||||
// size_index (needed for XRRSetScreenConfig). The size_index
|
// size_index (needed for XRRSetScreenConfig). The size_index
|
||||||
// is simply the sequence number of the resolution as returned by
|
// is simply the sequence number of the resolution as returned by
|
||||||
|
|
Loading…
Reference in a new issue