Corrected bug affecting the GL.Load and Wgl.Load functions, where the delegates where not retrieved by the GetFields call.

This commit is contained in:
the_fiddler 2007-08-22 16:13:41 +00:00
parent 6ae06d82bd
commit 1d62f8521c
7 changed files with 4520 additions and 46 deletions

View file

@ -707,12 +707,12 @@ namespace Bind.GL2
{ {
if (!Char.IsDigit(key[0])) if (!Char.IsDigit(key[0]))
{ {
sw.WriteLine("public static class {0}", key); sw.WriteLine("public static partial class {0}", key);
} }
else else
{ {
// Identifiers cannot start with a number: // Identifiers cannot start with a number:
sw.WriteLine("public static class {0}{1}", Settings.FunctionPrefix, key); sw.WriteLine("public static partial class {0}{1}", Settings.FunctionPrefix, key);
} }
sw.WriteLine("{"); sw.WriteLine("{");
sw.Indent(); sw.Indent();

View file

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.3.9.2")] [assembly: AssemblyVersion("0.3.10.0")]
[assembly: AssemblyFileVersion("0.3.9.2")] [assembly: AssemblyFileVersion("0.3.10.0")]

View file

@ -14847,7 +14847,7 @@ namespace OpenTK.OpenGL
unsafe { Delegates.glUniformMatrix4x3fv((Int32)location, (Int32)count, (GL.Enums.Boolean)transpose, (Single*)value); } unsafe { Delegates.glUniformMatrix4x3fv((Int32)location, (Int32)count, (GL.Enums.Boolean)transpose, (Single*)value); }
} }
public static class ARB public static partial class ARB
{ {
public static public static
void ActiveTexture(GL.Enums.ARB_multitexture texture) void ActiveTexture(GL.Enums.ARB_multitexture texture)
@ -22619,7 +22619,7 @@ namespace OpenTK.OpenGL
} }
public static class EXT public static partial class EXT
{ {
public static public static
void BlendColor(Single red, Single green, Single blue, Single alpha) void BlendColor(Single red, Single green, Single blue, Single alpha)
@ -29393,7 +29393,7 @@ namespace OpenTK.OpenGL
} }
public static class SGIS public static partial class SGIS
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -29888,7 +29888,7 @@ namespace OpenTK.OpenGL
} }
public static class SGI public static partial class SGI
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -30070,7 +30070,7 @@ namespace OpenTK.OpenGL
} }
public static class SGIX public static partial class SGIX
{ {
public static public static
void PixelTexGen(GL.Enums.SGIX_pixel_texture mode) void PixelTexGen(GL.Enums.SGIX_pixel_texture mode)
@ -31243,7 +31243,7 @@ namespace OpenTK.OpenGL
} }
public static class HP public static partial class HP
{ {
public static public static
void ImageTransformParameteri(GL.Enums.HP_image_transform target, GL.Enums.HP_image_transform pname, Int32 param) void ImageTransformParameteri(GL.Enums.HP_image_transform target, GL.Enums.HP_image_transform pname, Int32 param)
@ -31385,7 +31385,7 @@ namespace OpenTK.OpenGL
} }
public static class PGI public static partial class PGI
{ {
public static public static
void Hint(GL.Enums.PGI_misc_hints target, Int32 mode) void Hint(GL.Enums.PGI_misc_hints target, Int32 mode)
@ -31395,7 +31395,7 @@ namespace OpenTK.OpenGL
} }
public static class INTEL public static partial class INTEL
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -31491,7 +31491,7 @@ namespace OpenTK.OpenGL
} }
public static class SUNX public static partial class SUNX
{ {
public static public static
void FinishTexture() void FinishTexture()
@ -31501,7 +31501,7 @@ namespace OpenTK.OpenGL
} }
public static class SUN public static partial class SUN
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -51748,7 +51748,7 @@ namespace OpenTK.OpenGL
} }
public static class INGR public static partial class INGR
{ {
public static public static
void BlendFuncSeparate(GL.Enums.All sfactorRGB, GL.Enums.All dfactorRGB, GL.Enums.All sfactorAlpha, GL.Enums.All dfactorAlpha) void BlendFuncSeparate(GL.Enums.All sfactorRGB, GL.Enums.All dfactorRGB, GL.Enums.All sfactorAlpha, GL.Enums.All dfactorAlpha)
@ -51758,7 +51758,7 @@ namespace OpenTK.OpenGL
} }
public static class NV public static partial class NV
{ {
public static public static
void FlushVertexArrayRange() void FlushVertexArrayRange()
@ -61290,7 +61290,7 @@ namespace OpenTK.OpenGL
} }
public static class MESA public static partial class MESA
{ {
public static public static
void ResizeBuffers() void ResizeBuffers()
@ -61744,7 +61744,7 @@ namespace OpenTK.OpenGL
} }
public static class IBM public static partial class IBM
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -62573,7 +62573,7 @@ namespace OpenTK.OpenGL
} }
public static class gl3DFX public static partial class gl3DFX
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -62590,7 +62590,7 @@ namespace OpenTK.OpenGL
} }
public static class ATI public static partial class ATI
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -64534,7 +64534,7 @@ namespace OpenTK.OpenGL
} }
public static class APPLE public static partial class APPLE
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static
@ -65353,7 +65353,7 @@ namespace OpenTK.OpenGL
} }
public static class GREMEDY public static partial class GREMEDY
{ {
[System.CLSCompliant(false)] [System.CLSCompliant(false)]
public static public static

View file

@ -273,7 +273,7 @@ namespace OpenTK.OpenGL
/// </remarks> /// </remarks>
public static bool Load(string function) public static bool Load(string function)
{ {
FieldInfo f = delegatesClass.GetField(function); FieldInfo f = delegatesClass.GetField(function, BindingFlags.Static | BindingFlags.NonPublic);
if (f == null) if (f == null)
return false; return false;
@ -285,7 +285,7 @@ namespace OpenTK.OpenGL
#endregion #endregion
#region public static void Color3() #region public static void Color[34]() overloads
public static void Color4(System.Drawing.Color color) public static void Color4(System.Drawing.Color color)
{ {

File diff suppressed because it is too large Load diff

View file

@ -94,7 +94,7 @@ namespace OpenTK.Platform.Windows
/// <returns></returns> /// <returns></returns>
public static bool Load(string function) public static bool Load(string function)
{ {
FieldInfo f = delegatesClass.GetField(function); FieldInfo f = delegatesClass.GetField(function, BindingFlags.Static | BindingFlags.NonPublic);
if (f == null) if (f == null)
return false; return false;
@ -102,21 +102,23 @@ namespace OpenTK.Platform.Windows
return f.GetValue(null) != null; return f.GetValue(null) != null;
} }
/*
/// <summary>
/// Checks if an extension is supported by the given context.
/// </summary>
/// <param name="deviceContext">The device context to check.</param>
/// <param name="ext">The extension to check.</param>
/// <returns>True if the extension is supported by the given context, false otherwise</returns>
public static bool SupportsExtensionARB(IntPtr deviceContext, string ext)
{
string extension_string = Wgl.ARB.GetExtensionsString(deviceContext);
string[] extensions = extension_string.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
Array.Sort(extensions); public static partial class ARB
return Array.BinarySearch(extensions, ext) != -1; {
/// <summary>
/// Checks if an extension is supported by the given context.
/// </summary>
/// <param name="deviceContext">The device context to check.</param>
/// <param name="ext">The extension to check.</param>
/// <returns>True if the extension is supported by the given context, false otherwise</returns>
public static bool SupportsExtension(IntPtr deviceContext, string ext)
{
string extension_string = Wgl.ARB.GetExtensionsString(deviceContext);
string[] extensions = extension_string.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
Array.Sort(extensions);
return Array.BinarySearch(extensions, ext) != -1;
}
} }
*/
} }
} }

View file

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("0.3.10.1")] [assembly: AssemblyVersion("0.3.10.2")]
[assembly: AssemblyFileVersion("0.3.10.1")] [assembly: AssemblyFileVersion("0.3.10.2")]