Texture2D - Fix broken api

This commit is contained in:
miku-666
2024-02-29 12:18:01 +01:00
parent 8acee2b65f
commit 6f48f6c233
2 changed files with 2 additions and 13 deletions

View File

@@ -599,7 +599,7 @@ namespace PckStudio.Rendering
if (e.Cancel)
return;
skinTexture.LoadImageData(e.NewTexture);
skinTexture.SetTexture(e.NewTexture);
GLErrorCheck();
}

View File

@@ -9,20 +9,9 @@ namespace PckStudio.Rendering.Texture
{
internal class Texture2D : Texture
{
public Texture2D(string filepath, int slot)
: this(Image.FromFile(filepath), slot)
{
}
public OpenTK.Graphics.OpenGL.PixelFormat PixelFormat { get; set; }
public PixelInternalFormat InternalPixelFormat { get; set; }
public Texture2D(Image image, int slot) : this(slot)
{
LoadImageData(image);
}
public Texture2D(int slot) : this()
{
Slot = slot;
@@ -39,7 +28,7 @@ namespace PckStudio.Rendering.Texture
Unbind();
}
public void LoadImageData(Image image)
public void SetTexture(Image image)
{
Bind();
var bitmap = new Bitmap(image);