ShaderProgram - Add 'SetUniform2' overload for System.Drawing.Size

This commit is contained in:
miku-666
2024-09-22 13:56:44 +02:00
parent 288e6718b4
commit 451c0aabd5
2 changed files with 3 additions and 2 deletions

View File

@@ -65,6 +65,8 @@ namespace PckStudio.Rendering.Shader
GL.Uniform1(location, value);
}
public void SetUniform2(string name, Size value) => SetUniform2(name, new Vector2(value.Width, value.Height));
public void SetUniform2(string name, Vector2 value)
{
int location = GetUniformLocation(name);

View File

@@ -26,7 +26,6 @@ using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using PckStudio.Properties;
using PckStudio.Forms.Editor;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Drawing.Imaging;
@@ -873,7 +872,7 @@ namespace PckStudio.Rendering
ShaderProgram cubeShader = GetShader("CubeShader");
cubeShader.Bind();
cubeShader.SetUniformMat4("u_ViewProjection", ref viewProjection);
cubeShader.SetUniform2("u_TexSize", new Vector2(TextureSize.Width, TextureSize.Height));
cubeShader.SetUniform2("u_TexSize", TextureSize);
skinTexture.Bind();