aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java
diff options
context:
space:
mode:
authorisXander <xander@isxander.dev>2023-08-16 09:10:49 +0100
committerisXander <xander@isxander.dev>2023-08-16 09:10:49 +0100
commitb3d5164010682cdf2d3f68be141792bf71a5dd49 (patch)
tree80c32a22084e144fbfdb13cbe67e9d9ab6f88efa /common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java
parenta892b7e9c2f67b072cf1461241f4ba5488e41370 (diff)
downloadYetAnotherConfigLib-b3d5164010682cdf2d3f68be141792bf71a5dd49.tar.gz
YetAnotherConfigLib-b3d5164010682cdf2d3f68be141792bf71a5dd49.tar.bz2
YetAnotherConfigLib-b3d5164010682cdf2d3f68be141792bf71a5dd49.zip
Seem to resolve GL error when loading images
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java')
-rw-r--r--common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java b/common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java
index 717adaa..9617c58 100644
--- a/common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java
+++ b/common/src/main/java/dev/isxander/yacl3/gui/ImageRenderer.java
@@ -279,7 +279,7 @@ public interface ImageRenderer {
int cols = (int)Math.ceil(Math.sqrt(frameCount) / Math.sqrt(ratio));
int rows = (int)Math.ceil(frameCount / (double)cols);
- NativeImage image = new NativeImage(NativeImage.Format.RGBA, frameWidth * cols, frameHeight * rows, true);
+ NativeImage image = new NativeImage(NativeImage.Format.RGBA, frameWidth * cols, frameHeight * rows, false);
// // Fill whole atlas with black, as each frame may have different dimensions
// // that would cause borders of transparent pixels to appear around the frames
@@ -335,10 +335,6 @@ public interface ImageRenderer {
}
}
}
- // gives the texture to GL for rendering
- // usually, you create a native image with NativeImage.create, which sets the pixels and
- // runs this function itself. In this case, we need to do it manually.
- image.upload(0, 0, 0, false);
if (graphics != null)
graphics.dispose();