Added wgl binding generator.
This commit is contained in:
parent
12cd930ece
commit
2e467d1aa3
21 changed files with 15244 additions and 9983 deletions
|
@ -15,23 +15,28 @@ namespace Bind.GL2
|
|||
{
|
||||
class Generator : IBind
|
||||
{
|
||||
internal static SpecReader specReader;
|
||||
internal static SpecWriter specWriter;
|
||||
//internal static SpecReader specReader;
|
||||
//internal static SpecWriter specWriter;
|
||||
|
||||
protected static string glTypemap = "gl.tm";
|
||||
protected static string glTypemap = "GL2\\gl.tm";
|
||||
protected static string csTypemap = "csharp.tm";
|
||||
protected static string enumSpec = "enum.spec";
|
||||
protected static string enumSpecExt = "enumext.spec";
|
||||
protected static string glSpec = "gl.spec";
|
||||
protected static string enumSpec = "GL2\\enum.spec";
|
||||
protected static string enumSpecExt = "GL2\\enumext.spec";
|
||||
protected static string glSpec = "GL2\\gl.spec";
|
||||
protected static string glSpecExt = "";
|
||||
|
||||
protected static string importsFile = "GLCore.cs";
|
||||
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 string specFolder;
|
||||
|
||||
public Generator(string folder)
|
||||
{
|
||||
specFolder = folder;
|
||||
specReader = new GL2.SpecReader();
|
||||
specWriter = new GL2.SpecWriter();
|
||||
}
|
||||
|
||||
#region IBind Members
|
||||
|
@ -44,72 +49,42 @@ namespace Bind.GL2
|
|||
Bind.Structures.Enum.Initialize(enumSpec, enumSpecExt);
|
||||
Bind.Structures.Function.Initialize();
|
||||
Bind.Structures.Delegate.Initialize(glSpec, glSpecExt);
|
||||
|
||||
if (!Bind.Structures.Enum.GLEnums.ContainsKey("SGIX_icc_texture"))
|
||||
{
|
||||
// Add missing enum
|
||||
Trace.WriteLine("Spec error: SGIX_icc_texture enum missing, adding by hand.");
|
||||
|
||||
Bind.Structures.Enum e = new Bind.Structures.Enum("SGIX_icc_texture");
|
||||
e.ConstantCollection.Add("RGB_ICC_SGIX", new Constant("RGB_ICC_SGIX", "0x8460"));
|
||||
e.ConstantCollection.Add("RGBA_ICC_SGIX", new Constant("RGBA_ICC_SGIX", "0x8461"));
|
||||
e.ConstantCollection.Add("ALPHA_ICC_SGIX", new Constant("ALPHA_ICC_SGIX", "0x8462"));
|
||||
e.ConstantCollection.Add("LUMINANCE_ICC_SGIX", new Constant("LUMINANCE_ICC_SGIX", "0x8463"));
|
||||
e.ConstantCollection.Add("INTENSITY_ICC_SGIX", new Constant("INTENSITY_ICC_SGIX", "0x8464"));
|
||||
e.ConstantCollection.Add("LUMINANCE_ALPHA_ICC_SGIX", new Constant("LUMINANCE_ALPHA_ICC_SGIX", "0x8465"));
|
||||
e.ConstantCollection.Add("R5_G6_B5_ICC_SGIX", new Constant("R5_G6_B5_ICC_SGIX", "0x8466"));
|
||||
e.ConstantCollection.Add("R5_G6_B5_A8_ICC_SGIX", new Constant("R5_G6_B5_A8_ICC_SGIX", "0x8467"));
|
||||
e.ConstantCollection.Add("ALPHA16_ICC_SGIX", new Constant("ALPHA16_ICC_SGIX", "0x8468"));
|
||||
e.ConstantCollection.Add("LUMINANCE16_ICC_SGIX", new Constant("LUMINANCE16_ICC_SGIX", "0x8469"));
|
||||
e.ConstantCollection.Add("INTENSITY16_ICC_SGIX", new Constant("INTENSITY16_ICC_SGIX", "0x846A"));
|
||||
e.ConstantCollection.Add("LUMINANCE16_ALPHA8_ICC_SGIX", new Constant("LUMINANCE16_ALPHA8_ICC_SGIX", "0x846B"));
|
||||
|
||||
Bind.Structures.Enum.GLEnums.Add(e.Name, e);
|
||||
|
||||
foreach (Constant c in e.ConstantCollection.Values)
|
||||
{
|
||||
Utilities.Merge(Bind.Structures.Enum.GLEnums[Settings.CompleteEnumName], c);
|
||||
}
|
||||
}
|
||||
|
||||
// Process enums and delegates - create wrappers.
|
||||
Trace.WriteLine("Processing specs, please wait...");
|
||||
this.Translate();
|
||||
|
||||
// Write
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, "GLEnums.cs")))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("public static partial class {0}", Settings.GLClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
specWriter.WriteEnums(sw, Bind.Structures.Enum.GLEnums);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, "GLDelegates.cs")))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
specWriter.WriteDelegates(sw, Bind.Structures.Delegate.Delegates);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, "GLCore.cs")))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
specWriter.WriteImports(sw, Bind.Structures.Delegate.Delegates);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, "GL.cs")))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
specWriter.WriteWrappers(sw, Bind.Structures.Function.Wrappers, Bind.Structures.Type.CSTypes);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
this.WriteBindings(
|
||||
Bind.Structures.Delegate.Delegates,
|
||||
Bind.Structures.Function.Wrappers,
|
||||
Bind.Structures.Enum.GLEnums);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -118,17 +93,16 @@ namespace Bind.GL2
|
|||
|
||||
#region private void Translate()
|
||||
|
||||
private void Translate()
|
||||
protected virtual void Translate()
|
||||
{
|
||||
foreach (Bind.Structures.Enum e in Bind.Structures.Enum.GLEnums.Values)
|
||||
{
|
||||
TranslateEnum(e);
|
||||
}
|
||||
|
||||
foreach (Bind.Structures.Delegate d in Bind.Structures.Delegate.Delegates.Values)
|
||||
//foreach (Bind.Structures.Delegate d in Bind.Structures.Delegate.Delegates.Values)
|
||||
{
|
||||
//wrappers.AddRange(d.CreateWrappers());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,50 +138,652 @@ namespace Bind.GL2
|
|||
|
||||
#region ISpecReader Members
|
||||
|
||||
public DelegateCollection ReadDelegates(StreamReader specFile)
|
||||
public virtual DelegateCollection ReadDelegates(StreamReader specFile)
|
||||
{
|
||||
return specReader.ReadDelegates(specFile);
|
||||
Console.WriteLine("Reading function specs.");
|
||||
|
||||
//List<Bind.Structures.Delegate> delegates = new List<Bind.Structures.Delegate>();
|
||||
DelegateCollection delegates = new DelegateCollection();
|
||||
|
||||
do
|
||||
{
|
||||
string line = NextValidLine(specFile);
|
||||
if (String.IsNullOrEmpty(line))
|
||||
break;
|
||||
|
||||
while (line.Contains("(") && !specFile.EndOfStream)
|
||||
{
|
||||
// Get next OpenGL function
|
||||
|
||||
Bind.Structures.Delegate d = new Bind.Structures.Delegate();
|
||||
|
||||
// Get function name:
|
||||
d.Name = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)[0];
|
||||
|
||||
if (d.Name.Contains("MultiTexCoord1"))
|
||||
{
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
// Get function parameters and return value
|
||||
|
||||
line = specFile.ReadLine();
|
||||
List<string> words = new List<string>(
|
||||
line.Replace('\t', ' ').Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)
|
||||
);
|
||||
|
||||
if (words.Count == 0)
|
||||
break;
|
||||
|
||||
// Identify line:
|
||||
switch (words[0])
|
||||
{
|
||||
case "return": // Line denotes return value
|
||||
d.ReturnType.CurrentType = words[1];
|
||||
break;
|
||||
|
||||
case "param": // Line denotes parameter
|
||||
Parameter p = new Parameter();
|
||||
|
||||
p.Name = Utilities.Keywords.Contains(words[1]) ? "@" + words[1] : words[1];
|
||||
p.CurrentType = words[2];
|
||||
p.Pointer = words[4] == "array" ? true : false;
|
||||
p.Flow = words[3] == "in" ? Parameter.FlowDirection.In : Parameter.FlowDirection.Out;
|
||||
|
||||
d.Parameters.Add(p);
|
||||
break;
|
||||
|
||||
// Version directive is not used. GetTexParameterIivEXT and GetTexParameterIuivEXT define two(!) versions (why?)
|
||||
//case "version": // Line denotes function version (i.e. 1.0, 1.2, 1.5)
|
||||
// d.UserData.Add("version", words[1]);
|
||||
// break;
|
||||
|
||||
case "category":
|
||||
d.Category = words[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
d.Translate();
|
||||
|
||||
delegates.Add(d);
|
||||
}
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
return delegates;
|
||||
}
|
||||
|
||||
public EnumCollection ReadEnums(StreamReader specFile)
|
||||
public virtual EnumCollection ReadEnums(StreamReader specFile)
|
||||
{
|
||||
return specReader.ReadEnums(specFile);
|
||||
EnumCollection enums = new EnumCollection();
|
||||
|
||||
// complete_enum contains all opengl enumerants.
|
||||
Bind.Structures.Enum complete_enum = new Bind.Structures.Enum();
|
||||
complete_enum.Name = Settings.CompleteEnumName;
|
||||
|
||||
Trace.WriteLine(String.Format("Reading opengl enumerant specs"));
|
||||
Trace.Indent();
|
||||
|
||||
do
|
||||
{
|
||||
string line = NextValidLine(specFile);
|
||||
if (String.IsNullOrEmpty(line))
|
||||
break;
|
||||
|
||||
line = line.Replace('\t', ' ');
|
||||
|
||||
// We just encountered the start of a new enumerant:
|
||||
while (!String.IsNullOrEmpty(line) && line.Contains("enum"))
|
||||
{
|
||||
string[] words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (words.Length == 0)
|
||||
continue;
|
||||
|
||||
// Declare a new enumerant
|
||||
Bind.Structures.Enum e = new Bind.Structures.Enum();
|
||||
e.Name = Char.IsDigit(words[0][0]) ? "GL_" + words[0] : words[0];
|
||||
|
||||
// And fill in the values for this enumerant
|
||||
do
|
||||
{
|
||||
line = NextValidLine(specFile);
|
||||
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("enum:") || specFile.EndOfStream)
|
||||
break;
|
||||
|
||||
line = line.Replace('\t', ' ');
|
||||
words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (words.Length == 0)
|
||||
continue;
|
||||
|
||||
// If we reach this point, we have found a new value for the current enumerant
|
||||
Constant c = new Constant();
|
||||
if (line.Contains("="))
|
||||
{
|
||||
// Trim the "GL_" from the start of the string.
|
||||
if (words[0].StartsWith("GL_"))
|
||||
words[0] = words[0].Substring(3);
|
||||
|
||||
if (Char.IsDigit(words[0][0]))
|
||||
words[0] = "GL_" + words[0];
|
||||
|
||||
c.Name = words[0];
|
||||
|
||||
uint number;
|
||||
if (UInt32.TryParse(words[2].Replace("0x", String.Empty), System.Globalization.NumberStyles.AllowHexSpecifier, null, out number))
|
||||
{
|
||||
// The value is a number, check if it should be unchecked.
|
||||
if (number > 0x7FFFFFFF)
|
||||
{
|
||||
c.Unchecked = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The value is not a number.
|
||||
// Strip the "GL_" from the start of the string.
|
||||
if (words[2].StartsWith("GL_"))
|
||||
words[2] = words[2].Substring(3);
|
||||
|
||||
// If the name now starts with a digit (doesn't matter whether we
|
||||
// stripped "GL_" above), add a "GL_" prefix.
|
||||
// (e.g. GL_4_BYTES).
|
||||
if (Char.IsDigit(words[2][0]))
|
||||
words[2] = "GL_" + words[2];
|
||||
}
|
||||
|
||||
c.Value = words[2];
|
||||
}
|
||||
else if (words[0] == "use")
|
||||
{
|
||||
// Trim the "GL_" from the start of the string.
|
||||
if (words[2].StartsWith("GL_"))
|
||||
words[2] = words[2].Substring(3);
|
||||
|
||||
// If the remaining string starts with a digit, we were wrong above.
|
||||
// Re-add the "GL_"
|
||||
if (Char.IsDigit(words[2][0]))
|
||||
words[2] = "GL_" + words[2];
|
||||
|
||||
c.Name = words[2];
|
||||
|
||||
if (words[1] == "LightProperty")
|
||||
{
|
||||
Trace.WriteLine(
|
||||
String.Format(
|
||||
"Spec error: Enum LightProperty.{0} does no exist, changing to LightParameter.{0}",
|
||||
words[2]
|
||||
)
|
||||
);
|
||||
words[1] = "LightParameter";
|
||||
}
|
||||
c.Reference = words[1];
|
||||
c.Value = words[2];
|
||||
}
|
||||
|
||||
//if (!String.IsNullOrEmpty(c.Name) && !e.Members.Contains.Contains(c))
|
||||
//SpecTranslator.Merge(e.Members, c);
|
||||
if (!e.ConstantCollection.ContainsKey(c.Name))
|
||||
{
|
||||
e.ConstantCollection.Add(c.Name, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
Trace.WriteLine(
|
||||
String.Format(
|
||||
"Spec error: Constant {0} defined twice in enum {1}, discarding last definition.",
|
||||
c.Name,
|
||||
e.Name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Insert the current constant in the list of all constants.
|
||||
//SpecTranslator.Merge(complete_enum.Members, c);
|
||||
complete_enum = Utilities.Merge(complete_enum, c);
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
// At this point, the complete value list for the current enumerant has been read, so add this
|
||||
// enumerant to the list.
|
||||
//e.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "public enum " + e.Name));
|
||||
//e.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, "public enum " + e.Name));
|
||||
|
||||
// (disabled) Hack - discard Boolean enum, it fsucks up the fragile translation code ahead.
|
||||
//if (!e.Name.Contains("Bool"))
|
||||
//Utilities.Merge(enums, e);
|
||||
|
||||
if (!enums.ContainsKey(e.Name))
|
||||
{
|
||||
enums.Add(e.Name, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The enum already exists, merge constants.
|
||||
Trace.WriteLine(String.Format("Conflict: Enum {0} already exists, merging constants.", e.Name));
|
||||
foreach (Constant t in e.ConstantCollection.Values)
|
||||
{
|
||||
Utilities.Merge(enums[e.Name], t);
|
||||
}
|
||||
}
|
||||
|
||||
//enums.Add(e);
|
||||
}
|
||||
//SpecTranslator.Merge(enums, complete_enum);
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
enums.Add(complete_enum.Name, complete_enum);
|
||||
|
||||
Trace.Unindent();
|
||||
|
||||
return enums;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ReadTypeMap(StreamReader specFile)
|
||||
public virtual Dictionary<string, string> ReadTypeMap(StreamReader specFile)
|
||||
{
|
||||
return specReader.ReadTypeMap(specFile);
|
||||
Console.WriteLine("Reading opengl types.");
|
||||
Dictionary<string, string> GLTypes = new Dictionary<string, string>();
|
||||
|
||||
do
|
||||
{
|
||||
string line = specFile.ReadLine();
|
||||
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
string[] words = line.Split(" ,*\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (words[0].ToLower() == "void")
|
||||
{
|
||||
// Special case for "void" -> "". We make it "void" -> "void"
|
||||
GLTypes.Add(words[0], "void");
|
||||
}
|
||||
else if (words[0] == "VoidPointer" || words[0] == "ConstVoidPointer")
|
||||
{
|
||||
// "(Const)VoidPointer" -> "void*"
|
||||
GLTypes.Add(words[0], "void*");
|
||||
}
|
||||
/*else if (words[0] == "CharPointer" || words[0] == "charPointerARB")
|
||||
{
|
||||
GLTypes.Add(words[0], "System.String");
|
||||
}
|
||||
else if (words[0].Contains("Pointer"))
|
||||
{
|
||||
GLTypes.Add(words[0], words[1].Replace("Pointer", "*"));
|
||||
}*/
|
||||
else if (words[1].Contains("GLvoid"))
|
||||
{
|
||||
GLTypes.Add(words[0], "void");
|
||||
}
|
||||
else
|
||||
{
|
||||
GLTypes.Add(words[0], words[1]);
|
||||
}
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
return GLTypes;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ReadCSTypeMap(StreamReader specFile)
|
||||
public virtual Dictionary<string, string> ReadCSTypeMap(StreamReader specFile)
|
||||
{
|
||||
return specReader.ReadCSTypeMap(specFile);
|
||||
Dictionary<string, string> CSTypes = new Dictionary<string, string>();
|
||||
Console.WriteLine("Reading C# types.");
|
||||
|
||||
while (!specFile.EndOfStream)
|
||||
{
|
||||
string line = specFile.ReadLine();
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
string[] words = line.Split(" ,\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (words.Length < 2)
|
||||
continue;
|
||||
|
||||
CSTypes.Add(words[0], words[1]);
|
||||
}
|
||||
|
||||
return CSTypes;
|
||||
}
|
||||
|
||||
#region private string NextValidLine(StreamReader sr)
|
||||
|
||||
private string NextValidLine(System.IO.StreamReader sr)
|
||||
{
|
||||
string line;
|
||||
|
||||
do
|
||||
{
|
||||
if (sr.EndOfStream)
|
||||
return null;
|
||||
|
||||
line = sr.ReadLine().Trim();
|
||||
|
||||
if (String.IsNullOrEmpty(line) ||
|
||||
line.StartsWith("#") || // Disregard comments.
|
||||
line.StartsWith("passthru") || // Disregard passthru statements.
|
||||
line.StartsWith("required-props:") ||
|
||||
line.StartsWith("param:") ||
|
||||
line.StartsWith("dlflags:") ||
|
||||
line.StartsWith("glxflags:") ||
|
||||
line.StartsWith("vectorequiv:") ||
|
||||
//line.StartsWith("category:") ||
|
||||
line.StartsWith("version:") ||
|
||||
line.StartsWith("glxsingle:") ||
|
||||
line.StartsWith("glxropcode:") ||
|
||||
line.StartsWith("glxvendorpriv:") ||
|
||||
line.StartsWith("glsflags:") ||
|
||||
line.StartsWith("glsopcode:") ||
|
||||
line.StartsWith("glsalias:") ||
|
||||
line.StartsWith("wglflags:") ||
|
||||
line.StartsWith("extension:") ||
|
||||
line.StartsWith("alias:") ||
|
||||
line.StartsWith("offset:"))
|
||||
continue;
|
||||
|
||||
return line;
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISpecWriter Members
|
||||
|
||||
#region void WriteBindings
|
||||
|
||||
public void WriteBindings(
|
||||
DelegateCollection delegates, FunctionCollection functions,
|
||||
EnumCollection enums)
|
||||
{
|
||||
// Write
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, enumsFile)))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("public static partial class {0}", className);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
WriteEnums(sw, Bind.Structures.Enum.GLEnums);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, delegatesFile)))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
WriteDelegates(sw, Bind.Structures.Delegate.Delegates);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, importsFile)))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
WriteImports(sw, Bind.Structures.Delegate.Delegates);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
using (BindStreamWriter sw = new BindStreamWriter(Path.Combine(Settings.OutputPath, wrappersFile)))
|
||||
{
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
WriteWrappers(sw, Bind.Structures.Function.Wrappers, Bind.Structures.Type.CSTypes);
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteDelegates
|
||||
|
||||
public void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates)
|
||||
{
|
||||
specWriter.WriteDelegates(sw, delegates);
|
||||
Trace.WriteLine(String.Format("Writing delegates to {0}.{1}", Settings.OutputNamespace, Settings.DelegatesClass));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("partial class {0}", className);
|
||||
sw.WriteLine("{");
|
||||
sw.Indent();
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("internal static class {0}", Settings.DelegatesClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
// Disable BeforeFieldInit
|
||||
sw.WriteLine("static {0}()", Settings.DelegatesClass);
|
||||
sw.WriteLine("{");
|
||||
// --- Workaround for mono gmcs 1.2.4 issue, where static initalization fails. ---
|
||||
sw.Indent();
|
||||
sw.WriteLine("{0}.ReloadFunctions();", className);
|
||||
sw.Unindent();
|
||||
// --- End workaround ---
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
foreach (Bind.Structures.Delegate d in delegates.Values)
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteImports
|
||||
|
||||
public void WriteImports(BindStreamWriter sw, DelegateCollection delegates)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing imports to {0}.{1}", Settings.OutputNamespace, Settings.ImportsClass));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("partial class {0}", className);
|
||||
sw.WriteLine("{");
|
||||
sw.Indent();
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("internal static class {0}", Settings.ImportsClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("static {0}() {1} {2}", Settings.ImportsClass, "{", "}"); // Disable BeforeFieldInit
|
||||
sw.WriteLine();
|
||||
foreach (Bind.Structures.Delegate d in delegates.Values)
|
||||
{
|
||||
if (String.IsNullOrEmpty(d.Extension) || d.Extension == "Core")
|
||||
{
|
||||
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
|
||||
sw.WriteLine(
|
||||
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"gl{1}\", ExactSpelling = true)]",
|
||||
className,
|
||||
d.Name
|
||||
);
|
||||
sw.WriteLine("internal extern static {0};", d.DeclarationString());
|
||||
}
|
||||
}
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteWrappers
|
||||
|
||||
public void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes)
|
||||
{
|
||||
specWriter.WriteWrappers(sw, wrappers, CSTypes);
|
||||
Trace.WriteLine(String.Format("Writing wrappers to {0}.{1}", Settings.OutputNamespace, className));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("public static partial class {0}", className);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("static {0}() {1} {2}", className, "{", "}"); // Disable BeforeFieldInit
|
||||
sw.WriteLine();
|
||||
foreach (string key in wrappers.Keys)
|
||||
{
|
||||
if (Settings.Compatibility == Settings.Legacy.None && key != "Core")
|
||||
{
|
||||
if (key != "3DFX")
|
||||
{
|
||||
sw.WriteLine("public static class {0}", key);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Identifiers cannot start with a number:
|
||||
sw.WriteLine("public static class GL_{0}", key);
|
||||
}
|
||||
sw.WriteLine("{");
|
||||
sw.Indent();
|
||||
}
|
||||
|
||||
foreach (Function f in wrappers[key])
|
||||
{
|
||||
if (!f.CLSCompliant)
|
||||
{
|
||||
sw.WriteLine("[System.CLSCompliant(false)]");
|
||||
}
|
||||
sw.WriteLine("public static ");
|
||||
sw.Write(f);
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
if (Settings.Compatibility == Settings.Legacy.None && key != "Core")
|
||||
{
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
}
|
||||
}
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
|
||||
{
|
||||
specWriter.WriteEnums(sw, enums);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region void WriteTypes
|
||||
|
||||
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
|
||||
{
|
||||
specWriter.WriteTypes(sw, CSTypes);
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine();
|
||||
foreach (string s in CSTypes.Keys)
|
||||
{
|
||||
sw.WriteLine("using {0} = System.{1};", s, CSTypes[s]);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteEnums
|
||||
|
||||
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing enums to {0}.{1}", Settings.OutputNamespace, className));
|
||||
|
||||
if (Settings.Compatibility == Settings.Legacy.None)
|
||||
{
|
||||
sw.WriteLine("public class Enums");
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
foreach (Bind.Structures.Enum @enum in enums.Values)
|
||||
{
|
||||
sw.Write(@enum);
|
||||
sw.WriteLine();
|
||||
}
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
else if (Settings.Compatibility == Settings.Legacy.Tao)
|
||||
{
|
||||
// Tao legacy mode: dump all enums as constants in GLClass.
|
||||
foreach (Bind.Structures.Constant c in enums[Settings.CompleteEnumName].ConstantCollection.Values)
|
||||
{
|
||||
// Print constants avoiding circular definitions
|
||||
if (c.Name != c.Value)
|
||||
{
|
||||
sw.WriteLine(String.Format(
|
||||
"public const int {0} = {2}((int){1});",
|
||||
c.Name.StartsWith("GL_") ? c.Name : "GL_" + c.Name,
|
||||
Char.IsDigit(c.Value[0]) ? c.Value : c.Value.StartsWith("GL_") ? c.Value : "GL_" + c.Value,
|
||||
c.Unchecked ? "unchecked" : ""));
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,80 +20,7 @@ namespace Bind.GL2
|
|||
|
||||
public virtual DelegateCollection ReadDelegates(System.IO.StreamReader specFile)
|
||||
{
|
||||
Console.WriteLine("Reading function specs.");
|
||||
|
||||
//List<Bind.Structures.Delegate> delegates = new List<Bind.Structures.Delegate>();
|
||||
DelegateCollection delegates = new DelegateCollection();
|
||||
|
||||
do
|
||||
{
|
||||
string line = NextValidLine(specFile);
|
||||
if (String.IsNullOrEmpty(line))
|
||||
break;
|
||||
|
||||
while (line.Contains("(") && !specFile.EndOfStream)
|
||||
{
|
||||
// Get next OpenGL function
|
||||
|
||||
Bind.Structures.Delegate d = new Bind.Structures.Delegate();
|
||||
|
||||
// Get function name:
|
||||
d.Name = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)[0];
|
||||
|
||||
if (d.Name.Contains("MultiTexCoord1"))
|
||||
{
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
// Get function parameters and return value
|
||||
|
||||
line = specFile.ReadLine();
|
||||
List<string> words = new List<string>(
|
||||
line.Replace('\t', ' ').Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)
|
||||
);
|
||||
|
||||
if (words.Count == 0)
|
||||
break;
|
||||
|
||||
// Identify line:
|
||||
switch (words[0])
|
||||
{
|
||||
case "return": // Line denotes return value
|
||||
d.ReturnType.CurrentType = words[1];
|
||||
break;
|
||||
|
||||
case "param": // Line denotes parameter
|
||||
Parameter p = new Parameter();
|
||||
|
||||
p.Name = Utilities.Keywords.Contains(words[1]) ? "@" + words[1] : words[1];
|
||||
p.CurrentType = words[2];
|
||||
p.Pointer = words[4] == "array" ? true : false;
|
||||
p.Flow = words[3] == "in" ? Parameter.FlowDirection.In : Parameter.FlowDirection.Out;
|
||||
|
||||
d.Parameters.Add(p);
|
||||
break;
|
||||
|
||||
// Version directive is not used. GetTexParameterIivEXT and GetTexParameterIuivEXT define two(!) versions (why?)
|
||||
//case "version": // Line denotes function version (i.e. 1.0, 1.2, 1.5)
|
||||
// d.UserData.Add("version", words[1]);
|
||||
// break;
|
||||
|
||||
case "category":
|
||||
d.Category = words[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
d.Translate();
|
||||
|
||||
delegates.Add(d);
|
||||
}
|
||||
}
|
||||
while (!specFile.EndOfStream);
|
||||
|
||||
return delegates;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -102,194 +29,7 @@ namespace Bind.GL2
|
|||
|
||||
public virtual EnumCollection ReadEnums(System.IO.StreamReader specfile)
|
||||
{
|
||||
EnumCollection enums = new EnumCollection();
|
||||
|
||||
// complete_enum contains all opengl enumerants.
|
||||
Bind.Structures.Enum complete_enum = new Bind.Structures.Enum();
|
||||
complete_enum.Name = Settings.CompleteEnumName;
|
||||
|
||||
Trace.WriteLine(String.Format("Reading opengl enumerant specs"));
|
||||
Trace.Indent();
|
||||
|
||||
do
|
||||
{
|
||||
string line = NextValidLine(specfile);
|
||||
if (String.IsNullOrEmpty(line))
|
||||
break;
|
||||
|
||||
line = line.Replace('\t', ' ');
|
||||
|
||||
// We just encountered the start of a new enumerant:
|
||||
while (!String.IsNullOrEmpty(line) && line.Contains("enum"))
|
||||
{
|
||||
string[] words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (words.Length == 0)
|
||||
continue;
|
||||
|
||||
// Declare a new enumerant
|
||||
Bind.Structures.Enum e = new Bind.Structures.Enum();
|
||||
e.Name = Char.IsDigit(words[0][0]) ? "GL_" + words[0] : words[0];
|
||||
|
||||
// And fill in the values for this enumerant
|
||||
do
|
||||
{
|
||||
line = NextValidLine(specfile);
|
||||
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("enum:") || specfile.EndOfStream)
|
||||
break;
|
||||
|
||||
line = line.Replace('\t', ' ');
|
||||
words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (words.Length == 0)
|
||||
continue;
|
||||
|
||||
// If we reach this point, we have found a new value for the current enumerant
|
||||
Constant c = new Constant();
|
||||
if (line.Contains("="))
|
||||
{
|
||||
// Trim the "GL_" from the start of the string.
|
||||
if (words[0].StartsWith("GL_"))
|
||||
words[0] = words[0].Substring(3);
|
||||
|
||||
if (Char.IsDigit(words[0][0]))
|
||||
words[0] = "GL_" + words[0];
|
||||
|
||||
c.Name = words[0];
|
||||
|
||||
uint number;
|
||||
if (UInt32.TryParse(words[2].Replace("0x", String.Empty), System.Globalization.NumberStyles.AllowHexSpecifier, null, out number))
|
||||
{
|
||||
// The value is a number, check if it should be unchecked.
|
||||
if (number > 0x7FFFFFFF)
|
||||
{
|
||||
c.Unchecked = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The value is not a number.
|
||||
// Strip the "GL_" from the start of the string.
|
||||
if (words[2].StartsWith("GL_"))
|
||||
words[2] = words[2].Substring(3);
|
||||
|
||||
// If the name now starts with a digit (doesn't matter whether we
|
||||
// stripped "GL_" above), add a "GL_" prefix.
|
||||
// (e.g. GL_4_BYTES).
|
||||
if (Char.IsDigit(words[2][0]))
|
||||
words[2] = "GL_" + words[2];
|
||||
}
|
||||
|
||||
c.Value = words[2];
|
||||
}
|
||||
else if (words[0] == "use")
|
||||
{
|
||||
// Trim the "GL_" from the start of the string.
|
||||
if (words[2].StartsWith("GL_"))
|
||||
words[2] = words[2].Substring(3);
|
||||
|
||||
// If the remaining string starts with a digit, we were wrong above.
|
||||
// Re-add the "GL_"
|
||||
if (Char.IsDigit(words[2][0]))
|
||||
words[2] = "GL_" + words[2];
|
||||
|
||||
c.Name = words[2];
|
||||
|
||||
if (words[1] == "LightProperty")
|
||||
{
|
||||
Trace.WriteLine(
|
||||
String.Format(
|
||||
"Spec error: Enum LightProperty.{0} does no exist, changing to LightParameter.{0}",
|
||||
words[2]
|
||||
)
|
||||
);
|
||||
words[1] = "LightParameter";
|
||||
}
|
||||
c.Reference = words[1];
|
||||
c.Value = words[2];
|
||||
}
|
||||
|
||||
//if (!String.IsNullOrEmpty(c.Name) && !e.Members.Contains.Contains(c))
|
||||
//SpecTranslator.Merge(e.Members, c);
|
||||
if (!e.ConstantCollection.ContainsKey(c.Name))
|
||||
{
|
||||
e.ConstantCollection.Add(c.Name, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
Trace.WriteLine(
|
||||
String.Format(
|
||||
"Spec error: Constant {0} defined twice in enum {1}, discarding last definition.",
|
||||
c.Name,
|
||||
e.Name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Insert the current constant in the list of all constants.
|
||||
//SpecTranslator.Merge(complete_enum.Members, c);
|
||||
complete_enum = Utilities.Merge(complete_enum, c);
|
||||
}
|
||||
while (!specfile.EndOfStream);
|
||||
|
||||
// At this point, the complete value list for the current enumerant has been read, so add this
|
||||
// enumerant to the list.
|
||||
//e.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "public enum " + e.Name));
|
||||
//e.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, "public enum " + e.Name));
|
||||
|
||||
// (disabled) Hack - discard Boolean enum, it fsucks up the fragile translation code ahead.
|
||||
//if (!e.Name.Contains("Bool"))
|
||||
//Utilities.Merge(enums, e);
|
||||
|
||||
if (!enums.ContainsKey(e.Name))
|
||||
{
|
||||
enums.Add(e.Name, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The enum already exists, merge constants.
|
||||
Trace.WriteLine(String.Format("Conflict: Enum {0} already exists, merging constants.", e.Name));
|
||||
foreach (Constant t in e.ConstantCollection.Values)
|
||||
{
|
||||
Utilities.Merge(enums[e.Name], t);
|
||||
}
|
||||
}
|
||||
|
||||
//enums.Add(e);
|
||||
}
|
||||
//SpecTranslator.Merge(enums, complete_enum);
|
||||
}
|
||||
while (!specfile.EndOfStream);
|
||||
|
||||
enums.Add(complete_enum.Name, complete_enum);
|
||||
|
||||
// Add missing enum
|
||||
{
|
||||
Trace.WriteLine("Spec error: SGIX_icc_texture enum missing, adding by hand.");
|
||||
|
||||
Bind.Structures.Enum e = new Bind.Structures.Enum("SGIX_icc_texture");
|
||||
e.ConstantCollection.Add("RGB_ICC_SGIX", new Constant("RGB_ICC_SGIX", "0x8460"));
|
||||
e.ConstantCollection.Add("RGBA_ICC_SGIX", new Constant("RGBA_ICC_SGIX", "0x8461"));
|
||||
e.ConstantCollection.Add("ALPHA_ICC_SGIX", new Constant("ALPHA_ICC_SGIX", "0x8462"));
|
||||
e.ConstantCollection.Add("LUMINANCE_ICC_SGIX", new Constant("LUMINANCE_ICC_SGIX", "0x8463"));
|
||||
e.ConstantCollection.Add("INTENSITY_ICC_SGIX", new Constant("INTENSITY_ICC_SGIX", "0x8464"));
|
||||
e.ConstantCollection.Add("LUMINANCE_ALPHA_ICC_SGIX", new Constant("LUMINANCE_ALPHA_ICC_SGIX", "0x8465"));
|
||||
e.ConstantCollection.Add("R5_G6_B5_ICC_SGIX", new Constant("R5_G6_B5_ICC_SGIX", "0x8466"));
|
||||
e.ConstantCollection.Add("R5_G6_B5_A8_ICC_SGIX", new Constant("R5_G6_B5_A8_ICC_SGIX", "0x8467"));
|
||||
e.ConstantCollection.Add("ALPHA16_ICC_SGIX", new Constant("ALPHA16_ICC_SGIX", "0x8468"));
|
||||
e.ConstantCollection.Add("LUMINANCE16_ICC_SGIX", new Constant("LUMINANCE16_ICC_SGIX", "0x8469"));
|
||||
e.ConstantCollection.Add("INTENSITY16_ICC_SGIX", new Constant("INTENSITY16_ICC_SGIX", "0x846A"));
|
||||
e.ConstantCollection.Add("LUMINANCE16_ALPHA8_ICC_SGIX", new Constant("LUMINANCE16_ALPHA8_ICC_SGIX", "0x846B"));
|
||||
|
||||
enums.Add(e.Name, e);
|
||||
}
|
||||
|
||||
Trace.Unindent();
|
||||
|
||||
return enums;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -298,48 +38,7 @@ namespace Bind.GL2
|
|||
|
||||
public virtual Dictionary<string, string> ReadTypeMap(System.IO.StreamReader sr)
|
||||
{
|
||||
Console.WriteLine("Reading opengl types.");
|
||||
Dictionary<string, string> GLTypes = new Dictionary<string, string>();
|
||||
|
||||
do
|
||||
{
|
||||
string line = sr.ReadLine();
|
||||
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
string[] words = line.Split(new char[] { ' ', ',', '*', '\t' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (words[0].ToLower() == "void")
|
||||
{
|
||||
// Special case for "void" -> "". We make it "void" -> "void"
|
||||
GLTypes.Add(words[0], "void");
|
||||
}
|
||||
else if (words[0] == "VoidPointer" || words[0] == "ConstVoidPointer")
|
||||
{
|
||||
// "(Const)VoidPointer" -> "void*"
|
||||
GLTypes.Add(words[0], "void*");
|
||||
}
|
||||
/*else if (words[0] == "CharPointer" || words[0] == "charPointerARB")
|
||||
{
|
||||
GLTypes.Add(words[0], "System.String");
|
||||
}
|
||||
else if (words[0].Contains("Pointer"))
|
||||
{
|
||||
GLTypes.Add(words[0], words[1].Replace("Pointer", "*"));
|
||||
}*/
|
||||
else if (words[1].Contains("GLvoid"))
|
||||
{
|
||||
GLTypes.Add(words[0], "void");
|
||||
}
|
||||
else
|
||||
{
|
||||
GLTypes.Add(words[0], words[1]);
|
||||
}
|
||||
}
|
||||
while (!sr.EndOfStream);
|
||||
|
||||
return GLTypes;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -348,69 +47,13 @@ namespace Bind.GL2
|
|||
|
||||
public virtual Dictionary<string, string> ReadCSTypeMap(System.IO.StreamReader sr)
|
||||
{
|
||||
Dictionary<string, string> CSTypes = new Dictionary<string, string>();
|
||||
Console.WriteLine("Reading C# types.");
|
||||
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
string line = sr.ReadLine();
|
||||
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
string[] words = line.Split(" ,".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (words.Length < 2)
|
||||
continue;
|
||||
|
||||
CSTypes.Add(words[0], words[1]);
|
||||
}
|
||||
|
||||
return CSTypes;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region protected virtual string NextValidLine(StreamReader sr)
|
||||
|
||||
protected virtual string NextValidLine(System.IO.StreamReader sr)
|
||||
{
|
||||
string line;
|
||||
|
||||
do
|
||||
{
|
||||
if (sr.EndOfStream)
|
||||
return null;
|
||||
|
||||
line = sr.ReadLine().Trim();
|
||||
|
||||
if (String.IsNullOrEmpty(line) ||
|
||||
line.StartsWith("#") || // Disregard comments.
|
||||
line.StartsWith("passthru") || // Disregard passthru statements.
|
||||
line.StartsWith("required-props:") ||
|
||||
line.StartsWith("param:") ||
|
||||
line.StartsWith("dlflags:") ||
|
||||
line.StartsWith("glxflags:") ||
|
||||
line.StartsWith("vectorequiv:") ||
|
||||
//line.StartsWith("category:") ||
|
||||
line.StartsWith("version:") ||
|
||||
line.StartsWith("glxsingle:") ||
|
||||
line.StartsWith("glxropcode:") ||
|
||||
line.StartsWith("glxvendorpriv:") ||
|
||||
line.StartsWith("glsflags:") ||
|
||||
line.StartsWith("glsopcode:") ||
|
||||
line.StartsWith("glsalias:") ||
|
||||
line.StartsWith("wglflags:") ||
|
||||
line.StartsWith("extension:") ||
|
||||
line.StartsWith("alias:") ||
|
||||
line.StartsWith("offset:"))
|
||||
continue;
|
||||
|
||||
return line;
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,197 +16,11 @@ namespace Bind.GL2
|
|||
{
|
||||
#region --- ISpecWriter Members ---
|
||||
|
||||
#region void WriteDelegates
|
||||
|
||||
public void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing delegates to {0}.{1}", Settings.OutputNamespace, Settings.DelegatesClass));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("internal static class {0}", Settings.DelegatesClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
// Disable BeforeFieldInit
|
||||
sw.WriteLine("static {0}()", Settings.DelegatesClass);
|
||||
sw.WriteLine("{");
|
||||
// --- Workaround for mono gmcs 1.2.4 issue, where static initalization fails. ---
|
||||
sw.Indent();
|
||||
sw.WriteLine("{0}.ReloadFunctions();", Settings.GLClass);
|
||||
sw.Unindent();
|
||||
// --- End workaround ---
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
foreach (Bind.Structures.Delegate d in delegates.Values)
|
||||
{
|
||||
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,
|
||||
Settings.GLClass,
|
||||
"GetDelegateForExtensionMethod");
|
||||
}
|
||||
}
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteImports
|
||||
|
||||
public void WriteImports(BindStreamWriter sw, DelegateCollection delegates)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing imports to {0}.{1}", Settings.OutputNamespace, Settings.ImportsClass));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("internal static class {0}", Settings.ImportsClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("static {0}() {1} {2}", Settings.ImportsClass, "{", "}"); // Disable BeforeFieldInit
|
||||
sw.WriteLine();
|
||||
foreach (Bind.Structures.Delegate d in delegates.Values)
|
||||
{
|
||||
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
|
||||
sw.WriteLine(
|
||||
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"gl{1}\", ExactSpelling = true)]",
|
||||
Settings.GLClass,
|
||||
d.Name
|
||||
);
|
||||
sw.WriteLine("internal extern static {0};", d.DeclarationString());
|
||||
}
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteWrappers
|
||||
|
||||
public void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing wrappers to {0}.{1}", Settings.OutputNamespace, Settings.GLClass));
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("public static partial class {0}", Settings.GLClass);
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
sw.WriteLine("static {0}() {1} {2}", Settings.GLClass, "{", "}"); // Disable BeforeFieldInit
|
||||
sw.WriteLine();
|
||||
foreach (string key in wrappers.Keys)
|
||||
{
|
||||
if (Settings.Compatibility == Settings.Legacy.None && key != "Core")
|
||||
{
|
||||
sw.WriteLine("public static class {0}", key);
|
||||
sw.WriteLine("{");
|
||||
sw.Indent();
|
||||
}
|
||||
|
||||
foreach (Function f in wrappers[key])
|
||||
{
|
||||
if (!f.CLSCompliant)
|
||||
{
|
||||
sw.WriteLine("[System.CLSCompliant(false)]");
|
||||
}
|
||||
sw.WriteLine("public static ");
|
||||
sw.Write(f);
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
if (Settings.Compatibility == Settings.Legacy.None && key != "Core")
|
||||
{
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
}
|
||||
}
|
||||
sw.Unindent();
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteTypes
|
||||
|
||||
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
|
||||
{
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine();
|
||||
foreach (string s in CSTypes.Keys)
|
||||
{
|
||||
sw.WriteLine("using {0} = System.{1};", s, CSTypes[s]);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region void WriteEnums
|
||||
|
||||
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
|
||||
{
|
||||
Trace.WriteLine(String.Format("Writing enums to {0}.{1}", Settings.OutputNamespace, Settings.GLClass));
|
||||
|
||||
if (Settings.Compatibility == Settings.Legacy.None)
|
||||
{
|
||||
sw.WriteLine("public class Enums");
|
||||
sw.WriteLine("{");
|
||||
|
||||
sw.Indent();
|
||||
foreach (Bind.Structures.Enum @enum in enums.Values)
|
||||
{
|
||||
sw.Write(@enum);
|
||||
sw.WriteLine();
|
||||
}
|
||||
sw.Unindent();
|
||||
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
else if (Settings.Compatibility == Settings.Legacy.Tao)
|
||||
{
|
||||
// Tao legacy mode: dump all enums as constants in GLClass.
|
||||
foreach (Bind.Structures.Constant c in enums[Settings.CompleteEnumName].ConstantCollection.Values)
|
||||
{
|
||||
// Print constants avoiding circular definitions
|
||||
if (c.Name != c.Value)
|
||||
{
|
||||
sw.WriteLine(String.Format(
|
||||
"public const int {0} = {2}((int){1});",
|
||||
c.Name.StartsWith("GL_") ? c.Name : "GL_" + c.Name,
|
||||
Char.IsDigit(c.Value[0]) ? c.Value : c.Value.StartsWith("GL_") ? c.Value : "GL_" + c.Value,
|
||||
c.Unchecked ? "unchecked" : ""));
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace Bind
|
|||
{
|
||||
interface ISpecWriter
|
||||
{
|
||||
void WriteBindings(DelegateCollection delegates, FunctionCollection functions,
|
||||
EnumCollection enums);
|
||||
void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates);
|
||||
void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes);
|
||||
void WriteEnums(BindStreamWriter sw, EnumCollection enums);
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Bind
|
|||
{
|
||||
static class Settings
|
||||
{
|
||||
public static string InputPath = "..\\..\\..\\Source\\Bind\\Specifications\\gl2";
|
||||
public static string InputPath = "..\\..\\..\\Source\\Bind\\Specifications";
|
||||
public static string OutputPath = "..\\..\\..\\Source\\OpenTK\\OpenGL\\Bindings";
|
||||
public static string OutputNamespace = "OpenTK.OpenGL";
|
||||
public static string GLClass = "GL";
|
||||
|
@ -34,11 +34,13 @@ namespace Bind
|
|||
/// The name of the C# enum which holds every single OpenGL enum (for compatibility purposes).
|
||||
/// </summary>
|
||||
public static string CompleteEnumName = "All";
|
||||
|
||||
|
||||
public enum Legacy
|
||||
{
|
||||
None,
|
||||
Tao,
|
||||
}
|
||||
|
||||
public static string WindowsPlatform = "OpenTK.Platform.Windows.API";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
BOOL,*,*, BOOL,*,*
|
||||
DWORD,*,*, DWORD,*,*
|
||||
FLOAT,*,*, FLOAT,*,*
|
||||
GLboolean,*,*, GLboolean,*,*
|
||||
GLfloat,*,*, GLfloat,*,*
|
||||
GLsizei,*,*, GLsizei,*,*
|
||||
GLuint,*,*, GLuint,*,*
|
||||
GLushort,*,*, GLushort,*,*
|
||||
HANDLE,*,*, HANDLE,*,*
|
||||
HDC,*,*, HDC,*,*
|
||||
HGLRC,*,*, HGLRC,*,*
|
||||
HPBUFFERARB,*,*, HPBUFFERARB,*,*
|
||||
HPBUFFEREXT,*,*, HPBUFFEREXT,*,*
|
||||
INT32,*,*, INT32,*,*
|
||||
INT64,*,*, INT64,*,*
|
||||
LPVOID,*,*, LPVOID,*,*
|
||||
String,*,*, const char *,*,*
|
||||
UINT,*,*, UINT,*,*
|
||||
USHORT,*,*, USHORT,*,*
|
||||
VOID,*,*, VOID,*,*
|
||||
VoidPointer,*,*, void*,*,*
|
||||
float,*,*, float,*,*
|
||||
int,*,*, int,*,*
|
||||
void,*,*, *,*,*
|
||||
BOOL,*,*, BOOL,*,*
|
||||
DWORD,*,*, DWORD,*,*
|
||||
FLOAT,*,*, FLOAT,*,*
|
||||
GLboolean,*,*, GLboolean,*,*
|
||||
GLfloat,*,*, GLfloat,*,*
|
||||
GLsizei,*,*, GLsizei,*,*
|
||||
GLuint,*,*, GLuint,*,*
|
||||
GLushort,*,*, GLushort,*,*
|
||||
HANDLE,*,*, HANDLE,*,*
|
||||
HDC,*,*, HDC,*,*
|
||||
HGLRC,*,*, HGLRC,*,*
|
||||
HPBUFFERARB,*,*, HPBUFFERARB,*,*
|
||||
HPBUFFEREXT,*,*, HPBUFFEREXT,*,*
|
||||
INT32,*,*, INT32,*,*
|
||||
INT64,*,*, INT64,*,*
|
||||
LPVOID,*,*, LPVOID,*,*
|
||||
#String,*,*, const char *,*,*
|
||||
UINT,*,*, UINT,*,*
|
||||
USHORT,*,*, USHORT,*,*
|
||||
VOID,*,*, VOID,*,*
|
||||
VoidPointer,*,*, void*,*,*
|
||||
float,*,*, float,*,*
|
||||
int,*,*, int,*,*
|
||||
#void,*,*, *,*,*
|
||||
|
|
|
@ -3,10 +3,10 @@ GLsizei, Int32
|
|||
GLsizeiptr, IntPtr
|
||||
GLintptr, IntPtr
|
||||
# GLenum, Int32
|
||||
GLboolean, Boolean #Int32
|
||||
GLboolean, Boolean #Int32
|
||||
GLbitfield, UInt32
|
||||
# GLvoid*, IntPtr
|
||||
# GLvoid, Void #Object
|
||||
# GLvoid*, IntPtr
|
||||
# GLvoid, Void #Object
|
||||
GLchar, Char
|
||||
GLbyte, SByte
|
||||
GLubyte, Byte
|
||||
|
@ -33,3 +33,27 @@ GLint64EXT, Int64
|
|||
GLuint64EXT, UInt64
|
||||
GLint64, Int64
|
||||
GLuint64, UInt64
|
||||
|
||||
# Wgl types.
|
||||
PROC, IntPtr
|
||||
LPCSTR, String
|
||||
COLORREF, Int32
|
||||
BOOL, Boolean
|
||||
DWORD, Int32
|
||||
FLOAT, Single
|
||||
HANDLE, IntPtr
|
||||
HDC, IntPtr
|
||||
HGLRC, IntPtr
|
||||
HPBUFFERARB, IntPtr #HPBUFFERARB
|
||||
HPBUFFEREXT, IntPtr #HPBUFFEREXT
|
||||
INT32, Int32
|
||||
INT64, Int64
|
||||
LPVOID, void*
|
||||
#String, const char *
|
||||
UINT, UInt32
|
||||
USHORT, UInt16
|
||||
VOID, Void
|
||||
VoidPointer, void*
|
||||
float, float
|
||||
int, int
|
||||
#void, *
|
|
@ -847,8 +847,9 @@ namespace Bind.Structures
|
|||
|
||||
protected virtual void TranslateParameters()
|
||||
{
|
||||
if (this.Name.Contains("MultiTexCoord1"))
|
||||
if (this.Name.Contains("SetLayerPaletteEntries"))
|
||||
{
|
||||
// Console.WriteLine();
|
||||
}
|
||||
for (int i = 0; i < Parameters.Count; i++)
|
||||
{
|
||||
|
@ -867,6 +868,24 @@ namespace Bind.Structures
|
|||
//IsPointer = true;
|
||||
Parameters[i].Array = 1;
|
||||
}
|
||||
|
||||
if (Parameters[i].CurrentType == "PIXELFORMATDESCRIPTOR")
|
||||
{
|
||||
Parameters[i].CurrentType = Settings.WindowsPlatform + ".PixelFormatDescriptor";
|
||||
}
|
||||
else if (Parameters[i].CurrentType == "LAYERPLANEDESCRIPTOR")
|
||||
{
|
||||
Parameters[i].CurrentType = Settings.WindowsPlatform + ".LayerPlaneDescriptor";
|
||||
}
|
||||
else if (Parameters[i].CurrentType == "LPCSTR")
|
||||
{
|
||||
// TODO: Why doesn't the cs typemap work for LPCSTR and COLORREF?
|
||||
Parameters[i].CurrentType = "String";
|
||||
}
|
||||
else if (Parameters[i].CurrentType == "COLORREF")
|
||||
{
|
||||
Parameters[i].CurrentType = "Int32";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace Bind.Structures
|
|||
Enum @enum;
|
||||
string s;
|
||||
Parameter p = new Parameter(par);
|
||||
|
||||
|
||||
// Translate enum types
|
||||
if (Enum.GLEnums.TryGetValue(p.CurrentType, out @enum) && @enum.Name != "GLenum")
|
||||
{
|
||||
|
|
|
@ -196,7 +196,8 @@ namespace Bind
|
|||
if (name.EndsWith("SGIS")) { return "SGIS"; }
|
||||
if (name.EndsWith("SGIX")) { return "SGIX"; }
|
||||
if (name.EndsWith("MESA")) { return "MESA"; }
|
||||
if (name.EndsWith("G3DFX")) { return "G3DFX"; }
|
||||
if (name.EndsWith("3DFX")) { return "3DFX"; }
|
||||
if (name.EndsWith("INTEL")) { return "INTEL"; }
|
||||
if (name.EndsWith("IBM")) { return "IBM"; }
|
||||
if (name.EndsWith("GREMEDY")) { return "GREMEDY"; }
|
||||
if (name.EndsWith("HP")) { return "HP"; }
|
||||
|
@ -238,9 +239,13 @@ namespace Bind
|
|||
|
||||
#endregion
|
||||
|
||||
#region internal static string StripGL2Extension(string p)
|
||||
|
||||
internal static string StripGL2Extension(string p)
|
||||
{
|
||||
return p.Substring(0, p.Length - GetGL2Extension(p).Length);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Bind.Wgl
|
||||
{
|
||||
|
@ -15,17 +16,41 @@ namespace Bind.Wgl
|
|||
public Generator(string path)
|
||||
: base(path)
|
||||
{
|
||||
glTypemap = "wgl.tm";
|
||||
csTypemap = "..\\gl2\\csharp.tm";
|
||||
enumSpec = "wglenum.spec";
|
||||
enumSpecExt = "wglenumext.spec";
|
||||
glSpec = "wgl.spec";
|
||||
glSpecExt = "wglext.spec";
|
||||
glTypemap = "Wgl\\wgl.tm";
|
||||
csTypemap = "csharp.tm";
|
||||
enumSpec = "Wgl\\wglenum.spec";
|
||||
enumSpecExt = "Wgl\\wglenumext.spec";
|
||||
glSpec = "Wgl\\wgl.spec";
|
||||
glSpecExt = "Wgl\\wglext.spec";
|
||||
|
||||
importsFile = "WglCore.cs";
|
||||
delegatesFile = "WglDelegates.cs";
|
||||
enumsFile = "WglEnums.cs";
|
||||
wrappersFile = "Wgl.cs";
|
||||
|
||||
className = "Wgl";
|
||||
}
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
base.Process();
|
||||
Bind.Structures.Type.Initialize(glTypemap, csTypemap);
|
||||
Bind.Structures.Enum.Initialize(enumSpec, enumSpecExt);
|
||||
Bind.Structures.Function.Initialize();
|
||||
Bind.Structures.Delegate.Initialize(glSpec, glSpecExt);
|
||||
|
||||
// Process enums and delegates - create wrappers.
|
||||
Trace.WriteLine("Processing specs, please wait...");
|
||||
this.Translate();
|
||||
|
||||
this.WriteBindings(
|
||||
Bind.Structures.Delegate.Delegates,
|
||||
Bind.Structures.Function.Wrappers,
|
||||
Bind.Structures.Enum.GLEnums);
|
||||
}
|
||||
|
||||
public override Bind.Structures.DelegateCollection ReadDelegates(System.IO.StreamReader specFile)
|
||||
{
|
||||
return base.ReadDelegates(specFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14940,115 +14940,6 @@ namespace OpenTK.OpenGL
|
|||
unsafe { Delegates.glUniformMatrix4x3fv((Int32)location, (Int32)count, (GL.Enums.Boolean)transpose, (Single*)value); }
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void VertexPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glVertexPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void VertexPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glVertexPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void NormalPointervINTEL(GL.Enums.NormalPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glNormalPointervINTEL((GL.Enums.NormalPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void NormalPointervINTEL(GL.Enums.NormalPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glNormalPointervINTEL((GL.Enums.NormalPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void ColorPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glColorPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void ColorPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glColorPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void TexCoordPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glTexCoordPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void TexCoordPointervINTEL(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glTexCoordPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
void TbufferMask3DFX(UInt32 mask)
|
||||
{
|
||||
Delegates.glTbufferMask3DFX((UInt32)mask);
|
||||
}
|
||||
|
||||
public static
|
||||
void TbufferMask3DFX(Int32 mask)
|
||||
{
|
||||
Delegates.glTbufferMask3DFX((UInt32)mask);
|
||||
}
|
||||
|
||||
public static class ARB
|
||||
{
|
||||
public static
|
||||
|
@ -31749,6 +31640,106 @@ namespace OpenTK.OpenGL
|
|||
|
||||
}
|
||||
|
||||
public static class INTEL
|
||||
{
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void VertexPointerv(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glVertexPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void VertexPointerv(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glVertexPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void NormalPointerv(GL.Enums.NormalPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glNormalPointervINTEL((GL.Enums.NormalPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void NormalPointerv(GL.Enums.NormalPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glNormalPointervINTEL((GL.Enums.NormalPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void ColorPointerv(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glColorPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void ColorPointerv(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glColorPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
unsafe void TexCoordPointerv(Int32 size, GL.Enums.VertexPointerType type, void* pointer)
|
||||
{
|
||||
unsafe { Delegates.glTexCoordPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer); }
|
||||
}
|
||||
|
||||
public static
|
||||
void TexCoordPointerv(Int32 size, GL.Enums.VertexPointerType type, [In, Out] object pointer)
|
||||
{
|
||||
System.Runtime.InteropServices.GCHandle pointer_ptr = System.Runtime.InteropServices.GCHandle.Alloc(pointer, System.Runtime.InteropServices.GCHandleType.Pinned);
|
||||
unsafe
|
||||
{
|
||||
try
|
||||
{
|
||||
Delegates.glTexCoordPointervINTEL((Int32)size, (GL.Enums.VertexPointerType)type, (void*)pointer_ptr.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pointer_ptr.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class SUNX
|
||||
{
|
||||
public static
|
||||
|
@ -59517,6 +59508,23 @@ namespace OpenTK.OpenGL
|
|||
|
||||
}
|
||||
|
||||
public static class GL_3DFX
|
||||
{
|
||||
[System.CLSCompliant(false)]
|
||||
public static
|
||||
void TbufferMask(UInt32 mask)
|
||||
{
|
||||
Delegates.glTbufferMask3DFX((UInt32)mask);
|
||||
}
|
||||
|
||||
public static
|
||||
void TbufferMask(Int32 mask)
|
||||
{
|
||||
Delegates.glTbufferMask3DFX((UInt32)mask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class ATI
|
||||
{
|
||||
[System.CLSCompliant(false)]
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -2779,7 +2779,7 @@ namespace OpenTK.OpenGL
|
|||
TEXTURE16 = ((int)0x84D0),
|
||||
TEXTURE11 = ((int)0x84CB),
|
||||
TEXTURE10 = ((int)0x84CA),
|
||||
R5_G6_B5_A8_ICC_SGIX = ((int)SGIX_icc_texture.R5_G6_B5_A8_ICC_SGIX),
|
||||
R5_G6_B5_A8_ICC_SGIX = ((int)0x8467),
|
||||
COMPRESSED_LUMINANCE_ALPHA_ARB = ((int)0x84EB),
|
||||
RGBA16_EXT = ((int)0x805B),
|
||||
MAX_MODELVIEW_STACK_DEPTH = ((int)0x0D36),
|
||||
|
@ -3537,7 +3537,7 @@ namespace OpenTK.OpenGL
|
|||
ARRAY_ELEMENT_LOCK_FIRST_EXT = ((int)0x81A8),
|
||||
OUTPUT_TEXTURE_COORD26_EXT = ((int)0x87B7),
|
||||
OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = ((int)0x8852),
|
||||
R5_G6_B5_ICC_SGIX = ((int)SGIX_icc_texture.R5_G6_B5_ICC_SGIX),
|
||||
R5_G6_B5_ICC_SGIX = ((int)0x8466),
|
||||
GENERATE_MIPMAP_HINT_SGIS = ((int)0x8192),
|
||||
MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = ((int)0x8DE4),
|
||||
HISTOGRAM_LUMINANCE_SIZE_EXT = ((int)0x802C),
|
||||
|
@ -3551,7 +3551,7 @@ namespace OpenTK.OpenGL
|
|||
OBJECT_LINEAR = ((int)0x2401),
|
||||
CON_19_ATI = ((int)0x8954),
|
||||
LIGHT7 = ((int)0x4007),
|
||||
ALPHA16_ICC_SGIX = ((int)SGIX_icc_texture.ALPHA16_ICC_SGIX),
|
||||
ALPHA16_ICC_SGIX = ((int)0x8468),
|
||||
STENCIL_PASS_DEPTH_PASS = ((int)0x0B96),
|
||||
OUTPUT_TEXTURE_COORD16_EXT = ((int)0x87AD),
|
||||
MAX_PROJECTION_STACK_DEPTH = ((int)0x0D38),
|
||||
|
@ -3613,7 +3613,7 @@ namespace OpenTK.OpenGL
|
|||
TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = ((int)0x8C85),
|
||||
INDEX_MODE = ((int)0x0C30),
|
||||
OUTPUT_TEXTURE_COORD12_EXT = ((int)0x87A9),
|
||||
INTENSITY16_ICC_SGIX = ((int)SGIX_icc_texture.INTENSITY16_ICC_SGIX),
|
||||
INTENSITY16_ICC_SGIX = ((int)0x846A),
|
||||
REG_28_ATI = ((int)0x893D),
|
||||
RED_MAX_CLAMP_INGR = ((int)0x8564),
|
||||
POINT_SMOOTH_HINT = ((int)0x0C51),
|
||||
|
@ -3779,7 +3779,7 @@ namespace OpenTK.OpenGL
|
|||
POINT_SPRITE_NV = ((int)0x8861),
|
||||
IMAGE_TRANSLATE_Y_HP = ((int)0x8158),
|
||||
PROGRAM_BINDING_ARB = ((int)0x8677),
|
||||
LUMINANCE_ALPHA_ICC_SGIX = ((int)SGIX_icc_texture.LUMINANCE_ALPHA_ICC_SGIX),
|
||||
LUMINANCE_ALPHA_ICC_SGIX = ((int)0x8465),
|
||||
CON_15_ATI = ((int)0x8950),
|
||||
REDUCE = ((int)0x8016),
|
||||
RESAMPLE_ZERO_FILL_SGIX = ((int)0x842F),
|
||||
|
@ -4315,7 +4315,7 @@ namespace OpenTK.OpenGL
|
|||
STENCIL_VALUE_MASK = ((int)0x0B93),
|
||||
SRC_ALPHA = ((int)0x0302),
|
||||
DUAL_LUMINANCE4_SGIS = ((int)0x8114),
|
||||
ALPHA_ICC_SGIX = ((int)SGIX_icc_texture.ALPHA_ICC_SGIX),
|
||||
ALPHA_ICC_SGIX = ((int)0x8462),
|
||||
UNPACK_SKIP_IMAGES = ((int)0x806D),
|
||||
TEXTURE_PRE_SPECULAR_HP = ((int)0x8169),
|
||||
LIGHT_ENV_MODE_SGIX = ((int)0x8407),
|
||||
|
@ -4371,7 +4371,7 @@ namespace OpenTK.OpenGL
|
|||
MUL_ATI = ((int)0x8964),
|
||||
GREEN_BIT_ATI = ((int)0x00000002),
|
||||
PIXEL_MAP_I_TO_B_SIZE = ((int)0x0CB4),
|
||||
LUMINANCE_ICC_SGIX = ((int)SGIX_icc_texture.LUMINANCE_ICC_SGIX),
|
||||
LUMINANCE_ICC_SGIX = ((int)0x8463),
|
||||
REPLACE_MIDDLE_SUN = ((int)0x0002),
|
||||
TEXTURE_CUBE_MAP_POSITIVE_Y = ((int)0x8517),
|
||||
FALSE = ((int)0),
|
||||
|
@ -4433,7 +4433,7 @@ namespace OpenTK.OpenGL
|
|||
STENCIL_BACK_PASS_DEPTH_FAIL = ((int)0x8802),
|
||||
TEXTURE_WRAP_S = ((int)0x2802),
|
||||
DOUBLE = ((int)0x140A),
|
||||
RGB_ICC_SGIX = ((int)SGIX_icc_texture.RGB_ICC_SGIX),
|
||||
RGB_ICC_SGIX = ((int)0x8460),
|
||||
QUAD_LUMINANCE8_SGIS = ((int)0x8121),
|
||||
TEXTURE_ENV_MODE = ((int)0x2200),
|
||||
MAX_PROGRAM_PARAMETERS_ARB = ((int)0x88A9),
|
||||
|
@ -4546,7 +4546,7 @@ namespace OpenTK.OpenGL
|
|||
INT_SAMPLER_2D_RECT_EXT = ((int)0x8DCD),
|
||||
SPRITE_AXIS_SGIX = ((int)0x814A),
|
||||
OP_MOV_EXT = ((int)0x8799),
|
||||
RGBA_ICC_SGIX = ((int)SGIX_icc_texture.RGBA_ICC_SGIX),
|
||||
RGBA_ICC_SGIX = ((int)0x8461),
|
||||
QUERY_RESULT_AVAILABLE_ARB = ((int)0x8867),
|
||||
LUMINANCE12_EXT = ((int)0x8041),
|
||||
DRAW_BUFFER = ((int)0x0C01),
|
||||
|
@ -4583,7 +4583,7 @@ namespace OpenTK.OpenGL
|
|||
UNSIGNED_INT_10F_11F_11F_REV_EXT = ((int)0x8C3B),
|
||||
QUADRATIC_ATTENUATION = ((int)0x1209),
|
||||
ADD_SIGNED_EXT = ((int)0x8574),
|
||||
LUMINANCE16_ALPHA8_ICC_SGIX = ((int)SGIX_icc_texture.LUMINANCE16_ALPHA8_ICC_SGIX),
|
||||
LUMINANCE16_ALPHA8_ICC_SGIX = ((int)0x846B),
|
||||
DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = ((int)0x885A),
|
||||
GREATER = ((int)0x0204),
|
||||
MAX = ((int)0x8008),
|
||||
|
@ -4867,7 +4867,7 @@ namespace OpenTK.OpenGL
|
|||
MODELVIEW1_ARB = ((int)0x850A),
|
||||
EDGE_FLAG_ARRAY_STRIDE = ((int)0x808C),
|
||||
Q = ((int)0x2003),
|
||||
LUMINANCE16_ICC_SGIX = ((int)SGIX_icc_texture.LUMINANCE16_ICC_SGIX),
|
||||
LUMINANCE16_ICC_SGIX = ((int)0x8469),
|
||||
S = ((int)0x2000),
|
||||
T = ((int)0x2001),
|
||||
MAX_VARYING_FLOATS = ((int)0x8B4B),
|
||||
|
@ -4931,7 +4931,7 @@ namespace OpenTK.OpenGL
|
|||
MAX_CLIP_PLANES = ((int)0x0D32),
|
||||
TEXTURE23_ARB = ((int)0x84D7),
|
||||
RESAMPLE_AVERAGE_OML = ((int)0x8988),
|
||||
INTENSITY_ICC_SGIX = ((int)SGIX_icc_texture.INTENSITY_ICC_SGIX),
|
||||
INTENSITY_ICC_SGIX = ((int)0x8464),
|
||||
VENDOR = ((int)0x1F00),
|
||||
TIME_ELAPSED_EXT = ((int)0x88BF),
|
||||
NAND = ((int)0x150E),
|
||||
|
@ -5571,22 +5571,6 @@ namespace OpenTK.OpenGL
|
|||
INTENSITY_FLOAT16_ATI = ((int)0x881D),
|
||||
}
|
||||
|
||||
public enum SGIX_icc_texture
|
||||
{
|
||||
RGBA_ICC_SGIX = ((int)0x8461),
|
||||
INTENSITY_ICC_SGIX = ((int)0x8464),
|
||||
ALPHA_ICC_SGIX = ((int)0x8462),
|
||||
LUMINANCE_ICC_SGIX = ((int)0x8463),
|
||||
LUMINANCE16_ICC_SGIX = ((int)0x8469),
|
||||
R5_G6_B5_ICC_SGIX = ((int)0x8466),
|
||||
ALPHA16_ICC_SGIX = ((int)0x8468),
|
||||
INTENSITY16_ICC_SGIX = ((int)0x846A),
|
||||
RGB_ICC_SGIX = ((int)0x8460),
|
||||
LUMINANCE_ALPHA_ICC_SGIX = ((int)0x8465),
|
||||
R5_G6_B5_A8_ICC_SGIX = ((int)0x8467),
|
||||
LUMINANCE16_ALPHA8_ICC_SGIX = ((int)0x846B),
|
||||
}
|
||||
|
||||
public enum ARB_imaging
|
||||
{
|
||||
CONVOLUTION_WIDTH = ((int)0x8018),
|
||||
|
@ -8461,6 +8445,22 @@ namespace OpenTK.OpenGL
|
|||
LUMINANCE_ALPHA16UI_EXT = ((int)0x8D7B),
|
||||
}
|
||||
|
||||
public enum SGIX_icc_texture
|
||||
{
|
||||
RGBA_ICC_SGIX = ((int)0x8461),
|
||||
INTENSITY_ICC_SGIX = ((int)0x8464),
|
||||
ALPHA_ICC_SGIX = ((int)0x8462),
|
||||
LUMINANCE_ICC_SGIX = ((int)0x8463),
|
||||
LUMINANCE16_ICC_SGIX = ((int)0x8469),
|
||||
R5_G6_B5_ICC_SGIX = ((int)0x8466),
|
||||
ALPHA16_ICC_SGIX = ((int)0x8468),
|
||||
INTENSITY16_ICC_SGIX = ((int)0x846A),
|
||||
RGB_ICC_SGIX = ((int)0x8460),
|
||||
LUMINANCE_ALPHA_ICC_SGIX = ((int)0x8465),
|
||||
R5_G6_B5_A8_ICC_SGIX = ((int)0x8467),
|
||||
LUMINANCE16_ALPHA8_ICC_SGIX = ((int)0x846B),
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
6996
Source/OpenTK/OpenGL/Bindings/Wgl.cs
Normal file
6996
Source/OpenTK/OpenGL/Bindings/Wgl.cs
Normal file
File diff suppressed because it is too large
Load diff
81
Source/OpenTK/OpenGL/Bindings/WglCore.cs
Normal file
81
Source/OpenTK/OpenGL/Bindings/WglCore.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
namespace OpenTK.OpenGL
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
partial class Wgl
|
||||
{
|
||||
|
||||
internal static class Imports
|
||||
{
|
||||
static Imports() { }
|
||||
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCreateContext", ExactSpelling = true)]
|
||||
internal extern static IntPtr CreateContext(IntPtr hDc);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glDeleteContext", ExactSpelling = true)]
|
||||
internal extern static Boolean DeleteContext(IntPtr oldContext);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetCurrentContext", ExactSpelling = true)]
|
||||
internal extern static IntPtr GetCurrentContext();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glMakeCurrent", ExactSpelling = true)]
|
||||
internal extern static Boolean MakeCurrent(IntPtr hDc, IntPtr newContext);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCopyContext", 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)]
|
||||
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)]
|
||||
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)]
|
||||
internal extern static IntPtr GetCurrentDC();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetDefaultProcAddress", ExactSpelling = true)]
|
||||
internal extern static IntPtr GetDefaultProcAddress(String lpszProc);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetProcAddress", ExactSpelling = true)]
|
||||
internal extern static IntPtr GetProcAddress(String lpszProc);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glGetPixelFormat", ExactSpelling = true)]
|
||||
internal extern static int GetPixelFormat(IntPtr hdc);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSetPixelFormat", 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)]
|
||||
internal extern static Boolean SwapBuffers(IntPtr hdc);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glShareLists", ExactSpelling = true)]
|
||||
internal extern static Boolean ShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glCreateLayerContext", ExactSpelling = true)]
|
||||
internal extern static IntPtr CreateLayerContext(IntPtr hDc, int level);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glDescribeLayerPlane", 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)]
|
||||
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)]
|
||||
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)]
|
||||
internal extern static Boolean RealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glSwapLayerBuffers", ExactSpelling = true)]
|
||||
internal extern static Boolean SwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(Wgl.Library, EntryPoint = "glUseFontBitmapsA", 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)]
|
||||
internal extern static Boolean UseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
|
||||
}
|
||||
}
|
||||
}
|
303
Source/OpenTK/OpenGL/Bindings/WglDelegates.cs
Normal file
303
Source/OpenTK/OpenGL/Bindings/WglDelegates.cs
Normal file
|
@ -0,0 +1,303 @@
|
|||
namespace OpenTK.OpenGL
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
partial class Wgl
|
||||
{
|
||||
|
||||
internal static class Delegates
|
||||
{
|
||||
static Delegates()
|
||||
{
|
||||
Wgl.ReloadFunctions();
|
||||
}
|
||||
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr CreateContext(IntPtr hDc);
|
||||
internal static CreateContext glCreateContext = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean DeleteContext(IntPtr oldContext);
|
||||
internal static DeleteContext glDeleteContext = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetCurrentContext();
|
||||
internal static GetCurrentContext glGetCurrentContext = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean MakeCurrent(IntPtr hDc, IntPtr newContext);
|
||||
internal static MakeCurrent glMakeCurrent = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean CopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, UInt32 mask);
|
||||
internal static CopyContext glCopyContext = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int ChoosePixelFormat(IntPtr hDc, OpenTK.Platform.Windows.API.PixelFormatDescriptor pPfd);
|
||||
internal static ChoosePixelFormat glChoosePixelFormat = 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;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetCurrentDC();
|
||||
internal static GetCurrentDC glGetCurrentDC = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetDefaultProcAddress(String lpszProc);
|
||||
internal static GetDefaultProcAddress glGetDefaultProcAddress = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetProcAddress(String lpszProc);
|
||||
internal static GetProcAddress glGetProcAddress = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int GetPixelFormat(IntPtr hdc);
|
||||
internal static GetPixelFormat glGetPixelFormat = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean SetPixelFormat(IntPtr hdc, int ipfd, OpenTK.Platform.Windows.API.PixelFormatDescriptor ppfd);
|
||||
internal static SetPixelFormat glSetPixelFormat = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean SwapBuffers(IntPtr hdc);
|
||||
internal static SwapBuffers glSwapBuffers = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean ShareLists(IntPtr hrcSrvShare, IntPtr hrcSrvSource);
|
||||
internal static ShareLists glShareLists = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr CreateLayerContext(IntPtr hDc, int level);
|
||||
internal static CreateLayerContext glCreateLayerContext = 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;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int SetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
|
||||
internal static SetLayerPaletteEntries glSetLayerPaletteEntries = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int GetLayerPaletteEntries(IntPtr hdc, int iLayerPlane, int iStart, int cEntries, Int32 pcr);
|
||||
internal static GetLayerPaletteEntries glGetLayerPaletteEntries = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean RealizeLayerPalette(IntPtr hdc, int iLayerPlane, Boolean bRealize);
|
||||
internal static RealizeLayerPalette glRealizeLayerPalette = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean SwapLayerBuffers(IntPtr hdc, UInt32 fuFlags);
|
||||
internal static SwapLayerBuffers glSwapLayerBuffers = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean UseFontBitmapsA(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
|
||||
internal static UseFontBitmapsA glUseFontBitmapsA = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean UseFontBitmapsW(IntPtr hDC, Int32 first, Int32 count, Int32 listBase);
|
||||
internal static UseFontBitmapsW glUseFontBitmapsW = null;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr CreateBufferRegionARB(IntPtr hDC, int iLayerPlane, UInt32 uType);
|
||||
internal static CreateBufferRegionARB glCreateBufferRegionARB = (CreateBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glCreateBufferRegionARB", typeof(CreateBufferRegionARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DeleteBufferRegionARB(IntPtr hRegion);
|
||||
internal static DeleteBufferRegionARB glDeleteBufferRegionARB = (DeleteBufferRegionARB)Wgl.GetDelegateForExtensionMethod("glDeleteBufferRegionARB", typeof(DeleteBufferRegionARB));
|
||||
[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));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetExtensionsStringARB(IntPtr hdc);
|
||||
internal static GetExtensionsStringARB glGetExtensionsStringARB = (GetExtensionsStringARB)Wgl.GetDelegateForExtensionMethod("glGetExtensionsStringARB", typeof(GetExtensionsStringARB));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean MakeContextCurrentARB(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);
|
||||
internal static MakeContextCurrentARB glMakeContextCurrentARB = (MakeContextCurrentARB)Wgl.GetDelegateForExtensionMethod("glMakeContextCurrentARB", typeof(MakeContextCurrentARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetCurrentReadDCARB();
|
||||
internal static GetCurrentReadDCARB glGetCurrentReadDCARB = (GetCurrentReadDCARB)Wgl.GetDelegateForExtensionMethod("glGetCurrentReadDCARB", typeof(GetCurrentReadDCARB));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetPbufferDCARB(IntPtr hPbuffer);
|
||||
internal static GetPbufferDCARB glGetPbufferDCARB = (GetPbufferDCARB)Wgl.GetDelegateForExtensionMethod("glGetPbufferDCARB", typeof(GetPbufferDCARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int ReleasePbufferDCARB(IntPtr hPbuffer, IntPtr hDC);
|
||||
internal static ReleasePbufferDCARB glReleasePbufferDCARB = (ReleasePbufferDCARB)Wgl.GetDelegateForExtensionMethod("glReleasePbufferDCARB", typeof(ReleasePbufferDCARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean DestroyPbufferARB(IntPtr hPbuffer);
|
||||
internal static DestroyPbufferARB glDestroyPbufferARB = (DestroyPbufferARB)Wgl.GetDelegateForExtensionMethod("glDestroyPbufferARB", typeof(DestroyPbufferARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean QueryPbufferARB(IntPtr hPbuffer, int iAttribute, [Out] int piValue);
|
||||
internal static QueryPbufferARB glQueryPbufferARB = (QueryPbufferARB)Wgl.GetDelegateForExtensionMethod("glQueryPbufferARB", typeof(QueryPbufferARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean BindTexImageARB(IntPtr hPbuffer, int iBuffer);
|
||||
internal static BindTexImageARB glBindTexImageARB = (BindTexImageARB)Wgl.GetDelegateForExtensionMethod("glBindTexImageARB", typeof(BindTexImageARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean ReleaseTexImageARB(IntPtr hPbuffer, int iBuffer);
|
||||
internal static ReleaseTexImageARB glReleaseTexImageARB = (ReleaseTexImageARB)Wgl.GetDelegateForExtensionMethod("glReleaseTexImageARB", typeof(ReleaseTexImageARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate Boolean SetPbufferAttribARB(IntPtr hPbuffer, int* piAttribList);
|
||||
internal unsafe static SetPbufferAttribARB glSetPbufferAttribARB = (SetPbufferAttribARB)Wgl.GetDelegateForExtensionMethod("glSetPbufferAttribARB", typeof(SetPbufferAttribARB));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean CreateDisplayColorTableEXT(UInt16 id);
|
||||
internal static CreateDisplayColorTableEXT glCreateDisplayColorTableEXT = (CreateDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glCreateDisplayColorTableEXT", typeof(CreateDisplayColorTableEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate Boolean LoadDisplayColorTableEXT(UInt16* table, UInt32 length);
|
||||
internal unsafe static LoadDisplayColorTableEXT glLoadDisplayColorTableEXT = (LoadDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glLoadDisplayColorTableEXT", typeof(LoadDisplayColorTableEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean BindDisplayColorTableEXT(UInt16 id);
|
||||
internal static BindDisplayColorTableEXT glBindDisplayColorTableEXT = (BindDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glBindDisplayColorTableEXT", typeof(BindDisplayColorTableEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DestroyDisplayColorTableEXT(UInt16 id);
|
||||
internal static DestroyDisplayColorTableEXT glDestroyDisplayColorTableEXT = (DestroyDisplayColorTableEXT)Wgl.GetDelegateForExtensionMethod("glDestroyDisplayColorTableEXT", typeof(DestroyDisplayColorTableEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetExtensionsStringEXT();
|
||||
internal static GetExtensionsStringEXT glGetExtensionsStringEXT = (GetExtensionsStringEXT)Wgl.GetDelegateForExtensionMethod("glGetExtensionsStringEXT", typeof(GetExtensionsStringEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean MakeContextCurrentEXT(IntPtr hDrawDC, IntPtr hReadDC, IntPtr hglrc);
|
||||
internal static MakeContextCurrentEXT glMakeContextCurrentEXT = (MakeContextCurrentEXT)Wgl.GetDelegateForExtensionMethod("glMakeContextCurrentEXT", typeof(MakeContextCurrentEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetCurrentReadDCEXT();
|
||||
internal static GetCurrentReadDCEXT glGetCurrentReadDCEXT = (GetCurrentReadDCEXT)Wgl.GetDelegateForExtensionMethod("glGetCurrentReadDCEXT", typeof(GetCurrentReadDCEXT));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr GetPbufferDCEXT(IntPtr hPbuffer);
|
||||
internal static GetPbufferDCEXT glGetPbufferDCEXT = (GetPbufferDCEXT)Wgl.GetDelegateForExtensionMethod("glGetPbufferDCEXT", typeof(GetPbufferDCEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int ReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC);
|
||||
internal static ReleasePbufferDCEXT glReleasePbufferDCEXT = (ReleasePbufferDCEXT)Wgl.GetDelegateForExtensionMethod("glReleasePbufferDCEXT", typeof(ReleasePbufferDCEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean DestroyPbufferEXT(IntPtr hPbuffer);
|
||||
internal static DestroyPbufferEXT glDestroyPbufferEXT = (DestroyPbufferEXT)Wgl.GetDelegateForExtensionMethod("glDestroyPbufferEXT", typeof(DestroyPbufferEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean QueryPbufferEXT(IntPtr hPbuffer, int iAttribute, [Out] int piValue);
|
||||
internal static QueryPbufferEXT glQueryPbufferEXT = (QueryPbufferEXT)Wgl.GetDelegateForExtensionMethod("glQueryPbufferEXT", typeof(QueryPbufferEXT));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean SwapIntervalEXT(int interval);
|
||||
internal static SwapIntervalEXT glSwapIntervalEXT = (SwapIntervalEXT)Wgl.GetDelegateForExtensionMethod("glSwapIntervalEXT", typeof(SwapIntervalEXT));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int GetSwapIntervalEXT();
|
||||
internal static GetSwapIntervalEXT glGetSwapIntervalEXT = (GetSwapIntervalEXT)Wgl.GetDelegateForExtensionMethod("glGetSwapIntervalEXT", typeof(GetSwapIntervalEXT));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void FreeMemoryNV([Out] void* pointer);
|
||||
internal unsafe static FreeMemoryNV glFreeMemoryNV = (FreeMemoryNV)Wgl.GetDelegateForExtensionMethod("glFreeMemoryNV", typeof(FreeMemoryNV));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean EnableGenlockI3D(IntPtr hDC);
|
||||
internal static EnableGenlockI3D glEnableGenlockI3D = (EnableGenlockI3D)Wgl.GetDelegateForExtensionMethod("glEnableGenlockI3D", typeof(EnableGenlockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean DisableGenlockI3D(IntPtr hDC);
|
||||
internal static DisableGenlockI3D glDisableGenlockI3D = (DisableGenlockI3D)Wgl.GetDelegateForExtensionMethod("glDisableGenlockI3D", typeof(DisableGenlockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean IsEnabledGenlockI3D(IntPtr hDC, [Out] Boolean pFlag);
|
||||
internal static IsEnabledGenlockI3D glIsEnabledGenlockI3D = (IsEnabledGenlockI3D)Wgl.GetDelegateForExtensionMethod("glIsEnabledGenlockI3D", typeof(IsEnabledGenlockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GenlockSourceI3D(IntPtr hDC, UInt32 uSource);
|
||||
internal static GenlockSourceI3D glGenlockSourceI3D = (GenlockSourceI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceI3D", typeof(GenlockSourceI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GetGenlockSourceI3D(IntPtr hDC, [Out] UInt32 uSource);
|
||||
internal static GetGenlockSourceI3D glGetGenlockSourceI3D = (GetGenlockSourceI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceI3D", typeof(GetGenlockSourceI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GenlockSourceEdgeI3D(IntPtr hDC, UInt32 uEdge);
|
||||
internal static GenlockSourceEdgeI3D glGenlockSourceEdgeI3D = (GenlockSourceEdgeI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceEdgeI3D", typeof(GenlockSourceEdgeI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GetGenlockSourceEdgeI3D(IntPtr hDC, [Out] UInt32 uEdge);
|
||||
internal static GetGenlockSourceEdgeI3D glGetGenlockSourceEdgeI3D = (GetGenlockSourceEdgeI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceEdgeI3D", typeof(GetGenlockSourceEdgeI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GenlockSampleRateI3D(IntPtr hDC, UInt32 uRate);
|
||||
internal static GenlockSampleRateI3D glGenlockSampleRateI3D = (GenlockSampleRateI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSampleRateI3D", typeof(GenlockSampleRateI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GetGenlockSampleRateI3D(IntPtr hDC, [Out] UInt32 uRate);
|
||||
internal static GetGenlockSampleRateI3D glGetGenlockSampleRateI3D = (GetGenlockSampleRateI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSampleRateI3D", typeof(GetGenlockSampleRateI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GenlockSourceDelayI3D(IntPtr hDC, UInt32 uDelay);
|
||||
internal static GenlockSourceDelayI3D glGenlockSourceDelayI3D = (GenlockSourceDelayI3D)Wgl.GetDelegateForExtensionMethod("glGenlockSourceDelayI3D", typeof(GenlockSourceDelayI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GetGenlockSourceDelayI3D(IntPtr hDC, [Out] UInt32 uDelay);
|
||||
internal static GetGenlockSourceDelayI3D glGetGenlockSourceDelayI3D = (GetGenlockSourceDelayI3D)Wgl.GetDelegateForExtensionMethod("glGetGenlockSourceDelayI3D", typeof(GetGenlockSourceDelayI3D));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate IntPtr CreateImageBufferI3D(IntPtr hDC, Int32 dwSize, UInt32 uFlags);
|
||||
internal static CreateImageBufferI3D glCreateImageBufferI3D = (CreateImageBufferI3D)Wgl.GetDelegateForExtensionMethod("glCreateImageBufferI3D", typeof(CreateImageBufferI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate Boolean DestroyImageBufferI3D(IntPtr hDC, void* pAddress);
|
||||
internal unsafe static DestroyImageBufferI3D glDestroyImageBufferI3D = (DestroyImageBufferI3D)Wgl.GetDelegateForExtensionMethod("glDestroyImageBufferI3D", typeof(DestroyImageBufferI3D));
|
||||
[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));
|
||||
[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));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean EnableFrameLockI3D();
|
||||
internal static EnableFrameLockI3D glEnableFrameLockI3D = (EnableFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glEnableFrameLockI3D", typeof(EnableFrameLockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean DisableFrameLockI3D();
|
||||
internal static DisableFrameLockI3D glDisableFrameLockI3D = (DisableFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glDisableFrameLockI3D", typeof(DisableFrameLockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean IsEnabledFrameLockI3D([Out] Boolean pFlag);
|
||||
internal static IsEnabledFrameLockI3D glIsEnabledFrameLockI3D = (IsEnabledFrameLockI3D)Wgl.GetDelegateForExtensionMethod("glIsEnabledFrameLockI3D", typeof(IsEnabledFrameLockI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean QueryFrameLockMasterI3D([Out] Boolean pFlag);
|
||||
internal static QueryFrameLockMasterI3D glQueryFrameLockMasterI3D = (QueryFrameLockMasterI3D)Wgl.GetDelegateForExtensionMethod("glQueryFrameLockMasterI3D", typeof(QueryFrameLockMasterI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean GetFrameUsageI3D([Out] float pUsage);
|
||||
internal static GetFrameUsageI3D glGetFrameUsageI3D = (GetFrameUsageI3D)Wgl.GetDelegateForExtensionMethod("glGetFrameUsageI3D", typeof(GetFrameUsageI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean BeginFrameTrackingI3D();
|
||||
internal static BeginFrameTrackingI3D glBeginFrameTrackingI3D = (BeginFrameTrackingI3D)Wgl.GetDelegateForExtensionMethod("glBeginFrameTrackingI3D", typeof(BeginFrameTrackingI3D));
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Boolean EndFrameTrackingI3D();
|
||||
internal static EndFrameTrackingI3D glEndFrameTrackingI3D = (EndFrameTrackingI3D)Wgl.GetDelegateForExtensionMethod("glEndFrameTrackingI3D", typeof(EndFrameTrackingI3D));
|
||||
[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));
|
||||
}
|
||||
}
|
||||
}
|
505
Source/OpenTK/OpenGL/Bindings/WglEnums.cs
Normal file
505
Source/OpenTK/OpenGL/Bindings/WglEnums.cs
Normal file
|
@ -0,0 +1,505 @@
|
|||
namespace OpenTK.OpenGL
|
||||
{
|
||||
public static partial class Wgl
|
||||
{
|
||||
public class Enums
|
||||
{
|
||||
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),
|
||||
}
|
||||
|
||||
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_GREEN_BITS_EXT = ((int)0x2017),
|
||||
WGL_BLUE_BITS_EXT = ((int)0x2019),
|
||||
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_NO_ACCELERATION_EXT = ((int)0x2025),
|
||||
WGL_ACCUM_RED_BITS_EXT = ((int)0x201E),
|
||||
}
|
||||
|
||||
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_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_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_TRANSPARENT_ARB = ((int)0x200A),
|
||||
}
|
||||
|
||||
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_OPTIMAL_PBUFFER_HEIGHT_EXT = ((int)0x2032),
|
||||
WGL_DRAW_TO_PBUFFER_EXT = ((int)0x202D),
|
||||
WGL_MAX_PBUFFER_PIXELS_EXT = ((int)0x202E),
|
||||
}
|
||||
|
||||
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_PIXELS_ARB = ((int)0x202E),
|
||||
WGL_TRANSPARENT_GREEN_VALUE_ARB = ((int)0x2038),
|
||||
}
|
||||
|
||||
public enum WGL_EXT_depth_float
|
||||
{
|
||||
WGL_DEPTH_FLOAT_EXT = ((int)0x2040),
|
||||
}
|
||||
|
||||
public enum WGL_EXT_multisample
|
||||
{
|
||||
WGL_SAMPLES_EXT = ((int)0x2042),
|
||||
WGL_SAMPLE_BUFFERS_EXT = ((int)0x2041),
|
||||
}
|
||||
|
||||
public enum WGL_ARB_multisample
|
||||
{
|
||||
WGL_SAMPLE_BUFFERS_ARB = ((int)0x2041),
|
||||
WGL_SAMPLES_ARB = ((int)0x2042),
|
||||
}
|
||||
|
||||
public enum WGL_EXT_make_current_read
|
||||
{
|
||||
ERROR_INVALID_PIXEL_TYPE_EXT = ((int)0x2043),
|
||||
}
|
||||
|
||||
public enum WGL_ARB_make_current_read
|
||||
{
|
||||
ERROR_INVALID_PIXEL_TYPE_ARB = ((int)0x2043),
|
||||
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = ((int)0x2054),
|
||||
}
|
||||
|
||||
public enum WGL_I3D_genlock
|
||||
{
|
||||
WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = ((int)0x2045),
|
||||
WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = ((int)0x2047),
|
||||
WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D = ((int)0x2046),
|
||||
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),
|
||||
}
|
||||
|
||||
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),
|
||||
}
|
||||
|
||||
public enum WGL_3DFX_multisample
|
||||
{
|
||||
WGL_SAMPLES_3DFX = ((int)0x2061),
|
||||
WGL_SAMPLE_BUFFERS_3DFX = ((int)0x2060),
|
||||
}
|
||||
|
||||
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_TEXTURE_RGB_ARB = ((int)0x2075),
|
||||
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_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = ((int)0x207F),
|
||||
WGL_MIPMAP_TEXTURE_ARB = ((int)0x2074),
|
||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = ((int)0x2082),
|
||||
WGL_AUX7_ARB = ((int)0x208E),
|
||||
WGL_FRONT_LEFT_ARB = ((int)0x2083),
|
||||
WGL_MIPMAP_LEVEL_ARB = ((int)0x207B),
|
||||
WGL_AUX6_ARB = ((int)0x208D),
|
||||
WGL_AUX5_ARB = ((int)0x208C),
|
||||
}
|
||||
|
||||
public enum WGL_NV_render_texture_rectangle
|
||||
{
|
||||
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_TEXTURE_DEPTH_COMPONENT_NV = ((int)0x20A6),
|
||||
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_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = ((int)0x20B3),
|
||||
}
|
||||
|
||||
public enum WGL_ARB_pixel_format_float
|
||||
{
|
||||
WGL_TYPE_RGBA_FLOAT_ARB = ((int)0x21A0),
|
||||
}
|
||||
|
||||
public enum WGL_ATI_pixel_format_float
|
||||
{
|
||||
WGL_TYPE_RGBA_FLOAT_ATI = ((int)0x21A0),
|
||||
}
|
||||
|
||||
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_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_BIND_TO_TEXTURE_RGB_ARB = ((int)0x2070),
|
||||
}
|
||||
|
||||
public enum WGL_ARB_extensions_string
|
||||
{
|
||||
}
|
||||
|
||||
public enum WGL_I3D_image_buffer
|
||||
{
|
||||
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = ((int)0x00000001),
|
||||
WGL_IMAGE_BUFFER_LOCK_I3D = ((int)0x00000002),
|
||||
}
|
||||
|
||||
public enum WGL_I3D_swap_frame_lock
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
47
Source/OpenTK/OpenGL/Bindings/WglHelper.cs
Normal file
47
Source/OpenTK/OpenGL/Bindings/WglHelper.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
#region --- License ---
|
||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*
|
||||
* Date: 12/8/2007
|
||||
* Time: 6:43 μμ
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,10 +38,12 @@ namespace OpenTK.Platform.Windows
|
|||
using USHORT = System.UInt16;
|
||||
using LONG = System.Int32;
|
||||
using ULONG = System.UInt32;
|
||||
using WORD = System.Int16;
|
||||
using DWORD = System.Int32;
|
||||
using BOOL = System.Boolean;
|
||||
using INT = System.Int32;
|
||||
using UINT = System.UInt32;
|
||||
using COLORREF = System.Int32;
|
||||
using LONG_PTR = System.IntPtr;
|
||||
|
||||
using WNDPROC = System.IntPtr;
|
||||
|
@ -1280,7 +1282,7 @@ namespace OpenTK.Platform.Windows
|
|||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class PixelFormatDescriptor
|
||||
{
|
||||
short Size = 40; // No need for the user to set the size, since it is predefined.
|
||||
public readonly short Size = (short)Marshal.SizeOf(typeof(PixelFormatDescriptor)); // No need for the user to set the size, since it is predefined.
|
||||
public short Version = 1;
|
||||
public PixelFormatDescriptorFlags Flags =
|
||||
//PixelFormatDescriptorFlags.DOUBLEBUFFER |
|
||||
|
@ -1311,6 +1313,42 @@ namespace OpenTK.Platform.Windows
|
|||
public int DamageMask = 0;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region public class LayerPlaneDescriptor
|
||||
|
||||
/// <summary>
|
||||
/// Describes the pixel format of a drawing surface.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class LayerPlaneDescriptor
|
||||
{
|
||||
public readonly WORD Size = (WORD)Marshal.SizeOf(typeof(PixelFormatDescriptor));
|
||||
public WORD Version;
|
||||
public DWORD Flags;
|
||||
public BYTE PixelType;
|
||||
public BYTE ColorBits;
|
||||
public BYTE RedBits;
|
||||
public BYTE RedShift;
|
||||
public BYTE GreenBits;
|
||||
public BYTE GreenShift;
|
||||
public BYTE BlueBits;
|
||||
public BYTE BlueShift;
|
||||
public BYTE AlphaBits;
|
||||
public BYTE AlphaShift;
|
||||
public BYTE AccumBits;
|
||||
public BYTE AccumRedBits;
|
||||
public BYTE AccumGreenBits;
|
||||
public BYTE AccumBlueBits;
|
||||
public BYTE AccumAlphaBits;
|
||||
public BYTE DepthBits;
|
||||
public BYTE StencilBits;
|
||||
public BYTE AuxBuffers;
|
||||
public BYTE LayerPlane;
|
||||
BYTE Reserved;
|
||||
public COLORREF crTransparent;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DeviceMode
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue