Files
stgsharp/src/StgSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs
T

119 lines
2.4 KiB
C#

// -----------------------------------------------------------------------------
// file="Uniform"
// Project: StgSharp
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
namespace StgSharp.Graphics.OpenGL
{
public class Uniform
{
internal GlHandle id;
public GlHandle Handle => id;
}
public sealed class Uniform<T> : Uniform where T : unmanaged
{
internal Uniform() { }
internal unsafe Uniform(
GlHandle id
)
{
this.id = id;
}
internal static Uniform<T> FromHandle(
GlHandle handle
)
{
return new Uniform<T>
{
id = handle
};
}
}
public sealed class Uniform<T, U> : Uniform where T : unmanaged where U : struct
{
internal Uniform() { }
internal unsafe Uniform(
GlHandle id
)
{
this.id = id;
}
internal static Uniform<T, U> FromHandle(
GlHandle handle
)
{
return new Uniform<T, U>
{
id = handle
};
}
}
public sealed class Uniform<T, U, V> : Uniform where T : unmanaged where U : struct
where V : struct
{
internal Uniform() { }
internal unsafe Uniform(
GlHandle id
)
{
this.id = id;
}
internal static Uniform<T, U, V> FromHandle(
GlHandle handle
)
{
return new Uniform<T, U, V>
{
id = handle
};
}
}
public sealed class Uniform<T, U, V, W> : Uniform where T : unmanaged where U : struct
where V : struct
where W : struct
{
internal Uniform() { }
internal unsafe Uniform(
GlHandle id
)
{
this.id = id;
}
internal static Uniform<T, U, V, W> FromHandle(
GlHandle handle
)
{
return new Uniform<T, U, V, W>
{
id = handle
};
}
}
}