Test with new technique texturing
This commit is contained in:
parent
bb723036c0
commit
3a7d169b30
8 changed files with 125 additions and 61 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue