This commit is contained in:
the_fiddler 2007-08-20 10:46:37 +00:00
parent 9478d51459
commit 7efeeda3ca
36 changed files with 8392 additions and 8603 deletions

View file

@ -15,8 +15,7 @@ namespace Bind.GL2
{
class Generator : IBind
{
//internal static SpecReader specReader;
//internal static SpecWriter specWriter;
#region --- Fields ---
protected static string glTypemap = "GL2\\gl.tm";
protected static string csTypemap = "csharp.tm";
@ -29,16 +28,25 @@ namespace Bind.GL2
protected static string delegatesFile = "GLDelegates.cs";
protected static string enumsFile = "GLEnums.cs";
protected static string wrappersFile = "GL.cs";
protected static string className = Settings.GLClass;
protected static string className = Settings.GLClass;
protected static string loadAllFuncName = "LoadAll";
protected static string functionPrefix = "gl";
public string FunctionPrefix { get { return functionPrefix; } }
protected string specFolder;
#endregion
#region --- Constructors ---
public Generator(string folder)
{
specFolder = folder;
}
#endregion
#region IBind Members
#region public void Process()
@ -591,7 +599,7 @@ namespace Bind.GL2
sw.WriteLine("{");
// --- Workaround for mono gmcs 1.2.4 issue, where static initalization fails. ---
sw.Indent();
sw.WriteLine("{0}.ReloadFunctions();", className);
sw.WriteLine("{0}.{1}();", className, loadAllFuncName);
sw.Unindent();
// --- End workaround ---
sw.WriteLine("}");
@ -600,31 +608,13 @@ namespace Bind.GL2
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine("internal {0};", d.ToString());
if (d.Extension == "Core")
{
/*sw.WriteLine(
"internal {0}static {1} gl{1} = ({1}){2}.{3}(\"gl{1}\", typeof({1})) ?? new {1}({4}.{1});",
d.Unsafe ? "unsafe " : "",
d.Name,
Settings.GLClass,
"GetDelegateForExtensionMethod",
Settings.ImportsClass);*/
// --- Workaround for mono gmcs 1.2.4 issue, where static initalization fails. ---
sw.WriteLine(
"internal {0}static {1} gl{1} = null;",
d.Unsafe ? "unsafe " : "",
d.Name);
// --- End workaround ---
}
else
{
sw.WriteLine(
"internal {0}static {1} gl{1} = ({1}){2}.{3}(\"gl{1}\", typeof({1}));",
d.Unsafe ? "unsafe " : "",
d.Name,
className,
"GetDelegateForExtensionMethod");
}
// --- Workaround for mono gmcs 1.2.4 issue, where static initalization fails. ---
sw.WriteLine(
"internal {0}static {1} {2}{1} = null;",
d.Unsafe ? "unsafe " : "",
d.Name,
functionPrefix);
// --- End workaround ---s
}
sw.Unindent();
sw.WriteLine("}");
@ -657,8 +647,9 @@ namespace Bind.GL2
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine(
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"gl{1}\", ExactSpelling = true)]",
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"{1}{2}\", ExactSpelling = true)]",
className,
functionPrefix,
d.Name
);
sw.WriteLine("internal extern static {0};", d.DeclarationString());
@ -683,13 +674,13 @@ namespace Bind.GL2
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("static {0}() {1} {2}", className, "{", "}"); // Disable BeforeFieldInit
//sw.WriteLine("static {0}() {1} {2}", className, "{", "}"); // Static init in GLHelper.cs
sw.WriteLine();
foreach (string key in wrappers.Keys)
{
if (Settings.Compatibility == Settings.Legacy.None && key != "Core")
{
if (key != "3DFX")
if (!Char.IsDigit(key[0]))
{
sw.WriteLine("public static class {0}", key);
}

View file

@ -14,5 +14,7 @@ namespace Bind
{
//ISpecReader SpecReader { get; }
void Process();
string FunctionPrefix { get; }
}
}

View file

@ -126,6 +126,14 @@ namespace Bind
break;
case GeneratorMode.Wgl:
if (Settings.OutputPath == Settings.DefaultOutputPath)
{
Settings.OutputPath = Settings.DefaultWglOutputPath;
}
if (Settings.OutputNamespace == Settings.DefaultOutputNamespace)
{
Settings.OutputNamespace = "OpenTK.Platform.Windows";
}
Generator = new Bind.Wgl.Generator(Settings.InputPath);
break;

View file

@ -15,6 +15,11 @@ namespace Bind
public static string InputPath = "..\\..\\..\\Source\\Bind\\Specifications";
public static string OutputPath = "..\\..\\..\\Source\\OpenTK\\OpenGL\\Bindings";
public static string OutputNamespace = "OpenTK.OpenGL";
public readonly static string DefaultInputPath = "..\\..\\..\\Source\\Bind\\Specifications";
public readonly static string DefaultOutputPath = "..\\..\\..\\Source\\OpenTK\\OpenGL\\Bindings";
public readonly static string DefaultOutputNamespace = "OpenTK.OpenGL";
public static string GLClass = "GL";
private static string enumsClass = "Enums";
public static string GLEnumsClass
@ -30,6 +35,8 @@ namespace Bind
public static string GluClass = "Glu";
public static Legacy Compatibility = Legacy.None;
public readonly static string DefaultWglOutputPath = "..\\..\\..\\Source\\OpenTK\\Platform\\Windows\\Bindings";
/// <summary>
/// The name of the C# enum which holds every single OpenGL enum (for compatibility purposes).
/// </summary>

View file

@ -199,7 +199,9 @@ namespace Bind.Structures
set
{
if (!String.IsNullOrEmpty(value))
{
_name = value.Trim();
}
}
}
@ -267,7 +269,8 @@ namespace Bind.Structures
StringBuilder sb = new StringBuilder();
sb.Append(Settings.DelegatesClass);
sb.Append(".gl");
sb.Append(".");
sb.Append(Bind.MainClass.Generator.FunctionPrefix);
sb.Append(Name);
sb.Append(Parameters.CallString());

View file

@ -13,6 +13,8 @@ namespace Bind.Wgl
{
class Generator : Bind.GL2.Generator
{
#region --- Constructors ---
public Generator(string path)
: base(path)
{
@ -29,8 +31,12 @@ namespace Bind.Wgl
wrappersFile = "Wgl.cs";
className = "Wgl";
functionPrefix = "wgl";
}
#endregion
public override void Process()
{
Bind.Structures.Type.Initialize(glTypemap, csTypemap);

View file

@ -42,10 +42,11 @@ namespace Examples
}
catch (Exception e)
{
MessageBox.Show("Could not access debug.log");
MessageBox.Show("Could not access debug.log", e.ToString());
}
Debug.Listeners.Add(new TextWriterTraceListener("debug.log"));
Debug.Listeners.Add(new ConsoleTraceListener());
try
{

View file

@ -24,35 +24,31 @@ namespace Examples.Tests
public void Launch()
{
//using (S02_RawInput_Logger ex = new S02_RawInput_Logger())
try
{
try
{
//ex.Run();
Run();
}
catch (Exception expt)
{
System.Diagnostics.Debug.WriteLine(
String.Format(
"Exception: {3}{0}Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace,
expt.Message
)
);
/*MessageBox.Show(
String.Format(
"Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace
),
Run();
}
catch (Exception expt)
{
System.Diagnostics.Debug.WriteLine(
String.Format(
"Exception: {3}{0}Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace,
expt.Message
);*/
throw;
}
)
);
/*MessageBox.Show(
String.Format(
"Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace
),
expt.Message
);*/
throw;
}
Debug.Flush();
Debug.Close();

View file

@ -134,7 +134,7 @@ namespace Examples.Tutorial
private void DrawCube()
{
GL.Begin(GL.Enums.BeginMode.QUADS);
GL.Begin(GL.Enums.BeginMode.QUADS);
GL.Color3(1.0f, 0.0f, 0.0f);
GL.Vertex3(-1.0f, -1.0f, -1.0f);
@ -164,7 +164,7 @@ namespace Examples.Tutorial
GL.Vertex3(-1.0f, 1.0f, -1.0f);
GL.Vertex3(-1.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, -1.0f);
GL.Vertex3(1.0f, 1.0f, -1.0f);
GL.Color3(0.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, -1.0f, -1.0f);

View file

@ -84,7 +84,7 @@ namespace Examples.Tutorial
{
base.OnLoad(e);
if (!GL.IsExtensionSupported("VERSION_1_4"))
if (!GL.SupportsExtension("VERSION_1_4"))
{
System.Windows.Forms.MessageBox.Show("You need at least OpenGL 1.4 to run this example. Aborting.", "VBOs not supported",
System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);

View file

@ -101,7 +101,7 @@ namespace Examples.Tutorial
base.OnLoad(e);
// Check for necessary capabilities:
if (!GL.IsExtensionSupported("VERSION_2_0"))
if (!GL.SupportsExtension("VERSION_2_0"))
{
MessageBox.Show("You need at least OpenGL 2.0 to run this example. Aborting.", "GLSL not supported",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

View file

@ -46,25 +46,59 @@ namespace OpenTK
public GLControl(DisplayMode mode)
{
InitializeComponent();
/*
System.Diagnostics.Debug.Listeners.Clear();
System.Diagnostics.Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
System.Diagnostics.Debug.AutoFlush = true;
System.Diagnostics.Trace.Listeners.Clear();
System.Diagnostics.Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
System.Diagnostics.Trace.AutoFlush = true;
Trace.AutoFlush = true;
*/
this.Fullscreen = mode.Fullscreen;
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
//Debug.Print("Creating GLControl.");
//this.CreateControl();
}
#endregion
/*
CreateParams @params;
protected override CreateParams CreateParams
{
get
{
if (@params == null)
{
@params = base.CreateParams;
//@params.ClassStyle = (int)
// (OpenTK.Platform.Windows.API.WindowClassStyle.OwnDC |
// OpenTK.Platform.Windows.API.WindowClassStyle.HRedraw |
// OpenTK.Platform.Windows.API.WindowClassStyle.VRedraw);
//@params.Style = (int)
// (OpenTK.Platform.Windows.API.WindowStyle.ClipChildren);
// OpenTK.Platform.Windows.API.WindowStyle.ClipSiblings);
//@params.ExStyle = OpenTK.Platform.Windows.API.ExtendedWindowStyle.
}
return @params;
}
}
*/
#region --- Public Methods ---
/// <summary>
/// Forces the creation of the opengl rendering context.
/// </summary>
public void CreateContext()
{
Debug.Print("Creating opengl context");
Debug.Indent();
if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
Environment.OSVersion.Platform == PlatformID.Win32Windows)
{
glControl = new OpenTK.Platform.Windows.WinGLControl(this, new DisplayMode(Width, Height));
}
else if (Environment.OSVersion.Platform == PlatformID.Unix ||
Environment.OSVersion.Platform == (PlatformID)128)
// some older versions of Mono reported 128.
Environment.OSVersion.Platform == (PlatformID)128) // some older versions of Mono reported 128.
{
glControl = new OpenTK.Platform.X11.X11GLControl(this, new DisplayMode(Width, Height));
glControl = new OpenTK.Platform.X11.X11GLControl(this, new DisplayMode(Width, Height));
}
else
{
@ -73,27 +107,11 @@ namespace OpenTK
);
}
glControl.Context.MakeCurrent();
/*
Context.MakeCurrent();
OpenTK.OpenGL.GL.LoadAll();
//GL.ReloadFunctions();
if (width > 0)
this.Width = width;
if (height > 0)
this.Height = height;
*/
this.Fullscreen = mode.Fullscreen;
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
Debug.Unindent();
}
#endregion
#region --- Public Methods ---
/// <summary>
/// Swaps the front and back buffers, and presents the rendered scene to the screen.
/// </summary>
@ -154,7 +172,13 @@ namespace OpenTK
/// </summary>
public bool IsIdle
{
get { return glControl.IsIdle; }
get
{
if (glControl == null)
this.CreateContext();
return glControl.IsIdle;
}
}
#endregion
@ -166,7 +190,13 @@ namespace OpenTK
/// </summary>
public IGLContext Context
{
get { return glControl.Context; }
get
{
if (glControl == null)
this.CreateContext();
return glControl.Context;
}
}
#endregion

View file

@ -223,6 +223,7 @@ namespace OpenTK
/// <param name="e"></param>
public virtual void OnCreate(EventArgs e)
{
Debug.WriteLine("Firing GameWindow.Create event");
if (this.Create != null)
{
this.Create(this, e);
@ -260,6 +261,7 @@ namespace OpenTK
/// <param name="e"></param>
public virtual void OnDestroy(EventArgs e)
{
Debug.WriteLine("Firing GameWindow.Destroy event");
if (this.Destroy != null)
{
this.Destroy(this, e);

View file

@ -5,7 +5,6 @@ namespace OpenTK.OpenGL
public static partial class GL
{
static GL() { }
[System.CLSCompliant(false)]
public static

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,48 +0,0 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*
* Date: 12/8/2007
* Time: 6:43 μμ
*/
#endregion
using System;
using System.Runtime.InteropServices;
namespace OpenTK.OpenGL
{
/// <summary>
///
/// </summary>
public partial class Wgl
{
internal const string Library = "OPENGL32.DLL";
internal static IntPtr LoadAddress(string function)
{
return Wgl.GetProcAddress(function);
}
public static Delegate LoadExtension(string function, Type signature)
{
IntPtr address = LoadAddress(function);
if (address == IntPtr.Zero ||
address == new IntPtr(1) || // Workaround for buggy nvidia drivers which return
address == new IntPtr(2)) // 1 or 2 instead of IntPtr.Zero for some extensions.
{
return null;
}
else
{
return Marshal.GetDelegateForFunctionPointer(address, signature);
}
}
public static Delegate Load(string function, Type signature)
{
return null;
}
}
}

View file

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Reflection;
using OpenTK.Platform;
#endregion
@ -66,286 +67,69 @@ namespace OpenTK.OpenGL
/// </remarks>
public static partial class GL
{
#region internal string Library
static GL()
{
assembly = Assembly.GetExecutingAssembly();//Assembly.Load("OpenTK.OpenGL");
glClass = assembly.GetType("OpenTK.OpenGL.GL");
delegatesClass = glClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic);
importsClass = glClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic);
}
internal const string Library = "opengl32.dll";
#region --- Fields ---
internal const string Library = "OPENGL32.DLL";
#endregion
#region private enum Platform
/// <summary>
/// Enumerates the platforms OpenTK can run on.
/// </summary>
private enum Platform
{
Unknown,
Windows,
X11,
X11_ARB,
OSX
};
#endregion private enum Platform
private static Platform platform = Platform.Unknown;
private static System.Collections.Generic.Dictionary<string, bool> AvailableExtensions = new Dictionary<string, bool>();
private static bool rebuildExtensionList;
private static Assembly assembly;
private static Type glClass;
private static Type delegatesClass;
private static Type importsClass;
#region internal static extern IntPtr glxGetProcAddressARB(string s);
// also linux, for our ARB-y friends
[DllImport(Library, EntryPoint = "glXGetProcAddressARB")]
internal static extern IntPtr glxGetProcAddressARB(string s);
#endregion
#region internal static IntPtr aglGetProcAddress(string s)
// osx gets complicated
[DllImport("libdl.dylib", EntryPoint = "NSIsSymbolNameDefined")]
internal static extern bool NSIsSymbolNameDefined(string s);
[DllImport("libdl.dylib", EntryPoint = "NSLookupAndBindSymbol")]
internal static extern IntPtr NSLookupAndBindSymbol(string s);
[DllImport("libdl.dylib", EntryPoint = "NSAddressOfSymbol")]
internal static extern IntPtr NSAddressOfSymbol(IntPtr symbol);
#region public static bool SupportsExtension(string name)
internal static IntPtr aglGetProcAddress(string s)
{
string fname = "_" + s;
if (!NSIsSymbolNameDefined(fname))
return IntPtr.Zero;
IntPtr symbol = NSLookupAndBindSymbol(fname);
if (symbol != IntPtr.Zero)
symbol = NSAddressOfSymbol(symbol);
return symbol;
}
#endregion
#region public static IntPtr GetFunctionPointerForExtensionMethod(string name)
/// <summary>
/// Retrieves the entry point for a dynamically exported OpenGL function.
/// </summary>
/// <param name="name">The function string for the OpenGL function (eg. "glNewList")</param>
/// <returns>
/// An IntPtr contaning the address for the entry point, or IntPtr.Zero if the specified
/// OpenGL function is not dynamically exported.
/// </returns>
/// <remarks>
/// <para>
/// The Marshal.GetDelegateForFunctionPointer method can be used to turn the return value
/// into a call-able delegate.
/// </para>
/// <para>
/// This function is cross-platform. It determines the underlying platform and uses the
/// correct wgl, glx or agl GetAddress function to retrieve the function pointer.
/// </para>
/// <see cref="Marshal.GetDelegateForFunctionPointer"/>
/// <seealso cref="Gl.GetDelegateForExtensionMethod"/>
/// </remarks>
public static IntPtr GetFunctionPointerForExtensionMethod(string name)
{
IntPtr result = IntPtr.Zero;
switch (platform)
{
case Platform.Unknown:
// WGL?
try
{
result = OpenTK.Platform.Windows.Wgl.GetProcAddress(name);
platform = Platform.Windows;
return result;
}
catch (Exception)
{ }
// AGL? (before X11, since GLX might exist on OSX)
try
{
result = aglGetProcAddress(name);
platform = Platform.OSX;
return result;
}
catch (Exception)
{ }
// X11?
try
{
result = OpenTK.Platform.X11.Glx.GetProcAddress(name);
platform = Platform.X11;
return result;
}
catch (Exception)
{ }
// X11 ARB?
try
{
result = glxGetProcAddressARB(name);
platform = Platform.X11_ARB;
return result;
}
catch (Exception)
{ }
// Ack!
throw new NotSupportedException(
@"Could not find out how to retrive function pointers for this platform.
Did you remember to copy OpenTK.OpenGL.dll.config to your binary's folder?
");
case Platform.Windows:
return OpenTK.Platform.Windows.Wgl.GetProcAddress(name);
case Platform.OSX:
return aglGetProcAddress(name);
case Platform.X11:
return OpenTK.Platform.X11.Glx.GetProcAddress(name);
case Platform.X11_ARB:
return glxGetProcAddressARB(name);
}
throw new NotSupportedException("Internal error - please report.");
}
#endregion public static IntPtr GetFunctionPointerForExtensionMethod(string s)
#region public static Delegate GetDelegateForExtensionMethod(string name, Type signature)
/// <summary>
/// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
/// </summary>
/// <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
/// <param name="signature">The signature of the OpenGL function.</param>
/// <returns>
/// A System.Delegate that can be used to call this OpenGL function or null
/// if the function is not available in the current OpenGL context.
/// </returns>
public static Delegate GetDelegateForExtensionMethod(string name, Type signature)
{
IntPtr address = GetFunctionPointerForExtensionMethod(name);
if (address == IntPtr.Zero ||
address == new IntPtr(1) || // Workaround for buggy nvidia drivers which return
address == new IntPtr(2)) // 1 or 2 instead of IntPtr.Zero for some extensions.
{
return null;
}
else
{
return Marshal.GetDelegateForFunctionPointer(address, signature);
}
}
#endregion public static Delegate GetAddress(string name, Type signature)
#region public static Delegate GetDelegateForMethod(string name, Type signature)
/// <summary>
/// Creates a System.Delegate that can be used to call an OpenGL function, core or extension.
/// </summary>
/// <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
/// <param name="signature">The signature of the OpenGL function.</param>
/// <returns>
/// A System.Delegate that can be used to call this OpenGL function, or null if the specified
/// function name did not correspond to an OpenGL function.
/// </returns>
public static Delegate GetDelegateForMethod(string name, Type signature)
{
Delegate d;
if (Assembly.GetExecutingAssembly()
.GetType("OpenTK.OpenGL.Imports")
.GetMethod(name.Substring(2), BindingFlags.NonPublic | BindingFlags.Static) != null)
{
d = GetDelegateForExtensionMethod(name, signature) ??
Delegate.CreateDelegate(signature, typeof(Imports), name.Substring(2));
}
else
{
d = GetDelegateForExtensionMethod(name, signature);
}
return d;
}
#endregion
#region public static bool IsExtensionSupported(string name)
/// <summary>
/// Determines whether the specified OpenGL extension category is available in
/// the current OpenGL context. Equivalent to IsExtensionSupported(name, true)
/// </summary>
/// <param name="name">The string for the OpenGL extension category (eg. "GL_ARB_multitexture")</param>
/// <returns>True if the specified extension is available, false otherwise.</returns>
public static bool IsExtensionSupported(string name)
public static bool SupportsExtension(string name)
{
return IsExtensionSupported(name, true);
}
#endregion
#region public static bool IsExtensionSupported(string name, bool useCache)
/// <summary>
/// Determines whether the specified OpenGL extension category is available in
/// the current OpenGL context.
/// </summary>
/// <param name="name">The string for the OpenGL extension category (eg. "GL_ARB_multitexture")</param>
/// <param name="useCache">If true, the results will be cached to speed up future results.</param>
/// <returns>True if the specified extension is available, false otherwise.</returns>
public static bool IsExtensionSupported(string name, bool useCache)
{
// Use cached results
if (useCache)
if (rebuildExtensionList)
{
// Build cache if it is not available. We assume that all drivers
// will support at least one extension to opengl 1.0 (for example
// opengl 1.1). This should hold true even for software contexts
// (microsoft's soft implementation is gl 1.1 compatible), at least
// for any system capable of running .Net/Mono.
if (AvailableExtensions.Count == 0)
{
ParseAvailableExtensions();
}
BuildExtensionList();
}
// Search the cache for the string. Note that the cache substitutes
// strings "1.0" to "2.1" with "GL_VERSION_1_0" to "GL_VERSION_2_1"
if (AvailableExtensions.ContainsKey(name))
return AvailableExtensions[name];
// Search the cache for the string. Note that the cache substitutes
// strings "1.0" to "2.1" with "GL_VERSION_1_0" to "GL_VERSION_2_1"
if (AvailableExtensions.ContainsKey(name))
{
return AvailableExtensions[name];
}
return false;
}
// Do not use cached results
string extension_string = GL.GetString(GL.Enums.StringName.EXTENSIONS);
if (String.IsNullOrEmpty(extension_string))
return false; // no extensions are available
// Check if the user searches for GL_VERSION_X_X and search glGetString(GL_VERSION) instead.
if (name.Contains("GL_VERSION_"))
{
return GL.GetString(OpenTK.OpenGL.GL.Enums.StringName.VERSION).Trim().StartsWith(name.Replace("GL_VERSION_", String.Empty).Replace('_', '.'));
}
// Search for the string given.
string[] extensions = extension_string.Split(' ');
foreach (string s in extensions)
{
if (name == s)
return true;
}
return false;
}
#endregion
#region private static void ParseAvailableExtensions()
#region private static void BuildExtensionList()
/// <summary>
/// Builds a cache of the supported extensions to speed up searches.
/// </summary>
private static void ParseAvailableExtensions()
private static void BuildExtensionList()
{
// Assumes there is a current context.
// Assumes there is an opengl context current.
string version_string = GL.GetString(OpenTK.OpenGL.GL.Enums.StringName.VERSION);
if (String.IsNullOrEmpty(version_string))
return; // this shoudn't happen
{
throw new ApplicationException("Failed to build extension list. Is there an opengl context current?");
}
string version = version_string.Trim(' ');
@ -398,43 +182,73 @@ Did you remember to copy OpenTK.OpenGL.dll.config to your binary's folder?
{
AvailableExtensions.Add(ext, true);
}
rebuildExtensionList = false;
}
#endregion
#region public static void ReloadFunctions()
#region public static Delegate GetDelegate(string name, Type signature)
/// <summary>
/// Reloads all OpenGL functions (core and extensions).
/// Creates a System.Delegate that can be used to call an OpenGL function, core or extension.
/// </summary>
/// <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
/// <param name="signature">The signature of the OpenGL function.</param>
/// <returns>
/// A System.Delegate that can be used to call this OpenGL function, or null if the specified
/// function name did not correspond to an OpenGL function.
/// </returns>
public static Delegate GetDelegate(string name, Type signature)
{
Delegate d;
if (importsClass.GetMethod(name.Substring(2), BindingFlags.NonPublic | BindingFlags.Static) != null)
{
d = Utilities.GetExtensionDelegate(name, signature) ??
Delegate.CreateDelegate(signature, typeof(Imports), name.Substring(2));
}
else
{
d = Utilities.GetExtensionDelegate(name, signature);
}
return d;
}
#endregion
#region public static void LoadAll()
/// <summary>
/// Loads all OpenGL functions (core and extensions).
/// </summary>
/// <remarks>
/// <para>
/// Call this function to reload all OpenGL entry points. This should be done
/// whenever you change the pixelformat/visual, or in the case you cannot (or do not want)
/// to use the automatic initialisation.
/// This function will be automatically called the first time you use any opengl function. There is
/// </para>
/// <para>
/// Calling this function before the automatic initialisation has taken place will result
/// in the Gl class being initialised twice. This is harmless, but given the automatic
/// initialisation should be preferred.
/// Call this function manually whenever you need to update OpenGL entry points.
/// This need may arise if you change the pixelformat/visual, or in case you cannot
/// (or do not want) to use the automatic initialisation of the GL class.
/// </para>
/// </remarks>
public static void ReloadFunctions()
public static void LoadAll()
{
Assembly asm = Assembly.GetExecutingAssembly();//Assembly.Load("OpenTK.OpenGL");
Type delegates_class = asm.GetType("OpenTK.OpenGL.Delegates");
//Type imports_class = asm.GetType("OpenTK.OpenGL.Imports");
FieldInfo[] v = delegates_class.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
FieldInfo[] v = delegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
foreach (FieldInfo f in v)
{
f.SetValue(null, GetDelegateForMethod(f.Name, f.FieldType));
f.SetValue(null, GetDelegate(f.Name, f.FieldType));
}
//ParseAvailableExtensions();
AvailableExtensions.Clear();
rebuildExtensionList = true;
}
#endregion
#region public static bool ReloadFunction(string name)
#region public static bool Load(string function)
/// <summary>
/// Tries to reload the given OpenGL function (core or extension).
/// </summary>
@ -451,28 +265,24 @@ Did you remember to copy OpenTK.OpenGL.dll.config to your binary's folder?
/// you will need, or use ReloadFunctions() to load all available entry points.
/// </para>
/// <para>
/// This function will return true if the given OpenGL function exists, false otherwise.
/// A return value of "true" does not mean that any specific OpenGL function is supported;
/// rather it means that the string passed to this function denotes a known OpenGL function.
/// This function returns true if the given OpenGL function is supported, false otherwise.
/// </para>
/// <para>
/// To query supported extensions use the IsExtensionSupported() function instead.
/// To query for supported extensions use the IsExtensionSupported() function instead.
/// </para>
/// </remarks>
public static bool ReloadFunction(string name)
public static bool Load(string function)
{
Assembly asm = Assembly.Load("OpenTK.OpenGL");
Type delegates_class = asm.GetType("OpenTK.OpenGL.Delegates");
//Type imports_class = asm.GetType("OpenTK.OpenGL.Imports");
FieldInfo f = delegates_class.GetField(name);
FieldInfo f = delegatesClass.GetField(function);
if (f == null)
return false;
f.SetValue(null, GetDelegateForMethod(f.Name, f.FieldType));
f.SetValue(null, GetDelegate(f.Name, f.FieldType));
rebuildExtensionList = true;
return true;
return f.GetValue(null) != null;
}
#endregion
}
}

View file

@ -91,4 +91,4 @@ namespace OpenTK.Platform
return string.Format("{0} ({1})", BitsPerPixel, (IsIndexed ? " indexed" : Red.ToString() + Green.ToString() + Blue.ToString() + Alpha.ToString()));
}
}
}
}

View file

@ -201,7 +201,7 @@ namespace OpenTK.Platform
CultureInfo.CurrentCulture,
"{0}x{1}, rgba: {2}, depth: {3}, refresh {4}Hz",
Width, Height,
Color.ToString(),
Color.ToString(),
DepthBits,
RefreshRate
);

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace OpenTK.Platform.OSX
{
public static partial class Functions
{
internal const string Library = "libdl.dylib";
#region OSX GetProcAddress
[DllImport(Library, EntryPoint = "NSIsSymbolNameDefined")]
internal static extern bool NSIsSymbolNameDefined(string s);
[DllImport(Library, EntryPoint = "NSLookupAndBindSymbol")]
internal static extern IntPtr NSLookupAndBindSymbol(string s);
[DllImport(Library, EntryPoint = "NSAddressOfSymbol")]
internal static extern IntPtr NSAddressOfSymbol(IntPtr symbol);
#endregion
}
}

View file

@ -4,10 +4,15 @@
*/
#endregion
#region --- Using Directives ---
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
#endregion
namespace OpenTK.Platform
{
@ -16,9 +21,150 @@ namespace OpenTK.Platform
/// </summary>
public static class Utilities
{
#region --- LoadAddress ---
internal interface ILoadAddress
{
IntPtr LoadAddress(string function);
}
internal class LoadAddressWindows : ILoadAddress
{
public IntPtr LoadAddress(string function)
{
return OpenTK.Platform.Windows.Wgl.Imports.GetProcAddress(function);
}
}
internal class LoadAddressX11 : ILoadAddress
{
public IntPtr LoadAddress(string function)
{
return X11.Glx.GetProcAddress(function);
}
}
internal class LoadAddressOSX : ILoadAddress
{
public IntPtr LoadAddress(string function)
{
string fname = "_" + function;
if (!OSX.Functions.NSIsSymbolNameDefined(fname))
return IntPtr.Zero;
IntPtr symbol = OSX.Functions.NSLookupAndBindSymbol(fname);
if (symbol != IntPtr.Zero)
symbol = OSX.Functions.NSAddressOfSymbol(symbol);
return symbol;
}
}
#endregion
#region --- Fields ---
/// <summary>
/// Enumerates the platforms OpenTK can run on.
/// </summary>
private enum Platform
{
Unknown,
Windows,
X11,
X11_ARB,
OSX
};
private static ILoadAddress loadAddress;
#endregion
private static Platform platform = Platform.Unknown;
public static IWindowInfo GetWindowInfo(Form form)
{
throw new NotImplementedException();
}
#region public static IntPtr GetAddress(string function)
/// <summary>
/// Retrieves the entry point for a dynamically exported OpenGL function.
/// </summary>
/// <param name="name">The function string for the OpenGL function (eg. "glNewList")</param>
/// <returns>
/// An IntPtr contaning the address for the entry point, or IntPtr.Zero if the specified
/// OpenGL function is not dynamically exported.
/// </returns>
/// <remarks>
/// <para>
/// The Marshal.GetDelegateForFunctionPointer method can be used to turn the return value
/// into a call-able delegate.
/// </para>
/// <para>
/// This function is cross-platform. It determines the underlying platform and uses the
/// correct wgl, glx or agl GetAddress function to retrieve the function pointer.
/// </para>
/// <see cref="Marshal.GetDelegateForFunctionPointer"/>
/// <seealso cref="Gl.GetDelegateForExtensionMethod"/>
/// </remarks>
public static IntPtr GetAddress(string function)
{
if (platform == Platform.Unknown)
{
if (System.Environment.OSVersion.Platform == PlatformID.Win32NT ||
System.Environment.OSVersion.Platform == PlatformID.Win32S ||
System.Environment.OSVersion.Platform == PlatformID.Win32Windows ||
System.Environment.OSVersion.Platform == PlatformID.WinCE)
{
platform = Platform.Windows;
loadAddress = new LoadAddressWindows();
}
else if (System.Environment.OSVersion.Platform == PlatformID.Unix)
{
platform = Platform.X11;
loadAddress = new LoadAddressX11();
}
else
{
throw new PlatformNotSupportedException(
"Extension loading is only supported under X11 and Windows. We are sorry for the inconvience.");
}
}
return loadAddress.LoadAddress(function);
}
#endregion
#region private static Delegate GetExtensionDelegate(string name, Type signature)
/// <summary>
/// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
/// </summary>
/// <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
/// <param name="signature">The signature of the OpenGL function.</param>
/// <returns>
/// A System.Delegate that can be used to call this OpenGL function or null
/// if the function is not available in the current OpenGL context.
/// </returns>
internal static Delegate GetExtensionDelegate(string name, Type signature)
{
IntPtr address = GetAddress(name);
if (address == IntPtr.Zero ||
address == new IntPtr(1) || // Workaround for buggy nvidia drivers which return
address == new IntPtr(2)) // 1 or 2 instead of IntPtr.Zero for some extensions.
{
return null;
}
else
{
return Marshal.GetDelegateForFunctionPointer(address, signature);
}
}
#endregion
}
}

View file

@ -1,4 +1,4 @@
namespace OpenTK.OpenGL
namespace OpenTK.Platform.Windows
{
using System;
using System.Runtime.InteropServices;
@ -11,70 +11,70 @@ namespace OpenTK.OpenGL
static Imports() { }
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCreateContext", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglCreateContext", ExactSpelling = true)]
internal extern static IntPtr CreateContext(IntPtr hDc);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glDeleteContext", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglDeleteContext", ExactSpelling = true)]
internal extern static Boolean DeleteContext(IntPtr oldContext);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetCurrentContext", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetCurrentContext", ExactSpelling = true)]
internal extern static IntPtr GetCurrentContext();
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glMakeCurrent", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglMakeCurrent", ExactSpelling = true)]
internal extern static Boolean MakeCurrent(IntPtr hDc, IntPtr newContext);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCopyContext", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglCopyContext", ExactSpelling = true)]
internal extern static Boolean CopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glChoosePixelFormat", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglChoosePixelFormat", ExactSpelling = true)]
internal extern static int ChoosePixelFormat(IntPtr hDc, OpenTK.Platform.Windows.API.PixelFormatDescriptor pPfd);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glDescribePixelFormat", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglDescribePixelFormat", ExactSpelling = true)]
internal extern static int DescribePixelFormat(IntPtr hdc, int ipfd, UInt32 cjpfd, OpenTK.Platform.Windows.API.PixelFormatDescriptor ppfd);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetCurrentDC", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetCurrentDC", ExactSpelling = true)]
internal extern static IntPtr GetCurrentDC();
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetDefaultProcAddress", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetDefaultProcAddress", ExactSpelling = true)]
internal extern static IntPtr GetDefaultProcAddress(String lpszProc);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetProcAddress", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetProcAddress", ExactSpelling = true)]
internal extern static IntPtr GetProcAddress(String lpszProc);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetPixelFormat", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetPixelFormat", ExactSpelling = true)]
internal extern static int GetPixelFormat(IntPtr hdc);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSetPixelFormat", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglSetPixelFormat", ExactSpelling = true)]
internal extern static Boolean SetPixelFormat(IntPtr hdc, int ipfd, OpenTK.Platform.Windows.API.PixelFormatDescriptor ppfd);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSwapBuffers", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglSwapBuffers", ExactSpelling = true)]
internal extern static Boolean SwapBuffers(IntPtr hdc);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glShareLists", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglShareLists", ExactSpelling = true)]
internal extern static Boolean ShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCreateLayerContext", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglCreateLayerContext", ExactSpelling = true)]
internal extern static IntPtr CreateLayerContext(IntPtr hDc, int level);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glDescribeLayerPlane", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglDescribeLayerPlane", ExactSpelling = true)]
internal extern static Boolean DescribeLayerPlane(IntPtr hDc, int pixelFormat, int layerPlane, UInt32 nBytes, OpenTK.Platform.Windows.API.LayerPlaneDescriptor plpd);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSetLayerPaletteEntries", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglSetLayerPaletteEntries", ExactSpelling = true)]
internal extern static int SetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetLayerPaletteEntries", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglGetLayerPaletteEntries", ExactSpelling = true)]
internal extern static int GetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glRealizeLayerPalette", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglRealizeLayerPalette", ExactSpelling = true)]
internal extern static Boolean RealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSwapLayerBuffers", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglSwapLayerBuffers", ExactSpelling = true)]
internal extern static Boolean SwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glUseFontBitmapsA", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglUseFontBitmapsA", ExactSpelling = true)]
internal extern static Boolean UseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glUseFontBitmapsW", ExactSpelling = true)]
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "wglUseFontBitmapsW", ExactSpelling = true)]
internal extern static Boolean UseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
}
}

View file

@ -1,4 +1,4 @@
namespace OpenTK.OpenGL
namespace OpenTK.Platform.Windows
{
using System;
using System.Runtime.InteropServices;
@ -10,294 +10,294 @@ namespace OpenTK.OpenGL
{
static Delegates()
{
Wgl.ReloadFunctions();
Wgl.LoadAll();
}
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr CreateContext(IntPtr hDc);
internal static CreateContext glCreateContext = null;
internal static CreateContext wglCreateContext = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DeleteContext(IntPtr oldContext);
internal static DeleteContext glDeleteContext = null;
internal static DeleteContext wglDeleteContext = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetCurrentContext();
internal static GetCurrentContext glGetCurrentContext = null;
internal static GetCurrentContext wglGetCurrentContext = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean MakeCurrent(IntPtr hDc, IntPtr newContext);
internal static MakeCurrent glMakeCurrent = null;
internal static MakeCurrent wglMakeCurrent = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean CopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask);
internal static CopyContext glCopyContext = null;
internal static CopyContext wglCopyContext = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int ChoosePixelFormat(IntPtr hDc, OpenTK.Platform.Windows.API.PixelFormatDescriptor pPfd);
internal static ChoosePixelFormat glChoosePixelFormat = null;
internal static ChoosePixelFormat wglChoosePixelFormat = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int DescribePixelFormat(IntPtr hdc, int ipfd, UInt32 cjpfd, OpenTK.Platform.Windows.API.PixelFormatDescriptor ppfd);
internal static DescribePixelFormat glDescribePixelFormat = null;
internal static DescribePixelFormat wglDescribePixelFormat = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetCurrentDC();
internal static GetCurrentDC glGetCurrentDC = null;
internal static GetCurrentDC wglGetCurrentDC = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetDefaultProcAddress(String lpszProc);
internal static GetDefaultProcAddress glGetDefaultProcAddress = null;
internal static GetDefaultProcAddress wglGetDefaultProcAddress = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetProcAddress(String lpszProc);
internal static GetProcAddress glGetProcAddress = null;
internal static GetProcAddress wglGetProcAddress = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int GetPixelFormat(IntPtr hdc);
internal static GetPixelFormat glGetPixelFormat = null;
internal static GetPixelFormat wglGetPixelFormat = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean SetPixelFormat(IntPtr hdc, int ipfd, OpenTK.Platform.Windows.API.PixelFormatDescriptor ppfd);
internal static SetPixelFormat glSetPixelFormat = null;
internal static SetPixelFormat wglSetPixelFormat = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean SwapBuffers(IntPtr hdc);
internal static SwapBuffers glSwapBuffers = null;
internal static SwapBuffers wglSwapBuffers = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean ShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);
internal static ShareLists glShareLists = null;
internal static ShareLists wglShareLists = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr CreateLayerContext(IntPtr hDc, int level);
internal static CreateLayerContext glCreateLayerContext = null;
internal static CreateLayerContext wglCreateLayerContext = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DescribeLayerPlane(IntPtr hDc, int pixelFormat, int layerPlane, UInt32 nBytes, OpenTK.Platform.Windows.API.LayerPlaneDescriptor plpd);
internal static DescribeLayerPlane glDescribeLayerPlane = null;
internal static DescribeLayerPlane wglDescribeLayerPlane = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int SetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
internal static SetLayerPaletteEntries glSetLayerPaletteEntries = null;
internal static SetLayerPaletteEntries wglSetLayerPaletteEntries = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int GetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
internal static GetLayerPaletteEntries glGetLayerPaletteEntries = null;
internal static GetLayerPaletteEntries wglGetLayerPaletteEntries = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean RealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);
internal static RealizeLayerPalette glRealizeLayerPalette = null;
internal static RealizeLayerPalette wglRealizeLayerPalette = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean SwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);
internal static SwapLayerBuffers glSwapLayerBuffers = null;
internal static SwapLayerBuffers wglSwapLayerBuffers = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean UseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
internal static UseFontBitmapsA glUseFontBitmapsA = null;
internal static UseFontBitmapsA wglUseFontBitmapsA = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean UseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
internal static UseFontBitmapsW glUseFontBitmapsW = null;
internal static UseFontBitmapsW wglUseFontBitmapsW = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr CreateBufferRegionARB(IntPtr hDC, int iLayerPlane, UInt32 uType);
internal static CreateBufferRegionARB glCreateBufferRegionARB = (CreateBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glCreateBufferRegionARB", typeof(CreateBufferRegionARB));
internal static CreateBufferRegionARB wglCreateBufferRegionARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void DeleteBufferRegionARB(IntPtr hRegion);
internal static DeleteBufferRegionARB glDeleteBufferRegionARB = (DeleteBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glDeleteBufferRegionARB", typeof(DeleteBufferRegionARB));
internal static DeleteBufferRegionARB wglDeleteBufferRegionARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean SaveBufferRegionARB(IntPtr hRegion, int x, int y, int width, int height);
internal static SaveBufferRegionARB glSaveBufferRegionARB = (SaveBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glSaveBufferRegionARB", typeof(SaveBufferRegionARB));
internal static SaveBufferRegionARB wglSaveBufferRegionARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean RestoreBufferRegionARB(IntPtr hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
internal static RestoreBufferRegionARB glRestoreBufferRegionARB = (RestoreBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glRestoreBufferRegionARB", typeof(RestoreBufferRegionARB));
internal static RestoreBufferRegionARB wglRestoreBufferRegionARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetExtensionsStringARB(IntPtr hdc);
internal static GetExtensionsStringARB glGetExtensionsStringARB = (GetExtensionsStringARB)Wgl.GetDelegateForExtensionMethod("glGetExtensionsStringARB", typeof(GetExtensionsStringARB));
internal static GetExtensionsStringARB wglGetExtensionsStringARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetPixelFormatAttribivARB(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, int* piAttributes, [Out] int* piValues);
internal unsafe static GetPixelFormatAttribivARB glGetPixelFormatAttribivARB = (GetPixelFormatAttribivARB)Wgl.GetDelegateForExtensionMethod("glGetPixelFormatAttribivARB", typeof(GetPixelFormatAttribivARB));
internal unsafe static GetPixelFormatAttribivARB wglGetPixelFormatAttribivARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetPixelFormatAttribfvARB(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, int* piAttributes, [Out] Single* pfValues);
internal unsafe static GetPixelFormatAttribfvARB glGetPixelFormatAttribfvARB = (GetPixelFormatAttribfvARB)Wgl.GetDelegateForExtensionMethod("glGetPixelFormatAttribfvARB", typeof(GetPixelFormatAttribfvARB));
internal unsafe static GetPixelFormatAttribfvARB wglGetPixelFormatAttribfvARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean ChoosePixelFormatARB(IntPtr hdc, int* piAttribIList, Single* pfAttribFList, UInt32 nMaxFormats, [Out] int* piFormats, [Out] UInt32 nNumFormats);
internal unsafe static ChoosePixelFormatARB glChoosePixelFormatARB = (ChoosePixelFormatARB)Wgl.GetDelegateForExtensionMethod("glChoosePixelFormatARB", typeof(ChoosePixelFormatARB));
internal unsafe static ChoosePixelFormatARB wglChoosePixelFormatARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean MakeContextCurrentARB(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);
internal static MakeContextCurrentARB glMakeContextCurrentARB = (MakeContextCurrentARB)Wgl.GetDelegateForExtensionMethod("glMakeContextCurrentARB", typeof(MakeContextCurrentARB));
internal static MakeContextCurrentARB wglMakeContextCurrentARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetCurrentReadDCARB();
internal static GetCurrentReadDCARB glGetCurrentReadDCARB = (GetCurrentReadDCARB)Wgl.GetDelegateForExtensionMethod("glGetCurrentReadDCARB", typeof(GetCurrentReadDCARB));
internal static GetCurrentReadDCARB wglGetCurrentReadDCARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreatePbufferARB(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int* piAttribList);
internal unsafe static CreatePbufferARB glCreatePbufferARB = (CreatePbufferARB)Wgl.GetDelegateForExtensionMethod("glCreatePbufferARB", typeof(CreatePbufferARB));
internal unsafe static CreatePbufferARB wglCreatePbufferARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetPbufferDCARB(IntPtr hPbuffer);
internal static GetPbufferDCARB glGetPbufferDCARB = (GetPbufferDCARB)Wgl.GetDelegateForExtensionMethod("glGetPbufferDCARB", typeof(GetPbufferDCARB));
internal static GetPbufferDCARB wglGetPbufferDCARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int ReleasePbufferDCARB(IntPtr hPbuffer, IntPtr hDC);
internal static ReleasePbufferDCARB glReleasePbufferDCARB = (ReleasePbufferDCARB)Wgl.GetDelegateForExtensionMethod("glReleasePbufferDCARB", typeof(ReleasePbufferDCARB));
internal static ReleasePbufferDCARB wglReleasePbufferDCARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DestroyPbufferARB(IntPtr hPbuffer);
internal static DestroyPbufferARB glDestroyPbufferARB = (DestroyPbufferARB)Wgl.GetDelegateForExtensionMethod("glDestroyPbufferARB", typeof(DestroyPbufferARB));
internal static DestroyPbufferARB wglDestroyPbufferARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean QueryPbufferARB(IntPtr hPbuffer, int iAttribute, [Out] int piValue);
internal static QueryPbufferARB glQueryPbufferARB = (QueryPbufferARB)Wgl.GetDelegateForExtensionMethod("glQueryPbufferARB", typeof(QueryPbufferARB));
internal static QueryPbufferARB wglQueryPbufferARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean BindTexImageARB(IntPtr hPbuffer, int iBuffer);
internal static BindTexImageARB glBindTexImageARB = (BindTexImageARB)Wgl.GetDelegateForExtensionMethod("glBindTexImageARB", typeof(BindTexImageARB));
internal static BindTexImageARB wglBindTexImageARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean ReleaseTexImageARB(IntPtr hPbuffer, int iBuffer);
internal static ReleaseTexImageARB glReleaseTexImageARB = (ReleaseTexImageARB)Wgl.GetDelegateForExtensionMethod("glReleaseTexImageARB", typeof(ReleaseTexImageARB));
internal static ReleaseTexImageARB wglReleaseTexImageARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean SetPbufferAttribARB(IntPtr hPbuffer, int* piAttribList);
internal unsafe static SetPbufferAttribARB glSetPbufferAttribARB = (SetPbufferAttribARB)Wgl.GetDelegateForExtensionMethod("glSetPbufferAttribARB", typeof(SetPbufferAttribARB));
internal unsafe static SetPbufferAttribARB wglSetPbufferAttribARB = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean CreateDisplayColorTableEXT(UInt16 id);
internal static CreateDisplayColorTableEXT glCreateDisplayColorTableEXT = (CreateDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glCreateDisplayColorTableEXT", typeof(CreateDisplayColorTableEXT));
internal static CreateDisplayColorTableEXT wglCreateDisplayColorTableEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean LoadDisplayColorTableEXT(UInt16* table, UInt32 length);
internal unsafe static LoadDisplayColorTableEXT glLoadDisplayColorTableEXT = (LoadDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glLoadDisplayColorTableEXT", typeof(LoadDisplayColorTableEXT));
internal unsafe static LoadDisplayColorTableEXT wglLoadDisplayColorTableEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean BindDisplayColorTableEXT(UInt16 id);
internal static BindDisplayColorTableEXT glBindDisplayColorTableEXT = (BindDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glBindDisplayColorTableEXT", typeof(BindDisplayColorTableEXT));
internal static BindDisplayColorTableEXT wglBindDisplayColorTableEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void DestroyDisplayColorTableEXT(UInt16 id);
internal static DestroyDisplayColorTableEXT glDestroyDisplayColorTableEXT = (DestroyDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glDestroyDisplayColorTableEXT", typeof(DestroyDisplayColorTableEXT));
internal static DestroyDisplayColorTableEXT wglDestroyDisplayColorTableEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetExtensionsStringEXT();
internal static GetExtensionsStringEXT glGetExtensionsStringEXT = (GetExtensionsStringEXT)Wgl.GetDelegateForExtensionMethod("glGetExtensionsStringEXT", typeof(GetExtensionsStringEXT));
internal static GetExtensionsStringEXT wglGetExtensionsStringEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean MakeContextCurrentEXT(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);
internal static MakeContextCurrentEXT glMakeContextCurrentEXT = (MakeContextCurrentEXT)Wgl.GetDelegateForExtensionMethod("glMakeContextCurrentEXT", typeof(MakeContextCurrentEXT));
internal static MakeContextCurrentEXT wglMakeContextCurrentEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetCurrentReadDCEXT();
internal static GetCurrentReadDCEXT glGetCurrentReadDCEXT = (GetCurrentReadDCEXT)Wgl.GetDelegateForExtensionMethod("glGetCurrentReadDCEXT", typeof(GetCurrentReadDCEXT));
internal static GetCurrentReadDCEXT wglGetCurrentReadDCEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int* piAttribList);
internal unsafe static CreatePbufferEXT glCreatePbufferEXT = (CreatePbufferEXT)Wgl.GetDelegateForExtensionMethod("glCreatePbufferEXT", typeof(CreatePbufferEXT));
internal unsafe static CreatePbufferEXT wglCreatePbufferEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr GetPbufferDCEXT(IntPtr hPbuffer);
internal static GetPbufferDCEXT glGetPbufferDCEXT = (GetPbufferDCEXT)Wgl.GetDelegateForExtensionMethod("glGetPbufferDCEXT", typeof(GetPbufferDCEXT));
internal static GetPbufferDCEXT wglGetPbufferDCEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int ReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC);
internal static ReleasePbufferDCEXT glReleasePbufferDCEXT = (ReleasePbufferDCEXT)Wgl.GetDelegateForExtensionMethod("glReleasePbufferDCEXT", typeof(ReleasePbufferDCEXT));
internal static ReleasePbufferDCEXT wglReleasePbufferDCEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DestroyPbufferEXT(IntPtr hPbuffer);
internal static DestroyPbufferEXT glDestroyPbufferEXT = (DestroyPbufferEXT)Wgl.GetDelegateForExtensionMethod("glDestroyPbufferEXT", typeof(DestroyPbufferEXT));
internal static DestroyPbufferEXT wglDestroyPbufferEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean QueryPbufferEXT(IntPtr hPbuffer, int iAttribute, [Out] int piValue);
internal static QueryPbufferEXT glQueryPbufferEXT = (QueryPbufferEXT)Wgl.GetDelegateForExtensionMethod("glQueryPbufferEXT", typeof(QueryPbufferEXT));
internal static QueryPbufferEXT wglQueryPbufferEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetPixelFormatAttribivEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int* piAttributes, [Out] int* piValues);
internal unsafe static GetPixelFormatAttribivEXT glGetPixelFormatAttribivEXT = (GetPixelFormatAttribivEXT)Wgl.GetDelegateForExtensionMethod("glGetPixelFormatAttribivEXT", typeof(GetPixelFormatAttribivEXT));
internal unsafe static GetPixelFormatAttribivEXT wglGetPixelFormatAttribivEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetPixelFormatAttribfvEXT(IntPtr hdc, int iPixelFormat, int iLayerPlane, UInt32 nAttributes, [Out] int* piAttributes, [Out] Single* pfValues);
internal unsafe static GetPixelFormatAttribfvEXT glGetPixelFormatAttribfvEXT = (GetPixelFormatAttribfvEXT)Wgl.GetDelegateForExtensionMethod("glGetPixelFormatAttribfvEXT", typeof(GetPixelFormatAttribfvEXT));
internal unsafe static GetPixelFormatAttribfvEXT wglGetPixelFormatAttribfvEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean ChoosePixelFormatEXT(IntPtr hdc, int* piAttribIList, Single* pfAttribFList, UInt32 nMaxFormats, [Out] int* piFormats, [Out] UInt32 nNumFormats);
internal unsafe static ChoosePixelFormatEXT glChoosePixelFormatEXT = (ChoosePixelFormatEXT)Wgl.GetDelegateForExtensionMethod("glChoosePixelFormatEXT", typeof(ChoosePixelFormatEXT));
internal unsafe static ChoosePixelFormatEXT wglChoosePixelFormatEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean SwapIntervalEXT(int interval);
internal static SwapIntervalEXT glSwapIntervalEXT = (SwapIntervalEXT)Wgl.GetDelegateForExtensionMethod("glSwapIntervalEXT", typeof(SwapIntervalEXT));
internal static SwapIntervalEXT wglSwapIntervalEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int GetSwapIntervalEXT();
internal static GetSwapIntervalEXT glGetSwapIntervalEXT = (GetSwapIntervalEXT)Wgl.GetDelegateForExtensionMethod("glGetSwapIntervalEXT", typeof(GetSwapIntervalEXT));
internal static GetSwapIntervalEXT wglGetSwapIntervalEXT = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr AllocateMemoryNV(Int32 size, Single readfreq, Single writefreq, Single priority);
internal static AllocateMemoryNV glAllocateMemoryNV = (AllocateMemoryNV)Wgl.GetDelegateForExtensionMethod("glAllocateMemoryNV", typeof(AllocateMemoryNV));
internal static AllocateMemoryNV wglAllocateMemoryNV = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void FreeMemoryNV([Out] void* pointer);
internal unsafe static FreeMemoryNV glFreeMemoryNV = (FreeMemoryNV)Wgl.GetDelegateForExtensionMethod("glFreeMemoryNV", typeof(FreeMemoryNV));
internal unsafe static FreeMemoryNV wglFreeMemoryNV = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetSyncValuesOML(IntPtr hdc, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
internal unsafe static GetSyncValuesOML glGetSyncValuesOML = (GetSyncValuesOML)Wgl.GetDelegateForExtensionMethod("glGetSyncValuesOML", typeof(GetSyncValuesOML));
internal unsafe static GetSyncValuesOML wglGetSyncValuesOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetMscRateOML(IntPtr hdc, [Out] Int32* numerator, [Out] Int32* denominator);
internal unsafe static GetMscRateOML glGetMscRateOML = (GetMscRateOML)Wgl.GetDelegateForExtensionMethod("glGetMscRateOML", typeof(GetMscRateOML));
internal unsafe static GetMscRateOML wglGetMscRateOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Int64 SwapBuffersMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder);
internal static SwapBuffersMscOML glSwapBuffersMscOML = (SwapBuffersMscOML)Wgl.GetDelegateForExtensionMethod("glSwapBuffersMscOML", typeof(SwapBuffersMscOML));
internal static SwapBuffersMscOML wglSwapBuffersMscOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Int64 SwapLayerBuffersMscOML(IntPtr hdc, int fuPlanes, Int64 target_msc, Int64 divisor, Int64 remainder);
internal static SwapLayerBuffersMscOML glSwapLayerBuffersMscOML = (SwapLayerBuffersMscOML)Wgl.GetDelegateForExtensionMethod("glSwapLayerBuffersMscOML", typeof(SwapLayerBuffersMscOML));
internal static SwapLayerBuffersMscOML wglSwapLayerBuffersMscOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean WaitForMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
internal unsafe static WaitForMscOML glWaitForMscOML = (WaitForMscOML)Wgl.GetDelegateForExtensionMethod("glWaitForMscOML", typeof(WaitForMscOML));
internal unsafe static WaitForMscOML wglWaitForMscOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean WaitForSbcOML(IntPtr hdc, Int64 target_sbc, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
internal unsafe static WaitForSbcOML glWaitForSbcOML = (WaitForSbcOML)Wgl.GetDelegateForExtensionMethod("glWaitForSbcOML", typeof(WaitForSbcOML));
internal unsafe static WaitForSbcOML wglWaitForSbcOML = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, [Out] int* piValue);
internal unsafe static GetDigitalVideoParametersI3D glGetDigitalVideoParametersI3D = (GetDigitalVideoParametersI3D)Wgl.GetDelegateForExtensionMethod("glGetDigitalVideoParametersI3D", typeof(GetDigitalVideoParametersI3D));
internal unsafe static GetDigitalVideoParametersI3D wglGetDigitalVideoParametersI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean SetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, int* piValue);
internal unsafe static SetDigitalVideoParametersI3D glSetDigitalVideoParametersI3D = (SetDigitalVideoParametersI3D)Wgl.GetDelegateForExtensionMethod("glSetDigitalVideoParametersI3D", typeof(SetDigitalVideoParametersI3D));
internal unsafe static SetDigitalVideoParametersI3D wglSetDigitalVideoParametersI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetGammaTableParametersI3D(IntPtr hDC, int iAttribute, [Out] int* piValue);
internal unsafe static GetGammaTableParametersI3D glGetGammaTableParametersI3D = (GetGammaTableParametersI3D)Wgl.GetDelegateForExtensionMethod("glGetGammaTableParametersI3D", typeof(GetGammaTableParametersI3D));
internal unsafe static GetGammaTableParametersI3D wglGetGammaTableParametersI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean SetGammaTableParametersI3D(IntPtr hDC, int iAttribute, int* piValue);
internal unsafe static SetGammaTableParametersI3D glSetGammaTableParametersI3D = (SetGammaTableParametersI3D)Wgl.GetDelegateForExtensionMethod("glSetGammaTableParametersI3D", typeof(SetGammaTableParametersI3D));
internal unsafe static SetGammaTableParametersI3D wglSetGammaTableParametersI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean GetGammaTableI3D(IntPtr hDC, int iEntries, [Out] UInt16* puRed, [Out] UInt16* puGreen, [Out] UInt16* puBlue);
internal unsafe static GetGammaTableI3D glGetGammaTableI3D = (GetGammaTableI3D)Wgl.GetDelegateForExtensionMethod("glGetGammaTableI3D", typeof(GetGammaTableI3D));
internal unsafe static GetGammaTableI3D wglGetGammaTableI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean SetGammaTableI3D(IntPtr hDC, int iEntries, UInt16* puRed, UInt16* puGreen, UInt16* puBlue);
internal unsafe static SetGammaTableI3D glSetGammaTableI3D = (SetGammaTableI3D)Wgl.GetDelegateForExtensionMethod("glSetGammaTableI3D", typeof(SetGammaTableI3D));
internal unsafe static SetGammaTableI3D wglSetGammaTableI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean EnableGenlockI3D(IntPtr hDC);
internal static EnableGenlockI3D glEnableGenlockI3D = (EnableGenlockI3D)Wgl.GetDelegateForExtensionMethod("glEnableGenlockI3D", typeof(EnableGenlockI3D));
internal static EnableGenlockI3D wglEnableGenlockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DisableGenlockI3D(IntPtr hDC);
internal static DisableGenlockI3D glDisableGenlockI3D = (DisableGenlockI3D)Wgl.GetDelegateForExtensionMethod("glDisableGenlockI3D", typeof(DisableGenlockI3D));
internal static DisableGenlockI3D wglDisableGenlockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean IsEnabledGenlockI3D(IntPtr hDC, [Out] Boolean pFlag);
internal static IsEnabledGenlockI3D glIsEnabledGenlockI3D = (IsEnabledGenlockI3D)Wgl.GetDelegateForExtensionMethod("glIsEnabledGenlockI3D", typeof(IsEnabledGenlockI3D));
internal static IsEnabledGenlockI3D wglIsEnabledGenlockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GenlockSourceI3D(IntPtr hDC, UInt32 uSource);
internal static GenlockSourceI3D glGenlockSourceI3D = (GenlockSourceI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceI3D", typeof(GenlockSourceI3D));
internal static GenlockSourceI3D wglGenlockSourceI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GetGenlockSourceI3D(IntPtr hDC, [Out] UInt32 uSource);
internal static GetGenlockSourceI3D glGetGenlockSourceI3D = (GetGenlockSourceI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceI3D", typeof(GetGenlockSourceI3D));
internal static GetGenlockSourceI3D wglGetGenlockSourceI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GenlockSourceEdgeI3D(IntPtr hDC, UInt32 uEdge);
internal static GenlockSourceEdgeI3D glGenlockSourceEdgeI3D = (GenlockSourceEdgeI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceEdgeI3D", typeof(GenlockSourceEdgeI3D));
internal static GenlockSourceEdgeI3D wglGenlockSourceEdgeI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GetGenlockSourceEdgeI3D(IntPtr hDC, [Out] UInt32 uEdge);
internal static GetGenlockSourceEdgeI3D glGetGenlockSourceEdgeI3D = (GetGenlockSourceEdgeI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceEdgeI3D", typeof(GetGenlockSourceEdgeI3D));
internal static GetGenlockSourceEdgeI3D wglGetGenlockSourceEdgeI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GenlockSampleRateI3D(IntPtr hDC, UInt32 uRate);
internal static GenlockSampleRateI3D glGenlockSampleRateI3D = (GenlockSampleRateI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSampleRateI3D", typeof(GenlockSampleRateI3D));
internal static GenlockSampleRateI3D wglGenlockSampleRateI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GetGenlockSampleRateI3D(IntPtr hDC, [Out] UInt32 uRate);
internal static GetGenlockSampleRateI3D glGetGenlockSampleRateI3D = (GetGenlockSampleRateI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSampleRateI3D", typeof(GetGenlockSampleRateI3D));
internal static GetGenlockSampleRateI3D wglGetGenlockSampleRateI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GenlockSourceDelayI3D(IntPtr hDC, UInt32 uDelay);
internal static GenlockSourceDelayI3D glGenlockSourceDelayI3D = (GenlockSourceDelayI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceDelayI3D", typeof(GenlockSourceDelayI3D));
internal static GenlockSourceDelayI3D wglGenlockSourceDelayI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GetGenlockSourceDelayI3D(IntPtr hDC, [Out] UInt32 uDelay);
internal static GetGenlockSourceDelayI3D glGetGenlockSourceDelayI3D = (GetGenlockSourceDelayI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceDelayI3D", typeof(GetGenlockSourceDelayI3D));
internal static GetGenlockSourceDelayI3D wglGetGenlockSourceDelayI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean QueryGenlockMaxSourceDelayI3D(IntPtr hDC, [Out] UInt32 uMaxLineDelay, [Out] UInt32 uMaxPixelDelay);
internal static QueryGenlockMaxSourceDelayI3D glQueryGenlockMaxSourceDelayI3D = (QueryGenlockMaxSourceDelayI3D)Wgl.GetDelegateForExtensionMethod("glQueryGenlockMaxSourceDelayI3D", typeof(QueryGenlockMaxSourceDelayI3D));
internal static QueryGenlockMaxSourceDelayI3D wglQueryGenlockMaxSourceDelayI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate IntPtr CreateImageBufferI3D(IntPtr hDC, Int32 dwSize, UInt32 uFlags);
internal static CreateImageBufferI3D glCreateImageBufferI3D = (CreateImageBufferI3D)Wgl.GetDelegateForExtensionMethod("glCreateImageBufferI3D", typeof(CreateImageBufferI3D));
internal static CreateImageBufferI3D wglCreateImageBufferI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean DestroyImageBufferI3D(IntPtr hDC, void* pAddress);
internal unsafe static DestroyImageBufferI3D glDestroyImageBufferI3D = (DestroyImageBufferI3D)Wgl.GetDelegateForExtensionMethod("glDestroyImageBufferI3D", typeof(DestroyImageBufferI3D));
internal unsafe static DestroyImageBufferI3D wglDestroyImageBufferI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean AssociateImageBufferEventsI3D(IntPtr hDC, IntPtr* pEvent, void* pAddress, Int32* pSize, UInt32 count);
internal unsafe static AssociateImageBufferEventsI3D glAssociateImageBufferEventsI3D = (AssociateImageBufferEventsI3D)Wgl.GetDelegateForExtensionMethod("glAssociateImageBufferEventsI3D", typeof(AssociateImageBufferEventsI3D));
internal unsafe static AssociateImageBufferEventsI3D wglAssociateImageBufferEventsI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate Boolean ReleaseImageBufferEventsI3D(IntPtr hDC, void* pAddress, UInt32 count);
internal unsafe static ReleaseImageBufferEventsI3D glReleaseImageBufferEventsI3D = (ReleaseImageBufferEventsI3D)Wgl.GetDelegateForExtensionMethod("glReleaseImageBufferEventsI3D", typeof(ReleaseImageBufferEventsI3D));
internal unsafe static ReleaseImageBufferEventsI3D wglReleaseImageBufferEventsI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean EnableFrameLockI3D();
internal static EnableFrameLockI3D glEnableFrameLockI3D = (EnableFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glEnableFrameLockI3D", typeof(EnableFrameLockI3D));
internal static EnableFrameLockI3D wglEnableFrameLockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean DisableFrameLockI3D();
internal static DisableFrameLockI3D glDisableFrameLockI3D = (DisableFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glDisableFrameLockI3D", typeof(DisableFrameLockI3D));
internal static DisableFrameLockI3D wglDisableFrameLockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean IsEnabledFrameLockI3D([Out] Boolean pFlag);
internal static IsEnabledFrameLockI3D glIsEnabledFrameLockI3D = (IsEnabledFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glIsEnabledFrameLockI3D", typeof(IsEnabledFrameLockI3D));
internal static IsEnabledFrameLockI3D wglIsEnabledFrameLockI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean QueryFrameLockMasterI3D([Out] Boolean pFlag);
internal static QueryFrameLockMasterI3D glQueryFrameLockMasterI3D = (QueryFrameLockMasterI3D)Wgl.GetDelegateForExtensionMethod("glQueryFrameLockMasterI3D", typeof(QueryFrameLockMasterI3D));
internal static QueryFrameLockMasterI3D wglQueryFrameLockMasterI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean GetFrameUsageI3D([Out] float pUsage);
internal static GetFrameUsageI3D glGetFrameUsageI3D = (GetFrameUsageI3D)Wgl.GetDelegateForExtensionMethod("glGetFrameUsageI3D", typeof(GetFrameUsageI3D));
internal static GetFrameUsageI3D wglGetFrameUsageI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean BeginFrameTrackingI3D();
internal static BeginFrameTrackingI3D glBeginFrameTrackingI3D = (BeginFrameTrackingI3D)Wgl.GetDelegateForExtensionMethod("glBeginFrameTrackingI3D", typeof(BeginFrameTrackingI3D));
internal static BeginFrameTrackingI3D wglBeginFrameTrackingI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean EndFrameTrackingI3D();
internal static EndFrameTrackingI3D glEndFrameTrackingI3D = (EndFrameTrackingI3D)Wgl.GetDelegateForExtensionMethod("glEndFrameTrackingI3D", typeof(EndFrameTrackingI3D));
internal static EndFrameTrackingI3D wglEndFrameTrackingI3D = null;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate Boolean QueryFrameTrackingI3D([Out] Int32 pFrameCount, [Out] Int32 pMissedFrames, [Out] float pLastMissedUsage);
internal static QueryFrameTrackingI3D glQueryFrameTrackingI3D = (QueryFrameTrackingI3D)Wgl.GetDelegateForExtensionMethod("glQueryFrameTrackingI3D", typeof(QueryFrameTrackingI3D));
internal static QueryFrameTrackingI3D wglQueryFrameTrackingI3D = null;
}
}
}

View file

@ -1,4 +1,4 @@
namespace OpenTK.OpenGL
namespace OpenTK.Platform.Windows
{
public static partial class Wgl
{
@ -6,149 +6,149 @@ namespace OpenTK.OpenGL
{
public enum WGL_ARB_buffer_region
{
WGL_BACK_COLOR_BUFFER_BIT_ARB = ((int)0x00000002),
WGL_FRONT_COLOR_BUFFER_BIT_ARB = ((int)0x00000001),
WGL_STENCIL_BUFFER_BIT_ARB = ((int)0x00000008),
WGL_DEPTH_BUFFER_BIT_ARB = ((int)0x00000004),
WGL_BACK_COLOR_BUFFER_BIT_ARB = ((int)0x00000002),
WGL_STENCIL_BUFFER_BIT_ARB = ((int)0x00000008),
WGL_FRONT_COLOR_BUFFER_BIT_ARB = ((int)0x00000001),
}
public enum WGL_EXT_pixel_format
{
WGL_AUX_BUFFERS_EXT = ((int)0x2024),
WGL_SHARE_STENCIL_EXT = ((int)0x200D),
WGL_SWAP_METHOD_EXT = ((int)0x2007),
WGL_TRANSPARENT_EXT = ((int)0x200A),
WGL_ACCELERATION_EXT = ((int)0x2003),
WGL_ACCUM_GREEN_BITS_EXT = ((int)0x201F),
WGL_SUPPORT_GDI_EXT = ((int)0x200F),
WGL_TRANSPARENT_VALUE_EXT = ((int)0x200B),
WGL_DEPTH_BITS_EXT = ((int)0x2022),
WGL_STEREO_EXT = ((int)0x2012),
WGL_FULL_ACCELERATION_EXT = ((int)0x2027),
WGL_SWAP_UNDEFINED_EXT = ((int)0x202A),
WGL_RED_BITS_EXT = ((int)0x2015),
WGL_PIXEL_TYPE_EXT = ((int)0x2013),
WGL_DRAW_TO_BITMAP_EXT = ((int)0x2002),
WGL_DRAW_TO_WINDOW_EXT = ((int)0x2001),
WGL_ALPHA_BITS_EXT = ((int)0x201B),
WGL_RED_SHIFT_EXT = ((int)0x2016),
WGL_TYPE_RGBA_EXT = ((int)0x202B),
WGL_ACCUM_BITS_EXT = ((int)0x201D),
WGL_SWAP_COPY_EXT = ((int)0x2029),
WGL_NEED_SYSTEM_PALETTE_EXT = ((int)0x2005),
WGL_TYPE_COLORINDEX_EXT = ((int)0x202C),
WGL_SHARE_ACCUM_EXT = ((int)0x200E),
WGL_COLOR_BITS_EXT = ((int)0x2014),
WGL_SUPPORT_OPENGL_EXT = ((int)0x2010),
WGL_ACCUM_ALPHA_BITS_EXT = ((int)0x2021),
WGL_STENCIL_BITS_EXT = ((int)0x2023),
WGL_SWAP_LAYER_BUFFERS_EXT = ((int)0x2006),
WGL_ACCUM_BLUE_BITS_EXT = ((int)0x2020),
WGL_SWAP_EXCHANGE_EXT = ((int)0x2028),
WGL_ALPHA_SHIFT_EXT = ((int)0x201C),
WGL_GENERIC_ACCELERATION_EXT = ((int)0x2026),
WGL_GREEN_SHIFT_EXT = ((int)0x2018),
WGL_NUMBER_UNDERLAYS_EXT = ((int)0x2009),
WGL_NUMBER_OVERLAYS_EXT = ((int)0x2008),
WGL_NEED_PALETTE_EXT = ((int)0x2004),
WGL_FULL_ACCELERATION_EXT = ((int)0x2027),
WGL_ACCUM_RED_BITS_EXT = ((int)0x201E),
WGL_SUPPORT_OPENGL_EXT = ((int)0x2010),
WGL_DEPTH_BITS_EXT = ((int)0x2022),
WGL_SHARE_STENCIL_EXT = ((int)0x200D),
WGL_SWAP_LAYER_BUFFERS_EXT = ((int)0x2006),
WGL_GREEN_BITS_EXT = ((int)0x2017),
WGL_STENCIL_BITS_EXT = ((int)0x2023),
WGL_NEED_PALETTE_EXT = ((int)0x2004),
WGL_ACCELERATION_EXT = ((int)0x2003),
WGL_TYPE_RGBA_EXT = ((int)0x202B),
WGL_TYPE_COLORINDEX_EXT = ((int)0x202C),
WGL_NUMBER_PIXEL_FORMATS_EXT = ((int)0x2000),
WGL_ACCUM_GREEN_BITS_EXT = ((int)0x201F),
WGL_NEED_SYSTEM_PALETTE_EXT = ((int)0x2005),
WGL_ACCUM_BITS_EXT = ((int)0x201D),
WGL_TRANSPARENT_EXT = ((int)0x200A),
WGL_NUMBER_UNDERLAYS_EXT = ((int)0x2009),
WGL_RED_SHIFT_EXT = ((int)0x2016),
WGL_DRAW_TO_WINDOW_EXT = ((int)0x2001),
WGL_BLUE_BITS_EXT = ((int)0x2019),
WGL_SWAP_EXCHANGE_EXT = ((int)0x2028),
WGL_SHARE_ACCUM_EXT = ((int)0x200E),
WGL_DOUBLE_BUFFER_EXT = ((int)0x2011),
WGL_BLUE_SHIFT_EXT = ((int)0x201A),
WGL_SHARE_DEPTH_EXT = ((int)0x200C),
WGL_NUMBER_PIXEL_FORMATS_EXT = ((int)0x2000),
WGL_PIXEL_TYPE_EXT = ((int)0x2013),
WGL_AUX_BUFFERS_EXT = ((int)0x2024),
WGL_DRAW_TO_BITMAP_EXT = ((int)0x2002),
WGL_ACCUM_BLUE_BITS_EXT = ((int)0x2020),
WGL_STEREO_EXT = ((int)0x2012),
WGL_TRANSPARENT_VALUE_EXT = ((int)0x200B),
WGL_SWAP_METHOD_EXT = ((int)0x2007),
WGL_SWAP_COPY_EXT = ((int)0x2029),
WGL_ACCUM_ALPHA_BITS_EXT = ((int)0x2021),
WGL_ALPHA_BITS_EXT = ((int)0x201B),
WGL_SUPPORT_GDI_EXT = ((int)0x200F),
WGL_COLOR_BITS_EXT = ((int)0x2014),
WGL_NUMBER_OVERLAYS_EXT = ((int)0x2008),
WGL_ALPHA_SHIFT_EXT = ((int)0x201C),
WGL_GREEN_SHIFT_EXT = ((int)0x2018),
WGL_NO_ACCELERATION_EXT = ((int)0x2025),
WGL_ACCUM_RED_BITS_EXT = ((int)0x201E),
WGL_SWAP_UNDEFINED_EXT = ((int)0x202A),
WGL_SHARE_DEPTH_EXT = ((int)0x200C),
}
public enum WGL_ARB_pixel_format
{
WGL_SHARE_STENCIL_ARB = ((int)0x200D),
WGL_DRAW_TO_BITMAP_ARB = ((int)0x2002),
WGL_SWAP_COPY_ARB = ((int)0x2029),
WGL_ACCUM_BLUE_BITS_ARB = ((int)0x2020),
WGL_MAX_PBUFFER_PIXELS_ARB = ((int)0x202E),
WGL_PIXEL_TYPE_ARB = ((int)0x2013),
WGL_FULL_ACCELERATION_ARB = ((int)0x2027),
WGL_TYPE_COLORINDEX_ARB = ((int)0x202C),
WGL_NO_ACCELERATION_ARB = ((int)0x2025),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_BLUE_SHIFT_ARB = ((int)0x201A),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_ACCUM_GREEN_BITS_ARB = ((int)0x201F),
WGL_SWAP_EXCHANGE_ARB = ((int)0x2028),
WGL_ACCUM_ALPHA_BITS_ARB = ((int)0x2021),
WGL_NUMBER_UNDERLAYS_ARB = ((int)0x2009),
WGL_DEPTH_BITS_ARB = ((int)0x2022),
WGL_STEREO_ARB = ((int)0x2012),
WGL_SUPPORT_OPENGL_ARB = ((int)0x2010),
WGL_SHARE_DEPTH_ARB = ((int)0x200C),
WGL_NUMBER_PIXEL_FORMATS_ARB = ((int)0x2000),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_SHARE_ACCUM_ARB = ((int)0x200E),
WGL_RED_BITS_ARB = ((int)0x2015),
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
WGL_NEED_PALETTE_ARB = ((int)0x2004),
WGL_ACCUM_ALPHA_BITS_ARB = ((int)0x2021),
WGL_ALPHA_BITS_ARB = ((int)0x201B),
WGL_DRAW_TO_BITMAP_ARB = ((int)0x2002),
WGL_NUMBER_UNDERLAYS_ARB = ((int)0x2009),
WGL_GREEN_SHIFT_ARB = ((int)0x2018),
WGL_NUMBER_PIXEL_FORMATS_ARB = ((int)0x2000),
WGL_GENERIC_ACCELERATION_ARB = ((int)0x2026),
WGL_SWAP_UNDEFINED_ARB = ((int)0x202A),
WGL_NUMBER_OVERLAYS_ARB = ((int)0x2008),
WGL_BLUE_SHIFT_ARB = ((int)0x201A),
WGL_ACCUM_BITS_ARB = ((int)0x201D),
WGL_SWAP_LAYER_BUFFERS_ARB = ((int)0x2006),
WGL_PBUFFER_HEIGHT_ARB = ((int)0x2035),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_ALPHA_SHIFT_ARB = ((int)0x201C),
WGL_DEPTH_BITS_ARB = ((int)0x2022),
WGL_SHARE_DEPTH_ARB = ((int)0x200C),
WGL_TYPE_COLORINDEX_ARB = ((int)0x202C),
WGL_FULL_ACCELERATION_ARB = ((int)0x2027),
WGL_ACCUM_BLUE_BITS_ARB = ((int)0x2020),
WGL_SWAP_COPY_ARB = ((int)0x2029),
WGL_SHARE_ACCUM_ARB = ((int)0x200E),
WGL_SUPPORT_OPENGL_ARB = ((int)0x2010),
WGL_DRAW_TO_WINDOW_ARB = ((int)0x2001),
WGL_SHARE_STENCIL_ARB = ((int)0x200D),
WGL_RED_SHIFT_ARB = ((int)0x2016),
WGL_GREEN_BITS_ARB = ((int)0x2017),
WGL_SWAP_METHOD_ARB = ((int)0x2007),
WGL_PIXEL_TYPE_ARB = ((int)0x2013),
WGL_TYPE_RGBA_ARB = ((int)0x202B),
WGL_AUX_BUFFERS_ARB = ((int)0x2024),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_SUPPORT_GDI_ARB = ((int)0x200F),
WGL_DOUBLE_BUFFER_ARB = ((int)0x2011),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
WGL_NEED_SYSTEM_PALETTE_ARB = ((int)0x2005),
WGL_COLOR_BITS_ARB = ((int)0x2014),
WGL_ALPHA_BITS_ARB = ((int)0x201B),
WGL_ACCUM_BITS_ARB = ((int)0x201D),
WGL_DRAW_TO_WINDOW_ARB = ((int)0x2001),
WGL_PBUFFER_HEIGHT_ARB = ((int)0x2035),
WGL_GREEN_BITS_ARB = ((int)0x2017),
WGL_NEED_PALETTE_ARB = ((int)0x2004),
WGL_STENCIL_BITS_ARB = ((int)0x2023),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_GENERIC_ACCELERATION_ARB = ((int)0x2026),
WGL_ACCELERATION_ARB = ((int)0x2003),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_RED_SHIFT_ARB = ((int)0x2016),
WGL_TYPE_RGBA_ARB = ((int)0x202B),
WGL_NUMBER_OVERLAYS_ARB = ((int)0x2008),
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
WGL_STEREO_ARB = ((int)0x2012),
WGL_BLUE_BITS_ARB = ((int)0x2019),
WGL_SWAP_METHOD_ARB = ((int)0x2007),
WGL_ACCUM_RED_BITS_ARB = ((int)0x201E),
WGL_GREEN_SHIFT_ARB = ((int)0x2018),
WGL_ALPHA_SHIFT_ARB = ((int)0x201C),
WGL_PBUFFER_LARGEST_ARB = ((int)0x2033),
WGL_SWAP_UNDEFINED_ARB = ((int)0x202A),
WGL_SWAP_LAYER_BUFFERS_ARB = ((int)0x2006),
WGL_AUX_BUFFERS_ARB = ((int)0x2024),
WGL_ACCUM_GREEN_BITS_ARB = ((int)0x201F),
WGL_SWAP_EXCHANGE_ARB = ((int)0x2028),
WGL_TRANSPARENT_ARB = ((int)0x200A),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_ACCUM_RED_BITS_ARB = ((int)0x201E),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
WGL_MAX_PBUFFER_PIXELS_ARB = ((int)0x202E),
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_PBUFFER_LARGEST_ARB = ((int)0x2033),
WGL_COLOR_BITS_ARB = ((int)0x2014),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_ACCELERATION_ARB = ((int)0x2003),
WGL_STENCIL_BITS_ARB = ((int)0x2023),
WGL_NO_ACCELERATION_ARB = ((int)0x2025),
}
public enum WGL_EXT_pbuffer
{
WGL_PBUFFER_HEIGHT_EXT = ((int)0x2035),
WGL_MAX_PBUFFER_HEIGHT_EXT = ((int)0x2030),
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = ((int)0x2031),
WGL_MAX_PBUFFER_WIDTH_EXT = ((int)0x202F),
WGL_PBUFFER_WIDTH_EXT = ((int)0x2034),
WGL_PBUFFER_LARGEST_EXT = ((int)0x2033),
WGL_PBUFFER_WIDTH_EXT = ((int)0x2034),
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = ((int)0x2032),
WGL_DRAW_TO_PBUFFER_EXT = ((int)0x202D),
WGL_PBUFFER_HEIGHT_EXT = ((int)0x2035),
WGL_MAX_PBUFFER_WIDTH_EXT = ((int)0x202F),
WGL_MAX_PBUFFER_PIXELS_EXT = ((int)0x202E),
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = ((int)0x2031),
}
public enum WGL_ARB_pbuffer
{
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_PBUFFER_LARGEST_ARB = ((int)0x2033),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_PBUFFER_HEIGHT_ARB = ((int)0x2035),
WGL_PBUFFER_LOST_ARB = ((int)0x2036),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_MAX_PBUFFER_PIXELS_ARB = ((int)0x202E),
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_PBUFFER_LOST_ARB = ((int)0x2036),
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
}
public enum WGL_EXT_depth_float
@ -158,14 +158,14 @@ namespace OpenTK.OpenGL
public enum WGL_EXT_multisample
{
WGL_SAMPLES_EXT = ((int)0x2042),
WGL_SAMPLE_BUFFERS_EXT = ((int)0x2041),
WGL_SAMPLES_EXT = ((int)0x2042),
}
public enum WGL_ARB_multisample
{
WGL_SAMPLE_BUFFERS_ARB = ((int)0x2041),
WGL_SAMPLES_ARB = ((int)0x2042),
WGL_SAMPLE_BUFFERS_ARB = ((int)0x2041),
}
public enum WGL_EXT_make_current_read
@ -175,35 +175,35 @@ namespace OpenTK.OpenGL
public enum WGL_ARB_make_current_read
{
ERROR_INVALID_PIXEL_TYPE_ARB = ((int)0x2043),
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = ((int)0x2054),
ERROR_INVALID_PIXEL_TYPE_ARB = ((int)0x2043),
}
public enum WGL_I3D_genlock
{
WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = ((int)0x2045),
WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = ((int)0x2047),
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = ((int)0x2048),
WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D = ((int)0x2046),
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = ((int)0x204A),
WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = ((int)0x2047),
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = ((int)0x2049),
WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = ((int)0x2045),
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = ((int)0x204C),
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = ((int)0x2044),
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = ((int)0x204B),
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = ((int)0x204C),
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = ((int)0x204A),
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = ((int)0x2049),
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = ((int)0x2048),
}
public enum WGL_I3D_gamma
{
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = ((int)0x204F),
WGL_GAMMA_TABLE_SIZE_I3D = ((int)0x204E),
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = ((int)0x204F),
}
public enum WGL_I3D_digital_video_control
{
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = ((int)0x2050),
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = ((int)0x2053),
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = ((int)0x2052),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = ((int)0x2051),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = ((int)0x2050),
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = ((int)0x2052),
}
public enum WGL_3DFX_multisample
@ -214,68 +214,68 @@ namespace OpenTK.OpenGL
public enum WGL_ARB_render_texture
{
WGL_TEXTURE_2D_ARB = ((int)0x207A),
WGL_TEXTURE_CUBE_MAP_ARB = ((int)0x2078),
WGL_AUX9_ARB = ((int)0x2090),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = ((int)0x2081),
WGL_AUX3_ARB = ((int)0x208A),
WGL_FRONT_RIGHT_ARB = ((int)0x2084),
WGL_TEXTURE_1D_ARB = ((int)0x2079),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = ((int)0x2080),
WGL_AUX4_ARB = ((int)0x208B),
WGL_CUBE_MAP_FACE_ARB = ((int)0x207C),
WGL_TEXTURE_RGBA_ARB = ((int)0x2076),
WGL_AUX8_ARB = ((int)0x208F),
WGL_BIND_TO_TEXTURE_RGBA_ARB = ((int)0x2071),
WGL_TEXTURE_TARGET_ARB = ((int)0x2073),
WGL_BACK_LEFT_ARB = ((int)0x2085),
WGL_BIND_TO_TEXTURE_RGB_ARB = ((int)0x2070),
WGL_AUX3_ARB = ((int)0x208A),
WGL_TEXTURE_RGB_ARB = ((int)0x2075),
WGL_TEXTURE_1D_ARB = ((int)0x2079),
WGL_BIND_TO_TEXTURE_RGBA_ARB = ((int)0x2071),
WGL_AUX5_ARB = ((int)0x208C),
WGL_MIPMAP_LEVEL_ARB = ((int)0x207B),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = ((int)0x207E),
WGL_NO_TEXTURE_ARB = ((int)0x2077),
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = ((int)0x207D),
WGL_TEXTURE_FORMAT_ARB = ((int)0x2072),
WGL_AUX1_ARB = ((int)0x2088),
WGL_AUX2_ARB = ((int)0x2089),
WGL_AUX0_ARB = ((int)0x2087),
WGL_BACK_RIGHT_ARB = ((int)0x2086),
WGL_BIND_TO_TEXTURE_RGB_ARB = ((int)0x2070),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = ((int)0x207F),
WGL_MIPMAP_TEXTURE_ARB = ((int)0x2074),
WGL_CUBE_MAP_FACE_ARB = ((int)0x207C),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = ((int)0x2080),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = ((int)0x2082),
WGL_AUX7_ARB = ((int)0x208E),
WGL_TEXTURE_RGBA_ARB = ((int)0x2076),
WGL_AUX2_ARB = ((int)0x2089),
WGL_TEXTURE_2D_ARB = ((int)0x207A),
WGL_AUX0_ARB = ((int)0x2087),
WGL_AUX9_ARB = ((int)0x2090),
WGL_FRONT_LEFT_ARB = ((int)0x2083),
WGL_MIPMAP_LEVEL_ARB = ((int)0x207B),
WGL_AUX8_ARB = ((int)0x208F),
WGL_FRONT_RIGHT_ARB = ((int)0x2084),
WGL_AUX6_ARB = ((int)0x208D),
WGL_AUX5_ARB = ((int)0x208C),
WGL_AUX1_ARB = ((int)0x2088),
WGL_NO_TEXTURE_ARB = ((int)0x2077),
WGL_BACK_RIGHT_ARB = ((int)0x2086),
WGL_AUX4_ARB = ((int)0x208B),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = ((int)0x2081),
WGL_TEXTURE_FORMAT_ARB = ((int)0x2072),
WGL_TEXTURE_TARGET_ARB = ((int)0x2073),
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = ((int)0x207D),
WGL_TEXTURE_CUBE_MAP_ARB = ((int)0x2078),
WGL_MIPMAP_TEXTURE_ARB = ((int)0x2074),
}
public enum WGL_NV_render_texture_rectangle
{
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = ((int)0x20A1),
WGL_TEXTURE_RECTANGLE_NV = ((int)0x20A2),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = ((int)0x20A0),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = ((int)0x20A1),
}
public enum WGL_NV_render_depth_texture
{
WGL_DEPTH_TEXTURE_FORMAT_NV = ((int)0x20A5),
WGL_BIND_TO_TEXTURE_DEPTH_NV = ((int)0x20A3),
WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = ((int)0x20A4),
WGL_DEPTH_TEXTURE_FORMAT_NV = ((int)0x20A5),
WGL_TEXTURE_DEPTH_COMPONENT_NV = ((int)0x20A6),
WGL_BIND_TO_TEXTURE_DEPTH_NV = ((int)0x20A3),
WGL_DEPTH_COMPONENT_NV = ((int)0x20A7),
}
public enum WGL_NV_float_buffer
{
WGL_TEXTURE_FLOAT_R_NV = ((int)0x20B5),
WGL_TEXTURE_FLOAT_RG_NV = ((int)0x20B6),
WGL_FLOAT_COMPONENTS_NV = ((int)0x20B0),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = ((int)0x20B4),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = ((int)0x20B1),
WGL_TEXTURE_FLOAT_RGB_NV = ((int)0x20B7),
WGL_TEXTURE_FLOAT_RGBA_NV = ((int)0x20B8),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = ((int)0x20B2),
WGL_TEXTURE_FLOAT_R_NV = ((int)0x20B5),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = ((int)0x20B4),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = ((int)0x20B3),
WGL_TEXTURE_FLOAT_RGB_NV = ((int)0x20B7),
WGL_FLOAT_COMPONENTS_NV = ((int)0x20B0),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = ((int)0x20B1),
WGL_TEXTURE_FLOAT_RGBA_NV = ((int)0x20B8),
}
public enum WGL_ARB_pixel_format_float
@ -290,200 +290,200 @@ namespace OpenTK.OpenGL
public enum All
{
WGL_ALPHA_SHIFT_ARB = ((int)0x201C),
WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = ((int)0x2045),
WGL_BLUE_BITS_EXT = ((int)0x2019),
WGL_MIPMAP_TEXTURE_ARB = ((int)0x2074),
WGL_SWAP_METHOD_EXT = ((int)0x2007),
WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D = ((int)0x2046),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = ((int)0x2050),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = ((int)0x207F),
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = ((int)0x204C),
WGL_AUX8_ARB = ((int)0x208F),
WGL_TEXTURE_TARGET_ARB = ((int)0x2073),
WGL_AUX0_ARB = ((int)0x2087),
ERROR_INVALID_PIXEL_TYPE_EXT = ((int)0x2043),
WGL_AUX_BUFFERS_EXT = ((int)0x2024),
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = ((int)0x204A),
WGL_MAX_PBUFFER_HEIGHT_EXT = ((int)0x2030),
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = ((int)0x204B),
WGL_BLUE_SHIFT_ARB = ((int)0x201A),
WGL_SWAP_UNDEFINED_ARB = ((int)0x202A),
WGL_SWAP_EXCHANGE_ARB = ((int)0x2028),
WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = ((int)0x20A4),
WGL_AUX6_ARB = ((int)0x208D),
WGL_TEXTURE_RECTANGLE_NV = ((int)0x20A2),
WGL_SUPPORT_GDI_EXT = ((int)0x200F),
WGL_DEPTH_BITS_EXT = ((int)0x2022),
WGL_AUX2_ARB = ((int)0x2089),
WGL_DOUBLE_BUFFER_EXT = ((int)0x2011),
WGL_PBUFFER_WIDTH_EXT = ((int)0x2034),
WGL_SHARE_DEPTH_EXT = ((int)0x200C),
WGL_SWAP_UNDEFINED_EXT = ((int)0x202A),
WGL_AUX9_ARB = ((int)0x2090),
WGL_TYPE_RGBA_FLOAT_ARB = ((int)0x21A0),
WGL_SAMPLE_BUFFERS_ARB = ((int)0x2041),
WGL_NUMBER_OVERLAYS_EXT = ((int)0x2008),
WGL_PIXEL_TYPE_EXT = ((int)0x2013),
WGL_BACK_LEFT_ARB = ((int)0x2085),
WGL_TEXTURE_2D_ARB = ((int)0x207A),
WGL_CUBE_MAP_FACE_ARB = ((int)0x207C),
WGL_FRONT_COLOR_BUFFER_BIT_ARB = ((int)0x00000001),
WGL_MAX_PBUFFER_WIDTH_EXT = ((int)0x202F),
WGL_RED_BITS_EXT = ((int)0x2015),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_NO_TEXTURE_ARB = ((int)0x2077),
WGL_SWAP_METHOD_ARB = ((int)0x2007),
WGL_STENCIL_BUFFER_BIT_ARB = ((int)0x00000008),
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = ((int)0x2048),
WGL_SAMPLES_ARB = ((int)0x2042),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_BACK_RIGHT_ARB = ((int)0x2086),
WGL_ALPHA_BITS_ARB = ((int)0x201B),
WGL_TRANSPARENT_VALUE_EXT = ((int)0x200B),
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = ((int)0x2031),
WGL_NUMBER_OVERLAYS_ARB = ((int)0x2008),
WGL_SUPPORT_OPENGL_EXT = ((int)0x2010),
WGL_DRAW_TO_BITMAP_EXT = ((int)0x2002),
WGL_BLUE_SHIFT_EXT = ((int)0x201A),
WGL_SHARE_STENCIL_EXT = ((int)0x200D),
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_TEXTURE_DEPTH_COMPONENT_NV = ((int)0x20A6),
WGL_PBUFFER_LARGEST_EXT = ((int)0x2033),
WGL_ACCUM_GREEN_BITS_ARB = ((int)0x201F),
WGL_MIPMAP_LEVEL_ARB = ((int)0x207B),
WGL_PIXEL_TYPE_ARB = ((int)0x2013),
WGL_GREEN_SHIFT_ARB = ((int)0x2018),
WGL_DRAW_TO_WINDOW_EXT = ((int)0x2001),
WGL_RED_BITS_ARB = ((int)0x2015),
WGL_ACCUM_RED_BITS_EXT = ((int)0x201E),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = ((int)0x2080),
WGL_DEPTH_COMPONENT_NV = ((int)0x20A7),
WGL_PBUFFER_LARGEST_ARB = ((int)0x2033),
WGL_STEREO_EXT = ((int)0x2012),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = ((int)0x207E),
WGL_GREEN_BITS_EXT = ((int)0x2017),
WGL_NEED_PALETTE_EXT = ((int)0x2004),
WGL_GREEN_SHIFT_EXT = ((int)0x2018),
WGL_ACCUM_BITS_ARB = ((int)0x201D),
WGL_DRAW_TO_WINDOW_ARB = ((int)0x2001),
WGL_SHARE_DEPTH_ARB = ((int)0x200C),
WGL_DOUBLE_BUFFER_ARB = ((int)0x2011),
WGL_DEPTH_FLOAT_EXT = ((int)0x2040),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
WGL_FULL_ACCELERATION_ARB = ((int)0x2027),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = ((int)0x2081),
WGL_RED_SHIFT_ARB = ((int)0x2016),
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = ((int)0x2044),
WGL_FULL_ACCELERATION_EXT = ((int)0x2027),
WGL_SWAP_COPY_ARB = ((int)0x2029),
WGL_AUX1_ARB = ((int)0x2088),
WGL_ACCELERATION_EXT = ((int)0x2003),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = ((int)0x2082),
WGL_IMAGE_BUFFER_LOCK_I3D = ((int)0x00000002),
WGL_GENERIC_ACCELERATION_EXT = ((int)0x2026),
WGL_ACCUM_RED_BITS_ARB = ((int)0x201E),
WGL_GREEN_BITS_ARB = ((int)0x2017),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = ((int)0x20B4),
WGL_AUX7_ARB = ((int)0x208E),
WGL_SHARE_STENCIL_ARB = ((int)0x200D),
WGL_AUX3_ARB = ((int)0x208A),
WGL_BLUE_BITS_ARB = ((int)0x2019),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_ACCELERATION_ARB = ((int)0x2003),
WGL_SAMPLES_3DFX = ((int)0x2061),
WGL_TEXTURE_CUBE_MAP_ARB = ((int)0x2078),
WGL_TYPE_COLORINDEX_EXT = ((int)0x202C),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = ((int)0x20B2),
WGL_BIND_TO_TEXTURE_RGBA_ARB = ((int)0x2071),
WGL_TYPE_RGBA_FLOAT_ATI = ((int)0x21A0),
WGL_SAMPLES_EXT = ((int)0x2042),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = ((int)0x20A1),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = ((int)0x20B3),
WGL_COLOR_BITS_ARB = ((int)0x2014),
WGL_SUPPORT_GDI_ARB = ((int)0x200F),
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = ((int)0x2049),
WGL_TEXTURE_FLOAT_R_NV = ((int)0x20B5),
WGL_ACCUM_BLUE_BITS_EXT = ((int)0x2020),
WGL_SAMPLE_BUFFERS_EXT = ((int)0x2041),
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = ((int)0x2052),
WGL_TEXTURE_RGB_ARB = ((int)0x2075),
WGL_ACCUM_GREEN_BITS_EXT = ((int)0x201F),
WGL_TEXTURE_FLOAT_RG_NV = ((int)0x20B6),
WGL_GENERIC_ACCELERATION_ARB = ((int)0x2026),
WGL_TEXTURE_RGBA_ARB = ((int)0x2076),
WGL_NEED_PALETTE_ARB = ((int)0x2004),
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = ((int)0x2032),
WGL_BACK_COLOR_BUFFER_BIT_ARB = ((int)0x00000002),
WGL_BIND_TO_TEXTURE_DEPTH_NV = ((int)0x20A3),
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = ((int)0x2053),
WGL_ACCUM_BITS_EXT = ((int)0x201D),
ERROR_INVALID_PIXEL_TYPE_ARB = ((int)0x2043),
WGL_PBUFFER_HEIGHT_EXT = ((int)0x2035),
WGL_DRAW_TO_BITMAP_ARB = ((int)0x2002),
WGL_TYPE_RGBA_EXT = ((int)0x202B),
WGL_TEXTURE_FORMAT_ARB = ((int)0x2072),
WGL_TRANSPARENT_ARB = ((int)0x200A),
WGL_COLOR_BITS_EXT = ((int)0x2014),
WGL_FLOAT_COMPONENTS_NV = ((int)0x20B0),
WGL_ACCUM_BLUE_BITS_ARB = ((int)0x2020),
WGL_TYPE_RGBA_ARB = ((int)0x202B),
WGL_SWAP_LAYER_BUFFERS_EXT = ((int)0x2006),
WGL_ALPHA_BITS_EXT = ((int)0x201B),
WGL_SWAP_EXCHANGE_EXT = ((int)0x2028),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = ((int)0x2051),
WGL_SHARE_ACCUM_ARB = ((int)0x200E),
WGL_MAX_PBUFFER_PIXELS_EXT = ((int)0x202E),
WGL_TEXTURE_FLOAT_RGB_NV = ((int)0x20B7),
WGL_PBUFFER_HEIGHT_ARB = ((int)0x2035),
WGL_ACCUM_ALPHA_BITS_ARB = ((int)0x2021),
WGL_DEPTH_BUFFER_BIT_ARB = ((int)0x00000004),
WGL_NUMBER_UNDERLAYS_ARB = ((int)0x2009),
WGL_SWAP_LAYER_BUFFERS_ARB = ((int)0x2006),
WGL_SHARE_ACCUM_EXT = ((int)0x200E),
WGL_PBUFFER_LOST_ARB = ((int)0x2036),
WGL_AUX5_ARB = ((int)0x208C),
WGL_GAMMA_TABLE_SIZE_I3D = ((int)0x204E),
WGL_NO_ACCELERATION_ARB = ((int)0x2025),
WGL_MIPMAP_TEXTURE_ARB = ((int)0x2074),
WGL_AUX4_ARB = ((int)0x208B),
WGL_TEXTURE_1D_ARB = ((int)0x2079),
WGL_NEED_SYSTEM_PALETTE_EXT = ((int)0x2005),
WGL_NUMBER_PIXEL_FORMATS_EXT = ((int)0x2000),
WGL_FRONT_LEFT_ARB = ((int)0x2083),
WGL_DRAW_TO_PBUFFER_EXT = ((int)0x202D),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = ((int)0x20A0),
WGL_ALPHA_SHIFT_EXT = ((int)0x201C),
WGL_ACCUM_ALPHA_BITS_EXT = ((int)0x2021),
WGL_SUPPORT_OPENGL_ARB = ((int)0x2010),
WGL_STENCIL_BITS_EXT = ((int)0x2023),
WGL_TYPE_COLORINDEX_ARB = ((int)0x202C),
WGL_SAMPLE_BUFFERS_3DFX = ((int)0x2060),
WGL_STEREO_ARB = ((int)0x2012),
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = ((int)0x2054),
WGL_AUX_BUFFERS_ARB = ((int)0x2024),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = ((int)0x20B1),
WGL_TRANSPARENT_EXT = ((int)0x200A),
WGL_NEED_SYSTEM_PALETTE_ARB = ((int)0x2005),
WGL_STENCIL_BITS_ARB = ((int)0x2023),
WGL_DEPTH_BITS_ARB = ((int)0x2022),
WGL_NUMBER_PIXEL_FORMATS_ARB = ((int)0x2000),
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = ((int)0x204F),
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_FRONT_RIGHT_ARB = ((int)0x2084),
WGL_RED_SHIFT_EXT = ((int)0x2016),
WGL_MAX_PBUFFER_PIXELS_ARB = ((int)0x202E),
WGL_NO_ACCELERATION_EXT = ((int)0x2025),
WGL_NUMBER_UNDERLAYS_EXT = ((int)0x2009),
WGL_DEPTH_TEXTURE_FORMAT_NV = ((int)0x20A5),
WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = ((int)0x2047),
WGL_SWAP_COPY_EXT = ((int)0x2029),
WGL_TEXTURE_FLOAT_RGBA_NV = ((int)0x20B8),
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = ((int)0x207D),
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = ((int)0x00000001),
WGL_SAMPLE_BUFFERS_EXT = ((int)0x2041),
WGL_BIND_TO_TEXTURE_RGB_ARB = ((int)0x2070),
WGL_AUX_BUFFERS_EXT = ((int)0x2024),
WGL_AUX0_ARB = ((int)0x2087),
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = ((int)0x204A),
WGL_ACCUM_ALPHA_BITS_EXT = ((int)0x2021),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = ((int)0x20B1),
WGL_IMAGE_BUFFER_LOCK_I3D = ((int)0x00000002),
WGL_BLUE_SHIFT_EXT = ((int)0x201A),
WGL_NEED_SYSTEM_PALETTE_EXT = ((int)0x2005),
WGL_SHARE_ACCUM_EXT = ((int)0x200E),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = ((int)0x207E),
WGL_DRAW_TO_PBUFFER_ARB = ((int)0x202D),
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = ((int)0x2053),
WGL_TEXTURE_CUBE_MAP_ARB = ((int)0x2078),
WGL_TYPE_RGBA_FLOAT_ARB = ((int)0x21A0),
WGL_FULL_ACCELERATION_EXT = ((int)0x2027),
WGL_ACCUM_GREEN_BITS_EXT = ((int)0x201F),
WGL_BACK_COLOR_BUFFER_BIT_ARB = ((int)0x00000002),
WGL_ACCUM_GREEN_BITS_ARB = ((int)0x201F),
WGL_MAX_PBUFFER_WIDTH_EXT = ((int)0x202F),
WGL_ACCUM_RED_BITS_EXT = ((int)0x201E),
WGL_AUX9_ARB = ((int)0x2090),
WGL_TRANSPARENT_EXT = ((int)0x200A),
WGL_ACCUM_ALPHA_BITS_ARB = ((int)0x2021),
WGL_GENERIC_ACCELERATION_EXT = ((int)0x2026),
WGL_AUX2_ARB = ((int)0x2089),
WGL_PIXEL_TYPE_EXT = ((int)0x2013),
WGL_NUMBER_PIXEL_FORMATS_EXT = ((int)0x2000),
WGL_ACCELERATION_ARB = ((int)0x2003),
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = ((int)0x00000001),
WGL_DOUBLE_BUFFER_EXT = ((int)0x2011),
WGL_NEED_PALETTE_EXT = ((int)0x2004),
WGL_TEXTURE_FLOAT_RG_NV = ((int)0x20B6),
WGL_DEPTH_FLOAT_EXT = ((int)0x2040),
WGL_BLUE_BITS_ARB = ((int)0x2019),
WGL_ACCUM_BITS_EXT = ((int)0x201D),
WGL_MAX_PBUFFER_WIDTH_ARB = ((int)0x202F),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = ((int)0x2080),
WGL_NUMBER_OVERLAYS_ARB = ((int)0x2008),
WGL_TEXTURE_RGB_ARB = ((int)0x2075),
WGL_SUPPORT_GDI_EXT = ((int)0x200F),
WGL_PBUFFER_HEIGHT_EXT = ((int)0x2035),
WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = ((int)0x20A4),
WGL_SAMPLE_BUFFERS_ARB = ((int)0x2041),
WGL_TRANSPARENT_ALPHA_VALUE_ARB = ((int)0x203A),
WGL_NEED_PALETTE_ARB = ((int)0x2004),
WGL_GREEN_SHIFT_ARB = ((int)0x2018),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = ((int)0x20A1),
WGL_TYPE_COLORINDEX_EXT = ((int)0x202C),
WGL_SHARE_STENCIL_ARB = ((int)0x200D),
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = ((int)0x2048),
WGL_SHARE_DEPTH_EXT = ((int)0x200C),
WGL_NO_ACCELERATION_EXT = ((int)0x2025),
WGL_BLUE_SHIFT_ARB = ((int)0x201A),
WGL_SUPPORT_GDI_ARB = ((int)0x200F),
WGL_NO_TEXTURE_ARB = ((int)0x2077),
WGL_TEXTURE_FLOAT_RGBA_NV = ((int)0x20B8),
WGL_DEPTH_TEXTURE_FORMAT_NV = ((int)0x20A5),
WGL_TRANSPARENT_BLUE_VALUE_ARB = ((int)0x2039),
WGL_DEPTH_BUFFER_BIT_ARB = ((int)0x00000004),
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = ((int)0x2082),
WGL_SWAP_EXCHANGE_ARB = ((int)0x2028),
WGL_TRANSPARENT_RED_VALUE_ARB = ((int)0x2037),
WGL_SWAP_COPY_ARB = ((int)0x2029),
WGL_GREEN_SHIFT_EXT = ((int)0x2018),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = ((int)0x2081),
WGL_TYPE_RGBA_EXT = ((int)0x202B),
WGL_TYPE_RGBA_FLOAT_ATI = ((int)0x21A0),
WGL_NUMBER_PIXEL_FORMATS_ARB = ((int)0x2000),
WGL_TEXTURE_RGBA_ARB = ((int)0x2076),
WGL_SWAP_COPY_EXT = ((int)0x2029),
WGL_NEED_SYSTEM_PALETTE_ARB = ((int)0x2005),
WGL_TEXTURE_FLOAT_RGB_NV = ((int)0x20B7),
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = ((int)0x2032),
WGL_SWAP_UNDEFINED_ARB = ((int)0x202A),
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = ((int)0x2049),
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = ((int)0x204B),
WGL_SWAP_LAYER_BUFFERS_EXT = ((int)0x2006),
WGL_SWAP_UNDEFINED_EXT = ((int)0x202A),
WGL_FULL_ACCELERATION_ARB = ((int)0x2027),
WGL_NUMBER_UNDERLAYS_ARB = ((int)0x2009),
WGL_BIND_TO_TEXTURE_RGBA_ARB = ((int)0x2071),
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
WGL_PIXEL_TYPE_ARB = ((int)0x2013),
WGL_NO_ACCELERATION_ARB = ((int)0x2025),
WGL_NUMBER_OVERLAYS_EXT = ((int)0x2008),
WGL_DEPTH_BITS_EXT = ((int)0x2022),
WGL_AUX3_ARB = ((int)0x208A),
WGL_DEPTH_BITS_ARB = ((int)0x2022),
WGL_GENERIC_ACCELERATION_ARB = ((int)0x2026),
WGL_TYPE_RGBA_ARB = ((int)0x202B),
WGL_DRAW_TO_WINDOW_EXT = ((int)0x2001),
WGL_TEXTURE_2D_ARB = ((int)0x207A),
WGL_STENCIL_BUFFER_BIT_ARB = ((int)0x00000008),
WGL_SWAP_EXCHANGE_EXT = ((int)0x2028),
WGL_SHARE_STENCIL_EXT = ((int)0x200D),
WGL_STEREO_ARB = ((int)0x2012),
WGL_SHARE_ACCUM_ARB = ((int)0x200E),
WGL_TEXTURE_RECTANGLE_NV = ((int)0x20A2),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = ((int)0x20B3),
WGL_STENCIL_BITS_EXT = ((int)0x2023),
WGL_MIPMAP_LEVEL_ARB = ((int)0x207B),
WGL_DRAW_TO_WINDOW_ARB = ((int)0x2001),
WGL_AUX5_ARB = ((int)0x208C),
WGL_DEPTH_COMPONENT_NV = ((int)0x20A7),
WGL_AUX1_ARB = ((int)0x2088),
WGL_TEXTURE_DEPTH_COMPONENT_NV = ((int)0x20A6),
WGL_FRONT_LEFT_ARB = ((int)0x2083),
WGL_MAX_PBUFFER_HEIGHT_EXT = ((int)0x2030),
WGL_RED_BITS_EXT = ((int)0x2015),
WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = ((int)0x2047),
WGL_RED_SHIFT_ARB = ((int)0x2016),
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = ((int)0x207F),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = ((int)0x2051),
WGL_TRANSPARENT_INDEX_VALUE_ARB = ((int)0x203B),
WGL_ALPHA_BITS_EXT = ((int)0x201B),
WGL_TRANSPARENT_VALUE_EXT = ((int)0x200B),
WGL_BIND_TO_TEXTURE_DEPTH_NV = ((int)0x20A3),
WGL_TEXTURE_1D_ARB = ((int)0x2079),
WGL_MAX_PBUFFER_PIXELS_ARB = ((int)0x202E),
WGL_SUPPORT_OPENGL_ARB = ((int)0x2010),
WGL_TEXTURE_TARGET_ARB = ((int)0x2073),
WGL_SAMPLE_BUFFERS_3DFX = ((int)0x2060),
WGL_TEXTURE_FLOAT_R_NV = ((int)0x20B5),
WGL_COLOR_BITS_EXT = ((int)0x2014),
WGL_BACK_RIGHT_ARB = ((int)0x2086),
WGL_PBUFFER_HEIGHT_ARB = ((int)0x2035),
WGL_ACCUM_BLUE_BITS_ARB = ((int)0x2020),
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = ((int)0x207D),
WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = ((int)0x2045),
WGL_SWAP_METHOD_ARB = ((int)0x2007),
WGL_AUX8_ARB = ((int)0x208F),
WGL_TYPE_COLORINDEX_ARB = ((int)0x202C),
WGL_DRAW_TO_PBUFFER_EXT = ((int)0x202D),
WGL_CUBE_MAP_FACE_ARB = ((int)0x207C),
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = ((int)0x204C),
WGL_SAMPLES_3DFX = ((int)0x2061),
WGL_MAX_PBUFFER_PIXELS_EXT = ((int)0x202E),
WGL_DOUBLE_BUFFER_ARB = ((int)0x2011),
WGL_STEREO_EXT = ((int)0x2012),
WGL_RED_SHIFT_EXT = ((int)0x2016),
WGL_ALPHA_BITS_ARB = ((int)0x201B),
WGL_COLOR_BITS_ARB = ((int)0x2014),
WGL_GAMMA_TABLE_SIZE_I3D = ((int)0x204E),
WGL_AUX_BUFFERS_ARB = ((int)0x2024),
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = ((int)0x2054),
WGL_FRONT_COLOR_BUFFER_BIT_ARB = ((int)0x00000001),
WGL_SAMPLES_EXT = ((int)0x2042),
WGL_ALPHA_SHIFT_EXT = ((int)0x201C),
WGL_ACCELERATION_EXT = ((int)0x2003),
WGL_AUX6_ARB = ((int)0x208D),
WGL_FRONT_RIGHT_ARB = ((int)0x2084),
WGL_PBUFFER_WIDTH_ARB = ((int)0x2034),
WGL_PBUFFER_LARGEST_ARB = ((int)0x2033),
WGL_NUMBER_UNDERLAYS_EXT = ((int)0x2009),
WGL_ACCUM_BITS_ARB = ((int)0x201D),
WGL_STENCIL_BITS_ARB = ((int)0x2023),
WGL_ACCUM_BLUE_BITS_EXT = ((int)0x2020),
WGL_MAX_PBUFFER_HEIGHT_ARB = ((int)0x2030),
WGL_TEXTURE_FORMAT_ARB = ((int)0x2072),
WGL_ACCUM_RED_BITS_ARB = ((int)0x201E),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = ((int)0x20B4),
WGL_FLOAT_COMPONENTS_NV = ((int)0x20B0),
WGL_TRANSPARENT_ARB = ((int)0x200A),
WGL_RED_BITS_ARB = ((int)0x2015),
WGL_GREEN_BITS_ARB = ((int)0x2017),
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = ((int)0x2044),
WGL_BLUE_BITS_EXT = ((int)0x2019),
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = ((int)0x20B2),
WGL_GREEN_BITS_EXT = ((int)0x2017),
WGL_SHARE_DEPTH_ARB = ((int)0x200C),
WGL_ALPHA_SHIFT_ARB = ((int)0x201C),
WGL_PBUFFER_WIDTH_EXT = ((int)0x2034),
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = ((int)0x20A0),
WGL_SWAP_LAYER_BUFFERS_ARB = ((int)0x2006),
ERROR_INVALID_PIXEL_TYPE_ARB = ((int)0x2043),
WGL_AUX7_ARB = ((int)0x208E),
WGL_PBUFFER_LOST_ARB = ((int)0x2036),
ERROR_INVALID_PIXEL_TYPE_EXT = ((int)0x2043),
WGL_SAMPLES_ARB = ((int)0x2042),
WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D = ((int)0x2046),
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = ((int)0x204F),
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = ((int)0x2052),
WGL_PBUFFER_LARGEST_EXT = ((int)0x2033),
WGL_DRAW_TO_BITMAP_EXT = ((int)0x2002),
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = ((int)0x2050),
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = ((int)0x2031),
WGL_DRAW_TO_BITMAP_ARB = ((int)0x2002),
WGL_BACK_LEFT_ARB = ((int)0x2085),
WGL_SUPPORT_OPENGL_EXT = ((int)0x2010),
}
public enum WGL_ARB_extensions_string

View file

@ -1,304 +0,0 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* Contributions from Erik Ylvisaker
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace OpenTK.Platform.Windows
{
/// <summary>
/// Provides access to WGL functions.
/// </summary>
internal static class Wgl
{
// Disable BeforeFieldInit optimization.
static Wgl() { }
const string _dll_name = "OPENGL32.DLL";
/// <summary>
/// Contains all WGL constants.
/// </summary>
public class Constant
{
#region WGL constants
public const int WGLEXT_VERSION = 4;
public const int FRONT_COLOR_BUFFER_BIT_ARB = 0x00000001;
public const int BACK_COLOR_BUFFER_BIT_ARB = 0x00000002;
public const int DEPTH_BUFFER_BIT_ARB = 0x00000004;
public const int STENCIL_BUFFER_BIT_ARB = 0x00000008;
public const int SAMPLE_BUFFERS_ARB = 0x2041;
public const int SAMPLES_ARB = 0x2042;
public const int NUMBER_PIXEL_FORMATS_ARB = 0x2000;
public const int DRAW_TO_WINDOW_ARB = 0x2001;
public const int DRAW_TO_BITMAP_ARB = 0x2002;
public const int ACCELERATION_ARB = 0x2003;
public const int NEED_PALETTE_ARB = 0x2004;
public const int NEED_SYSTEM_PALETTE_ARB = 0x2005;
public const int SWAP_LAYER_BUFFERS_ARB = 0x2006;
public const int SWAP_METHOD_ARB = 0x2007;
public const int NUMBER_OVERLAYS_ARB = 0x2008;
public const int NUMBER_UNDERLAYS_ARB = 0x2009;
public const int TRANSPARENT_ARB = 0x200A;
public const int TRANSPARENT_RED_VALUE_ARB = 0x2037;
public const int TRANSPARENT_GREEN_VALUE_ARB = 0x2038;
public const int TRANSPARENT_BLUE_VALUE_ARB = 0x2039;
public const int TRANSPARENT_ALPHA_VALUE_ARB = 0x203A;
public const int TRANSPARENT_INDEX_VALUE_ARB = 0x203B;
public const int SHARE_DEPTH_ARB = 0x200C;
public const int SHARE_STENCIL_ARB = 0x200D;
public const int SHARE_ACCUM_ARB = 0x200E;
public const int SUPPORT_GDI_ARB = 0x200F;
public const int SUPPORT_OPENGL_ARB = 0x2010;
public const int DOUBLE_BUFFER_ARB = 0x2011;
public const int STEREO_ARB = 0x2012;
public const int PIXEL_TYPE_ARB = 0x2013;
public const int COLOR_BITS_ARB = 0x2014;
public const int RED_BITS_ARB = 0x2015;
public const int RED_SHIFT_ARB = 0x2016;
public const int GREEN_BITS_ARB = 0x2017;
public const int GREEN_SHIFT_ARB = 0x2018;
public const int BLUE_BITS_ARB = 0x2019;
public const int BLUE_SHIFT_ARB = 0x201A;
public const int ALPHA_BITS_ARB = 0x201B;
public const int ALPHA_SHIFT_ARB = 0x201C;
public const int ACCUM_BITS_ARB = 0x201D;
public const int ACCUM_RED_BITS_ARB = 0x201E;
public const int ACCUM_GREEN_BITS_ARB = 0x201F;
public const int ACCUM_BLUE_BITS_ARB = 0x2020;
public const int ACCUM_ALPHA_BITS_ARB = 0x2021;
public const int DEPTH_BITS_ARB = 0x2022;
public const int STENCIL_BITS_ARB = 0x2023;
public const int AUX_BUFFERS_ARB = 0x2024;
public const int NO_ACCELERATION_ARB = 0x2025;
public const int GENERIC_ACCELERATION_ARB = 0x2026;
public const int FULL_ACCELERATION_ARB = 0x2027;
public const int SWAP_EXCHANGE_ARB = 0x2028;
public const int SWAP_COPY_ARB = 0x2029;
public const int SWAP_UNDEFINED_ARB = 0x202A;
public const int TYPE_RGBA_ARB = 0x202B;
public const int TYPE_COLORINDEX_ARB = 0x202C;
public const int ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043;
public const int ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054;
public const int DRAW_TO_PBUFFER_ARB = 0x202D;
public const int MAX_PBUFFER_PIXELS_ARB = 0x202E;
public const int MAX_PBUFFER_WIDTH_ARB = 0x202F;
public const int MAX_PBUFFER_HEIGHT_ARB = 0x2030;
public const int PBUFFER_LARGEST_ARB = 0x2033;
public const int PBUFFER_WIDTH_ARB = 0x2034;
public const int PBUFFER_HEIGHT_ARB = 0x2035;
public const int PBUFFER_LOST_ARB = 0x2036;
public const int BIND_TO_TEXTURE_RGB_ARB = 0x2070;
public const int BIND_TO_TEXTURE_RGBA_ARB = 0x2071;
public const int TEXTURE_FORMAT_ARB = 0x2072;
public const int TEXTURE_TARGET_ARB = 0x2073;
public const int MIPMAP_TEXTURE_ARB = 0x2074;
public const int TEXTURE_RGB_ARB = 0x2075;
public const int TEXTURE_RGBA_ARB = 0x2076;
public const int NO_TEXTURE_ARB = 0x2077;
public const int TEXTURE_CUBE_MAP_ARB = 0x2078;
public const int TEXTURE_1D_ARB = 0x2079;
public const int TEXTURE_2D_ARB = 0x207A;
public const int MIPMAP_LEVEL_ARB = 0x207B;
public const int CUBE_MAP_FACE_ARB = 0x207C;
public const int TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D;
public const int TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E;
public const int TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F;
public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080;
public const int TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081;
public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082;
public const int FRONT_LEFT_ARB = 0x2083;
public const int FRONT_RIGHT_ARB = 0x2084;
public const int BACK_LEFT_ARB = 0x2085;
public const int BACK_RIGHT_ARB = 0x2086;
public const int AUX0_ARB = 0x2087;
public const int AUX1_ARB = 0x2088;
public const int AUX2_ARB = 0x2089;
public const int AUX3_ARB = 0x208A;
public const int AUX4_ARB = 0x208B;
public const int AUX5_ARB = 0x208C;
public const int AUX6_ARB = 0x208D;
public const int AUX7_ARB = 0x208E;
public const int AUX8_ARB = 0x208F;
public const int AUX9_ARB = 0x2090;
public const int ERROR_INVALID_PIXEL_TYPE_EXT = 0x2043;
public const int NUMBER_PIXEL_FORMATS_EXT = 0x2000;
public const int DRAW_TO_WINDOW_EXT = 0x2001;
public const int DRAW_TO_BITMAP_EXT = 0x2002;
public const int ACCELERATION_EXT = 0x2003;
public const int NEED_PALETTE_EXT = 0x2004;
public const int NEED_SYSTEM_PALETTE_EXT = 0x2005;
public const int SWAP_LAYER_BUFFERS_EXT = 0x2006;
public const int SWAP_METHOD_EXT = 0x2007;
public const int NUMBER_OVERLAYS_EXT = 0x2008;
public const int NUMBER_UNDERLAYS_EXT = 0x2009;
public const int TRANSPARENT_EXT = 0x200A;
public const int TRANSPARENT_VALUE_EXT = 0x200B;
public const int SHARE_DEPTH_EXT = 0x200C;
public const int SHARE_STENCIL_EXT = 0x200D;
public const int SHARE_ACCUM_EXT = 0x200E;
public const int SUPPORT_GDI_EXT = 0x200F;
public const int SUPPORT_OPENGL_EXT = 0x2010;
public const int DOUBLE_BUFFER_EXT = 0x2011;
public const int STEREO_EXT = 0x2012;
public const int PIXEL_TYPE_EXT = 0x2013;
public const int COLOR_BITS_EXT = 0x2014;
public const int RED_BITS_EXT = 0x2015;
public const int RED_SHIFT_EXT = 0x2016;
public const int GREEN_BITS_EXT = 0x2017;
public const int GREEN_SHIFT_EXT = 0x2018;
public const int BLUE_BITS_EXT = 0x2019;
public const int BLUE_SHIFT_EXT = 0x201A;
public const int ALPHA_BITS_EXT = 0x201B;
public const int ALPHA_SHIFT_EXT = 0x201C;
public const int ACCUM_BITS_EXT = 0x201D;
public const int ACCUM_RED_BITS_EXT = 0x201E;
public const int ACCUM_GREEN_BITS_EXT = 0x201F;
public const int ACCUM_BLUE_BITS_EXT = 0x2020;
public const int ACCUM_ALPHA_BITS_EXT = 0x2021;
public const int DEPTH_BITS_EXT = 0x2022;
public const int STENCIL_BITS_EXT = 0x2023;
public const int AUX_BUFFERS_EXT = 0x2024;
public const int NO_ACCELERATION_EXT = 0x2025;
public const int GENERIC_ACCELERATION_EXT = 0x2026;
public const int FULL_ACCELERATION_EXT = 0x2027;
public const int SWAP_EXCHANGE_EXT = 0x2028;
public const int SWAP_COPY_EXT = 0x2029;
public const int SWAP_UNDEFINED_EXT = 0x202A;
public const int TYPE_RGBA_EXT = 0x202B;
public const int TYPE_COLORINDEX_EXT = 0x202C;
public const int DRAW_TO_PBUFFER_EXT = 0x202D;
public const int MAX_PBUFFER_PIXELS_EXT = 0x202E;
public const int MAX_PBUFFER_WIDTH_EXT = 0x202F;
public const int MAX_PBUFFER_HEIGHT_EXT = 0x2030;
public const int OPTIMAL_PBUFFER_WIDTH_EXT = 0x2031;
public const int OPTIMAL_PBUFFER_HEIGHT_EXT = 0x2032;
public const int PBUFFER_LARGEST_EXT = 0x2033;
public const int PBUFFER_WIDTH_EXT = 0x2034;
public const int PBUFFER_HEIGHT_EXT = 0x2035;
public const int DEPTH_FLOAT_EXT = 0x2040;
public const int SAMPLE_BUFFERS_3DFX = 0x2060;
public const int SAMPLES_3DFX = 0x2061;
public const int SAMPLE_BUFFERS_EXT = 0x2041;
public const int SAMPLES_EXT = 0x2042;
public const int DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = 0x2051;
public const int DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = 0x2052;
public const int DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = 0x2053;
public const int GAMMA_TABLE_SIZE_I3D = 0x204E;
public const int GAMMA_EXCLUDE_DESKTOP_I3D = 0x204F;
public const int GENLOCK_SOURCE_MULTIVIEW_I3D = 0x2044;
public const int GENLOCK_SOURCE_EXTENAL_SYNC_I3D = 0x2045;
public const int GENLOCK_SOURCE_EXTENAL_FIELD_I3D = 0x2046;
public const int GENLOCK_SOURCE_EXTENAL_TTL_I3D = 0x2047;
public const int GENLOCK_SOURCE_DIGITAL_SYNC_I3D = 0x2048;
public const int GENLOCK_SOURCE_DIGITAL_FIELD_I3D = 0x2049;
public const int GENLOCK_SOURCE_EDGE_FALLING_I3D = 0x204A;
public const int GENLOCK_SOURCE_EDGE_RISING_I3D = 0x204B;
public const int GENLOCK_SOURCE_EDGE_BOTH_I3D = 0x204C;
public const int IMAGE_BUFFER_MIN_ACCESS_I3D = 0x00000001;
public const int IMAGE_BUFFER_LOCK_I3D = 0x00000002;
public const int BIND_TO_TEXTURE_DEPTH_NV = 0x20A3;
public const int BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4;
public const int DEPTH_TEXTURE_FORMAT_NV = 0x20A5;
public const int TEXTURE_DEPTH_COMPONENT_NV = 0x20A6;
public const int DEPTH_COMPONENT_NV = 0x20A7;
public const int BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0;
public const int BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1;
public const int TEXTURE_RECTANGLE_NV = 0x20A2;
public const int FLOAT_COMPONENTS_NV = 0x20B0;
public const int TEXTURE_FLOAT_R_NV = 0x20B5;
public const int TEXTURE_FLOAT_RG_NV = 0x20B6;
public const int TEXTURE_FLOAT_RGB_NV = 0x20B7;
public const int TEXTURE_FLOAT_RGBA_NV = 0x20B8;
#endregion
}
#region WGL functions
[DllImport(_dll_name)]
public static extern IntPtr GetProcAddress(IntPtr hwnd);
[DllImport(_dll_name, EntryPoint = "wglGetProcAddress", SetLastError=true)]
public static extern IntPtr GetProcAddress(string funcname);
#region public static extern IntPtr CreateContext(IntPtr dc);
[DllImport(_dll_name, EntryPoint = "wglCreateContext")]
public static extern IntPtr CreateContext(IntPtr dc);
#endregion
#region public static extern bool MakeCurrent(IntPtr dc, IntPtr rc)
/// <summary>
/// The wglMakeCurrent function makes a specified OpenGL rendering context the calling thread's current rendering context.
/// All subsequent OpenGL calls made by the thread are drawn on the device identified by hdc.
/// You can also use wglMakeCurrent to change the calling thread's current rendering context so it's no longer current.
/// </summary>
/// <param name="dc">Device context of device that OpenGL calls are to be drawn on</param>
/// <param name="rc">OpenGL rendering context to be made the calling thread's current rendering context</param>
/// <returns>
/// When the wglMakeCurrent function succeeds, the return value is TRUE; otherwise the return value is FALSE.
/// To get extended error information, call GetLastError.
/// </returns>
/// <remarks>
/// <para>
/// The hdc parameter must refer to a drawing surface supported by OpenGL. It need not be the same hdc
/// that was passed to wglCreateContext when hglrc was created, but it must be on the same device and have
/// the same pixel format. GDI transformation and clipping in hdc are not supported by the rendering context.
/// The current rendering context uses the hdc device context until the rendering context is no longer current.
/// </para>
/// <para>
/// Before switching to the new rendering context, OpenGL flushes any previous rendering context
/// that was current to the calling thread.
/// </para>
/// <para>
/// A thread can have one current rendering context. A process can have multiple rendering contexts
/// by means of multithreading. A thread must set a current rendering context before calling any OpenGL functions.
/// Otherwise, all OpenGL calls are ignored.
/// </para>
/// <para>
/// A rendering context can be current to only one thread at a time. You cannot make a rendering context current
/// to multiple threads.
/// </para>
/// <para>
/// An application can perform multithread drawing by making different rendering contexts current
/// to different threads, supplying each thread with its own rendering context and device context.
/// </para>
/// <para>
/// If an error occurs, the wglMakeCurrent function makes the thread's current rendering context not current
/// before returning.
/// </para>
/// </remarks>
[DllImport(_dll_name, EntryPoint = "wglMakeCurrent")]
[System.Security.SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool MakeCurrent(IntPtr dc, IntPtr rc);
#endregion
[DllImport(_dll_name, EntryPoint = "wglDeleteContext", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteContext(IntPtr rc);
[DllImport(_dll_name, EntryPoint = "wglGetCurrentContext")]
public static extern IntPtr GetCurrentContext();
[DllImport(_dll_name, EntryPoint = "wglGetCurrentDC")]
public static extern IntPtr GetCurrentDC();
[DllImport(_dll_name, EntryPoint = "wglShareLists")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ShareLists(IntPtr r1, IntPtr r2);
#endregion
}
}

View file

@ -0,0 +1,107 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*
* Date: 12/8/2007
* Time: 6:43 μμ
*/
#endregion
using System;
using System.Runtime.InteropServices;
using System.Reflection;
namespace OpenTK.Platform.Windows
{
/// <summary>
///
/// </summary>
public partial class Wgl
{
#region --- Constructors ---
static Wgl()
{
assembly = Assembly.GetExecutingAssembly();
wglClass = assembly.GetType("OpenTK.Platform.Windows.Wgl");
delegatesClass = wglClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic);
importsClass = wglClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic);
//LoadAll();
}
#endregion
#region --- Fields ---
internal const string Library = "OPENGL32.DLL";
private static Assembly assembly;
private static Type wglClass;
private static Type delegatesClass;
private static Type importsClass;
#endregion
#region public static Delegate GetDelegate(string name, Type signature)
/// <summary>
/// Creates a System.Delegate that can be used to call an OpenGL function, core or extension.
/// </summary>
/// <param name="name">The name of the Wgl function (eg. "wglNewList")</param>
/// <param name="signature">The signature of the OpenGL function.</param>
/// <returns>
/// A System.Delegate that can be used to call this OpenGL function, or null if the specified
/// function name did not correspond to an OpenGL function.
/// </returns>
public static Delegate GetDelegate(string name, Type signature)
{
Delegate d;
string realName = name.StartsWith("wgl") ? name.Substring(3) : name;
if (importsClass.GetMethod(realName,
BindingFlags.NonPublic | BindingFlags.Static) != null)
{
d = Utilities.GetExtensionDelegate(name, signature) ??
Delegate.CreateDelegate(signature, typeof(Imports), realName);
}
else
{
d = Utilities.GetExtensionDelegate(name, signature);
}
return d;
}
#endregion
/// <summary>
/// Loads all Wgl entry points, core and extensions.
/// </summary>
public static void LoadAll()
{
FieldInfo[] v = delegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
foreach (FieldInfo f in v)
{
f.SetValue(null, GetDelegate(f.Name, f.FieldType));
}
}
/// <summary>
/// Loads the given Wgl entry point.
/// </summary>
/// <param name="function">The name of the function to load.</param>
/// <returns></returns>
public static bool Load(string function)
{
FieldInfo f = delegatesClass.GetField(function);
if (f == null)
return false;
f.SetValue(null, GetDelegate(f.Name, f.FieldType));
return f.GetValue(null) != null;
}
}
}

View file

@ -43,8 +43,6 @@ namespace OpenTK.Platform.Windows
PrepareContext(mode);
CreateContext();
Trace.Unindent();
}
@ -53,10 +51,15 @@ namespace OpenTK.Platform.Windows
public void CreateContext()
{
Trace.Write("Creating render context... ");
renderContext = Wgl.CreateContext(deviceContext);
// Do not rely on OpenTK.Platform.Windows.Wgl - the context is not ready yet,
// and Wgl extensions will fail to load.
//renderContext = Wgl.CreateContext(deviceContext);
renderContext = Wgl.Imports.CreateContext(deviceContext);
Trace.WriteLine(String.Format("done! (id: {0})", renderContext));
Wgl.Imports.MakeCurrent(deviceContext, renderContext);
Wgl.LoadAll();
}
public void PrepareContext(DisplayMode mode)
{
// Dynamically load the OpenGL32.dll in order to use the extension loading capabilities of Wgl.

View file

@ -26,13 +26,15 @@ namespace OpenTK.Platform.Windows
private Message msg; // Used only by the IsIdle event.
#region --- Constructors ---
public WinGLControl(Control c, DisplayMode mode)
{
glContext = new WinGLContext(c.Handle, mode);
glContext.CreateContext();
}
[Obsolete]
[Obsolete("Use WinGLControl(Control c, DisplayMode mode) instead")]
public WinGLControl(Control c, int width, int height, bool fullscreen)
{
glContext = new WinGLContext(
@ -47,6 +49,11 @@ namespace OpenTK.Platform.Windows
0.0f
)
);
glContext.CreateContext();
glContext.MakeCurrent();
OpenTK.OpenGL.GL.LoadAll();
}
#endregion

View file

@ -271,7 +271,9 @@ namespace OpenTK.Platform.Windows
)
);
glContext.MakeCurrent();
glContext.CreateContext();
OpenTK.OpenGL.GL.LoadAll();
if (this.Create != null)
{

View file

@ -42,13 +42,8 @@ namespace OpenTK.Platform.X11
/// <summary>
/// Provides access to GLX functions.
/// </summary>
internal static class Glx
public static partial class Glx
{
// Disable BeforeFieldInit optimization.
static Glx() { }
const string _dll_name = "libGL.so.1";
#region Enums
public struct Enums
@ -269,7 +264,7 @@ namespace OpenTK.Platform.X11
#region GLX functions
[DllImport(_dll_name, EntryPoint = "glXCreateContext")]
[DllImport(Library, EntryPoint = "glXCreateContext")]
internal static extern IntPtr CreateContext(IntPtr dpy, IntPtr vis, IntPtr shareList, bool direct);
internal static IntPtr CreateContext(IntPtr dpy, VisualInfo vis, IntPtr shareList, bool direct)
@ -286,31 +281,31 @@ namespace OpenTK.Platform.X11
}
}
[DllImport(_dll_name, EntryPoint = "glXDestroyContext")]
[DllImport(Library, EntryPoint = "glXDestroyContext")]
public static extern void DestroyContext(IntPtr dpy, IntPtr context);
[DllImport(_dll_name, EntryPoint = "glXMakeCurrent")]
[DllImport(Library, EntryPoint = "glXMakeCurrent")]
public static extern bool MakeCurrent(IntPtr display, IntPtr drawable, IntPtr context);
[DllImport(_dll_name, EntryPoint = "glXSwapBuffers")]
[DllImport(Library, EntryPoint = "glXSwapBuffers")]
public static extern void SwapBuffers(IntPtr display, IntPtr drawable);
[DllImport(_dll_name, EntryPoint = "glXGetProcAddress")]
[DllImport(Library, EntryPoint = "glXGetProcAddress")]
public static extern IntPtr GetProcAddress([MarshalAs(UnmanagedType.LPTStr)] string procName);
#region glXChooseVisual
[DllImport(_dll_name, EntryPoint = "glXChooseVisual")]
[DllImport(Library, EntryPoint = "glXChooseVisual")]
internal extern static IntPtr ChooseVisual(IntPtr dpy, int screen, IntPtr attriblist);
internal static IntPtr ChooseVisual(IntPtr dpy, int screen, int[] attriblist)
{
unsafe
{
fixed (int* attriblist_ptr = attriblist)
{
return ChooseVisual(dpy, screen, (IntPtr)attriblist_ptr);
}
{
unsafe
{
fixed (int* attriblist_ptr = attriblist)
{
return ChooseVisual(dpy, screen, (IntPtr)attriblist_ptr);
}
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenTK.Platform.X11
{
public static partial class Glx
{
internal const string Library = "libGL.so.1";
// Disable BeforeFieldInit optimization.
static Glx() { }
}
}

View file

@ -176,6 +176,9 @@ namespace OpenTK.Platform.X11
{
throw new ApplicationException("Could not create opengl context.");
}
this.MakeCurrent();
OpenTK.OpenGL.GL.LoadAll();
}
#endregion
@ -188,12 +191,6 @@ namespace OpenTK.Platform.X11
Debug.Indent();
Debug.Print("Requesting DisplayMode: {0}. ", mode.ToString());
// Hack; Temp workaround for invalid depth of 24
//if (mode.DepthBits == 24)
//{
// mode.DepthBits = 16;
// Debug.WriteLine("Temporary workaround applied: depth changed to 16.");
//}
List<int> visualAttributes = new List<int>();
visualAttributes.Add((int)Glx.Enums.GLXAttribute.RGBA);
@ -206,15 +203,14 @@ namespace OpenTK.Platform.X11
visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
visualAttributes.Add((int)mode.Color.Alpha);
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
//visualAttributes.Add((int)mode.DepthBits);
visualAttributes.Add(1);
visualAttributes.Add((int)mode.DepthBits);
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
visualAttributes.Add((int)Glx.Enums.GLXAttribute.NONE);
visualAttributes.Add((int)0);
visual = Glx.ChooseVisual(windowInfo.Display, windowInfo.Screen, visualAttributes.ToArray());
if (visual == IntPtr.Zero)
{
throw new ApplicationException("Requested mode not available.");
throw new ApplicationException("Requested mode not available (Glx.ChooseVisual returned 0).");
}
windowInfo.VisualInfo = (VisualInfo)Marshal.PtrToStructure(visual, typeof(VisualInfo));
Debug.Print("Got visual: {0}", windowInfo.VisualInfo.ToString());

View file

@ -19,7 +19,6 @@ namespace OpenTK.Platform.X11
private Type xplatui;
X11GLContext glContext;
private bool quit;
private bool disposed;
private bool fullscreen;
@ -40,11 +39,7 @@ namespace OpenTK.Platform.X11
throw new ArgumentException("UserControl c may not be null.");
}
c.ParentChanged += new EventHandler(c_ParentChanged);
if (c.ParentForm != null)
{
throw new ApplicationException("Internal OpenTK error, please report at http://opentk.sourceforge.net");
}
//c.ParentChanged += new EventHandler(c_ParentChanged);
info.Handle = c.Handle;
Debug.Print("Binding to control: {0}", String.IsNullOrEmpty(c.Name) ? c.Text : c.Name);
@ -93,6 +88,7 @@ namespace OpenTK.Platform.X11
);
glContext.CreateContext(null, true);
this.c_ParentChanged(c, EventArgs.Empty);
}
}

View file

@ -87,7 +87,7 @@ namespace OpenTK.Platform.X11
break;
case XEventName.CreateNotify:
// A child was exists - nothing to do
// A child was was created - nothing to do
break;
case XEventName.DestroyNotify:
@ -302,8 +302,6 @@ namespace OpenTK.Platform.X11
Debug.WriteLine("Mapped window.");
glContext.MakeCurrent();
Debug.WriteLine("Our shiny new context is now current - ready to rock 'n' roll!");
Debug.Unindent();
exists = true;