Replaced tabs with four spaces across the codebase.
This commit is contained in:
parent
3cf88759eb
commit
af416b6e3a
13 changed files with 101 additions and 101 deletions
|
@ -241,7 +241,7 @@ namespace Bind
|
|||
|
||||
case "gl3":
|
||||
case "gl4":
|
||||
mode = GeneratorMode.GL4;
|
||||
mode = GeneratorMode.GL4;
|
||||
break;
|
||||
|
||||
case "es10":
|
||||
|
|
|
@ -90,8 +90,8 @@ namespace OpenTK.Compute.CL10
|
|||
public static unsafe IntPtr CreateContext(ContextProperties[] properties, uint num_devices, IntPtr[] devices, IntPtr pfn_notify, IntPtr user_data, OpenTK.Compute.CL10.ErrorCode[] errcode_ret)
|
||||
{
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
return CreateContext(properties_correct, num_devices, devices, pfn_notify, user_data, errcode_ret);
|
||||
}
|
||||
|
||||
|
@ -101,23 +101,23 @@ namespace OpenTK.Compute.CL10
|
|||
return CreateContext(ref properties_correct, num_devices, ref devices, pfn_notify, user_data, out errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContext<T4>(ContextProperties* properties, uint num_devices, IntPtr* devices, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode* errcode_ret)
|
||||
where T4 : struct
|
||||
public static unsafe IntPtr CreateContext<T4>(ContextProperties* properties, uint num_devices, IntPtr* devices, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode* errcode_ret)
|
||||
where T4 : struct
|
||||
{
|
||||
return CreateContext((IntPtr*)properties, num_devices, devices, pfn_notify, ref user_data, errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContext<T4>(ContextProperties[] properties, uint num_devices, IntPtr[] devices, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode[] errcode_ret)
|
||||
where T4 : struct
|
||||
where T4 : struct
|
||||
{
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
return CreateContext(properties_correct, num_devices, devices, pfn_notify, ref user_data, errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContext<T4>(ref ContextProperties properties, uint num_devices, ref IntPtr devices, IntPtr pfn_notify, ref T4 user_data, out OpenTK.Compute.CL10.ErrorCode errcode_ret)
|
||||
where T4 : struct
|
||||
where T4 : struct
|
||||
{
|
||||
IntPtr properties_correct = new IntPtr((int)properties);
|
||||
return CreateContext(ref properties_correct, num_devices, ref devices, pfn_notify, ref user_data, out errcode_ret);
|
||||
|
@ -130,37 +130,37 @@ namespace OpenTK.Compute.CL10
|
|||
|
||||
public static unsafe IntPtr CreateContextFromType(ContextProperties[] properties, DeviceTypeFlags device_type, IntPtr pfn_notify, IntPtr user_data, OpenTK.Compute.CL10.ErrorCode[] errcode_ret)
|
||||
{
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
return CreateContextFromType(properties_correct, device_type, pfn_notify, user_data, errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContextFromType(ref ContextProperties properties, DeviceTypeFlags device_type, IntPtr pfn_notify, IntPtr user_data, out OpenTK.Compute.CL10.ErrorCode errcode_ret)
|
||||
{
|
||||
IntPtr properties_correct = new IntPtr((int)properties);
|
||||
IntPtr properties_correct = new IntPtr((int)properties);
|
||||
return CreateContextFromType(ref properties_correct, device_type, pfn_notify, user_data, out errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContextFromType<T4>(ContextProperties* properties, DeviceTypeFlags device_type, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode* errcode_ret)
|
||||
where T4 : struct
|
||||
public static unsafe IntPtr CreateContextFromType<T4>(ContextProperties* properties, DeviceTypeFlags device_type, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode* errcode_ret)
|
||||
where T4 : struct
|
||||
{
|
||||
return CreateContextFromType((IntPtr*)properties, device_type, pfn_notify, ref user_data, errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContextFromType<T4>(ContextProperties[] properties, DeviceTypeFlags device_type, IntPtr pfn_notify, ref T4 user_data, OpenTK.Compute.CL10.ErrorCode[] errcode_ret)
|
||||
where T4 : struct
|
||||
where T4 : struct
|
||||
{
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
IntPtr[] properties_correct = properties != null ? new IntPtr[properties.Length] : null;
|
||||
for (int i = 0; i < properties_correct.Length; i++)
|
||||
properties_correct[i] = new IntPtr((int)properties[i]);
|
||||
return CreateContextFromType(properties_correct, device_type, pfn_notify, ref user_data, errcode_ret);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr CreateContextFromType<T4>(ref ContextProperties properties, DeviceTypeFlags device_type, IntPtr pfn_notify, ref T4 user_data, out OpenTK.Compute.CL10.ErrorCode errcode_ret)
|
||||
where T4 : struct
|
||||
where T4 : struct
|
||||
{
|
||||
IntPtr properties_correct = new IntPtr((int)properties);
|
||||
IntPtr properties_correct = new IntPtr((int)properties);
|
||||
return CreateContextFromType(ref properties_correct, device_type, pfn_notify, ref user_data, out errcode_ret);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace OpenTK.Graphics.ES20
|
|||
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
GetProgram(program, GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
|
||||
|
||||
GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
|
||||
|
@ -185,7 +185,7 @@ namespace OpenTK.Graphics.ES20
|
|||
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
GetProgram(program, GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||
GetActiveUniform(program, uniformIndex, sb.Capacity, out length, out size, out type, sb);
|
||||
|
@ -237,7 +237,7 @@ namespace OpenTK.Graphics.ES20
|
|||
unsafe
|
||||
{
|
||||
int length;
|
||||
GL.GetProgram(program, GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
GL.GetProgram(program, GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
{
|
||||
info = String.Empty;
|
||||
return;
|
||||
|
|
|
@ -175,17 +175,17 @@ namespace OpenTK.Graphics.ES30
|
|||
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, ES30.GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
GetProgram(program, ES30.GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
|
||||
|
||||
GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
|
||||
GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, ES30.GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
GetProgram(program, ES30.GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||
GetActiveUniform(program, uniformIndex, sb.Capacity, out length, out size, out type, sb);
|
||||
|
@ -237,7 +237,7 @@ namespace OpenTK.Graphics.ES30
|
|||
unsafe
|
||||
{
|
||||
int length;
|
||||
GL.GetProgram(program, ES30.GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
GL.GetProgram(program, ES30.GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
{
|
||||
info = String.Empty;
|
||||
return;
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace OpenTK.Graphics.OpenGL
|
|||
|
||||
public static void Color3(Color color)
|
||||
{
|
||||
GL.Color3(color.R, color.G, color.B);
|
||||
GL.Color3(color.R, color.G, color.B);
|
||||
}
|
||||
|
||||
public static void Color4(Color color)
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace OpenTK.Graphics.OpenGL4
|
|||
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, OpenGL4.GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
GetProgram(program, OpenGL4.GetProgramParameterName.ActiveAttributeMaxLength, out length);
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
|
||||
|
||||
GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
|
||||
|
@ -256,7 +256,7 @@ namespace OpenTK.Graphics.OpenGL4
|
|||
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, OpenGL4.GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
GetProgram(program, OpenGL4.GetProgramParameterName.ActiveUniformMaxLength, out length);
|
||||
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||
GetActiveUniform(program, uniformIndex, sb.Capacity, out length, out size, out type, sb);
|
||||
|
@ -308,7 +308,7 @@ namespace OpenTK.Graphics.OpenGL4
|
|||
unsafe
|
||||
{
|
||||
int length;
|
||||
GL.GetProgram(program, OpenGL4.GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
GL.GetProgram(program, OpenGL4.GetProgramParameterName.InfoLogLength, out length); if (length == 0)
|
||||
{
|
||||
info = String.Empty;
|
||||
return;
|
||||
|
|
|
@ -293,33 +293,33 @@ namespace OpenTK
|
|||
return Math.Max(Math.Min(n, max), min);
|
||||
}
|
||||
|
||||
private static unsafe int FloatToInt32Bits(float f) {
|
||||
return *((int*) &f);
|
||||
}
|
||||
private static unsafe int FloatToInt32Bits(float f) {
|
||||
return *((int*) &f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Approximates floating point equality with a maximum number of different bits.
|
||||
/// This is typically used in place of an epsilon comparison.
|
||||
/// see: https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
|
||||
/// see: https://stackoverflow.com/questions/3874627/floating-point-comparison-functions-for-c-sharp
|
||||
/// </summary>
|
||||
/// <param name="a">the first value to compare</param>
|
||||
/// <param name="b">>the second value to compare</param>
|
||||
/// <param name="maxDeltaBits">the number of floating point bits to check</param>
|
||||
/// <returns></returns>
|
||||
public static bool ApproximatelyEqual(float a, float b, int maxDeltaBits) {
|
||||
// we use longs here, otherwise we run into a two's complement problem, causing this to fail with -2 and 2.0
|
||||
long aInt = FloatToInt32Bits(a);
|
||||
if (aInt < 0)
|
||||
aInt = Int32.MinValue - aInt;
|
||||
/// <summary>
|
||||
/// Approximates floating point equality with a maximum number of different bits.
|
||||
/// This is typically used in place of an epsilon comparison.
|
||||
/// see: https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
|
||||
/// see: https://stackoverflow.com/questions/3874627/floating-point-comparison-functions-for-c-sharp
|
||||
/// </summary>
|
||||
/// <param name="a">the first value to compare</param>
|
||||
/// <param name="b">>the second value to compare</param>
|
||||
/// <param name="maxDeltaBits">the number of floating point bits to check</param>
|
||||
/// <returns></returns>
|
||||
public static bool ApproximatelyEqual(float a, float b, int maxDeltaBits) {
|
||||
// we use longs here, otherwise we run into a two's complement problem, causing this to fail with -2 and 2.0
|
||||
long aInt = FloatToInt32Bits(a);
|
||||
if (aInt < 0)
|
||||
aInt = Int32.MinValue - aInt;
|
||||
|
||||
long bInt = FloatToInt32Bits(b);
|
||||
if (bInt < 0)
|
||||
bInt = Int32.MinValue - bInt;
|
||||
long bInt = FloatToInt32Bits(b);
|
||||
if (bInt < 0)
|
||||
bInt = Int32.MinValue - bInt;
|
||||
|
||||
long intDiff = Math.Abs(aInt - bInt);
|
||||
return intDiff <= (1 << maxDeltaBits);
|
||||
}
|
||||
long intDiff = Math.Abs(aInt - bInt);
|
||||
return intDiff <= (1 << maxDeltaBits);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Approximates double-precision floating point equality by an epsilon (maximum error) value.
|
||||
|
@ -435,5 +435,5 @@ namespace OpenTK
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,11 +72,11 @@ namespace OpenTK.Platform.Egl
|
|||
public void CreateWindowSurface(IntPtr config)
|
||||
{
|
||||
Surface = Egl.CreateWindowSurface(Display, config, Handle, IntPtr.Zero);
|
||||
if (Surface==IntPtr.Zero)
|
||||
{
|
||||
if (Surface==IntPtr.Zero)
|
||||
{
|
||||
throw new GraphicsContextException(String.Format(
|
||||
"[EGL] Failed to create window surface, error {0}.", Egl.GetError()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void CreatePixmapSurface(EGLConfig config)
|
||||
|
|
|
@ -29,8 +29,8 @@ using System.Text;
|
|||
|
||||
namespace OpenTK.Platform.MacOS
|
||||
{
|
||||
//
|
||||
// http://web.archive.org/web/20100501161453/http://www.classicteck.com/rbarticles/mackeyboard.php
|
||||
//
|
||||
// http://web.archive.org/web/20100501161453/http://www.classicteck.com/rbarticles/mackeyboard.php
|
||||
|
||||
enum MacOSKeyCode
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenTK.Platform.MacOS
|
|||
public static readonly IntPtr Release = Selector.Get("release");
|
||||
public static readonly IntPtr Autorelease = Selector.Get("autorelease");
|
||||
|
||||
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint="sel_registerName")]
|
||||
public extern static IntPtr Get(string name);
|
||||
}
|
||||
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint="sel_registerName")]
|
||||
public extern static IntPtr Get(string name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,14 +27,14 @@ using System;
|
|||
|
||||
namespace OpenTK
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
|
||||
class RewrittenAttribute : Attribute
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
|
||||
class RewrittenAttribute : Attribute
|
||||
{
|
||||
internal bool Rewritten;
|
||||
internal bool Rewritten;
|
||||
|
||||
public RewrittenAttribute(bool rewritten)
|
||||
public RewrittenAttribute(bool rewritten)
|
||||
{
|
||||
Rewritten = rewritten;
|
||||
Rewritten = rewritten;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,26 +27,26 @@ using System;
|
|||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// This type supports OpenTK and should not be
|
||||
/// used in user code.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
||||
public class SlotAttribute : Attribute
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// This type supports OpenTK and should not be
|
||||
/// used in user code.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
||||
public class SlotAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// </summary>
|
||||
internal int Slot;
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// </summary>
|
||||
internal int Slot;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="index">The slot index for a wrapper function.</param>
|
||||
public SlotAttribute(int index)
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="index">The slot index for a wrapper function.</param>
|
||||
public SlotAttribute(int index)
|
||||
{
|
||||
Slot = index;
|
||||
Slot = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue