Test with new technique texturing

This commit is contained in:
Troispoils 2024-02-29 16:51:41 +01:00
parent bb723036c0
commit 3a7d169b30
8 changed files with 125 additions and 61 deletions

View file

@ -1,7 +1,11 @@
using OpenTK.Graphics.OpenGL4;
using System.Drawing;
using System.Drawing.Imaging;
using PixelFormat = OpenTK.Graphics.OpenGL4.PixelFormat;
using StbImageSharp;
using System.IO;
namespace Map3DRendering.Common {
namespace Map3DRendering {
// A helper class, much like Shader, meant to simplify loading textures.
public class Texture {
public readonly int Handle;
@ -77,10 +81,5 @@ namespace Map3DRendering.Common {
GL.ActiveTexture(unit);
GL.BindTexture(TextureTarget.Texture2D, Handle);
}
public void Assign(int shader, int i) {
int location = GL.GetUniformLocation(shader, "textures[" + i.ToString() + "]");
GL.Uniform1(location, i);
}
}
}
}