60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace StgSharp.Math
|
|
{
|
|
/// <summary>
|
|
/// OpenGL numeric type.
|
|
/// An IEEE-754 floating-point value, clamped to the range [0,1].
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GLclampf
|
|
{
|
|
public float value;
|
|
|
|
public GLclampf(float a)
|
|
{
|
|
value = a;
|
|
}
|
|
|
|
public static explicit operator GLclampf(float v)
|
|
{
|
|
return new GLclampf(v);
|
|
}
|
|
|
|
public static explicit operator float(GLclampf v)
|
|
{
|
|
return v.value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// OpenGL numeric type.
|
|
/// An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GLclampd
|
|
{
|
|
public double value;
|
|
|
|
public GLclampd(double a)
|
|
{
|
|
value = a;
|
|
}
|
|
|
|
public static explicit operator GLclampd(double v)
|
|
{
|
|
return new GLclampd(v);
|
|
}
|
|
|
|
public static explicit operator double(GLclampd v)
|
|
{
|
|
return v.value;
|
|
}
|
|
}
|
|
}
|