daily update on 20240528 by nitload youmu
This commit is contained in:
@@ -38,7 +38,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
namespace StgSharp.Graphics.GL
|
||||
{
|
||||
public class Uniform
|
||||
{
|
||||
@@ -65,14 +65,14 @@ namespace StgSharp.Graphics
|
||||
ShaderProgram program, string name, glRenderStream binding)
|
||||
{
|
||||
this.binding = binding.ContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(
|
||||
ShaderProgram program, string name, IntPtr binding)
|
||||
{
|
||||
this.binding = binding;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal Uniform()
|
||||
@@ -101,14 +101,14 @@ namespace StgSharp.Graphics
|
||||
ShaderProgram program, string name, glRenderStream binding)
|
||||
{
|
||||
this.binding = binding.ContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(
|
||||
ShaderProgram program, string name, IntPtr binding)
|
||||
{
|
||||
this.binding = binding;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal Uniform()
|
||||
@@ -137,14 +137,14 @@ namespace StgSharp.Graphics
|
||||
internal unsafe Uniform(
|
||||
ShaderProgram program, string name)
|
||||
{
|
||||
this.binding = GL.CurrentContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
this.binding = glFunc.CurrentContextHandle;
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
public unsafe Uniform(ShaderProgram program, string name, glRenderStream binding)
|
||||
{
|
||||
this.binding = binding.ContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal Uniform()
|
||||
@@ -175,14 +175,14 @@ namespace StgSharp.Graphics
|
||||
internal unsafe Uniform(ShaderProgram program, string name, glRenderStream binding)
|
||||
{
|
||||
this.binding = binding.ContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(
|
||||
ShaderProgram program, string name)
|
||||
{
|
||||
this.binding = GL.CurrentContextHandle;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
this.binding = glFunc.CurrentContextHandle;
|
||||
id = glFunc.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal Uniform()
|
||||
@@ -197,55 +197,57 @@ namespace StgSharp.Graphics
|
||||
|
||||
}
|
||||
|
||||
internal static partial class GL
|
||||
internal static partial class glFunc
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe static void SetValue(Uniform<Matrix44> uniform, Matrix44 mat)
|
||||
public unsafe static void SetUniformValue
|
||||
(Uniform<Matrix44> uniform, Matrix44 mat)
|
||||
{
|
||||
Matrix44 temp = mat;
|
||||
Context.glUniformMatrix4fv(uniform.id.Value, 1, false, (float*)&temp);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe static void SetValue(Uniform<float, float, float, float> uniform, vec4d vec)
|
||||
public unsafe static void SetUniformValue(Uniform<float, float, float, float> uniform, vec4d vec)
|
||||
{
|
||||
vec4d temp = vec;
|
||||
Context.glUniform1fv(uniform.id.Value , 4, &temp);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe static void SetUniformValue(Uniform<vec4d> uniform, vec4d vec)
|
||||
{
|
||||
vec4d temp = vec;
|
||||
Context.glUniform1fv(uniform.id.Value , 4, &temp);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe static void SetValue(Uniform<vec4d> uniform, vec4d vec)
|
||||
{
|
||||
vec4d temp = vec;
|
||||
Context.glUniform1fv(uniform.id.Value , 4, &temp);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetValue(Uniform<float> uniform, float v0)
|
||||
public static unsafe void SetUniformValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
Context.glUniform1f(uniform.id.Value , v0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetValue(Uniform<int> uniform, int i0)
|
||||
public static unsafe void SetUniformValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
Context.glUniform1i(uniform.id.Value , i0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
public static unsafe void SetUniformValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
Context.glUniform2f(uniform.id.Value , v0, v1);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
public static unsafe void SetUniformValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
Context.glUniform3f(uniform.id.Value , v0, v1, v2);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
public static unsafe void SetUniformValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
Context.glUniform4f(uniform.id.Value , v0, v1, v2, v3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user