diff --git a/src/java/org/lwjgl/BufferUtils.java b/src/java/org/lwjgl/BufferUtils.java index e429613b..5f485121 100644 --- a/src/java/org/lwjgl/BufferUtils.java +++ b/src/java/org/lwjgl/BufferUtils.java @@ -133,7 +133,7 @@ public final class BufferUtils { else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer) return 3; else - throw new IllegalStateException("Unsupported buffer type"); + throw new IllegalStateException("Unsupported buffer type: " + buf); } /** diff --git a/src/java/org/lwjgl/opengl/GLChecks.java b/src/java/org/lwjgl/opengl/GLChecks.java index 892a8b87..6fddb99e 100644 --- a/src/java/org/lwjgl/opengl/GLChecks.java +++ b/src/java/org/lwjgl/opengl/GLChecks.java @@ -148,16 +148,16 @@ class GLChecks { return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer); } - static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width, int border) { - return calculateTexImage1DStorage(format, type, width, border) >> BufferUtils.getElementSizeExponent(buffer); + static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width) { + return calculateTexImage1DStorage(format, type, width) >> BufferUtils.getElementSizeExponent(buffer); } - static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height, int border) { - return calculateTexImage2DStorage(format, type, width, height, border) >> BufferUtils.getElementSizeExponent(buffer); + static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height) { + return calculateTexImage2DStorage(format, type, width, height) >> BufferUtils.getElementSizeExponent(buffer); } - static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth, int border) { - return calculateTexImage3DStorage(format, type, width, height, depth, border) >> BufferUtils.getElementSizeExponent(buffer); + static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth) { + return calculateTexImage3DStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer); } /** @@ -175,16 +175,16 @@ class GLChecks { return calculateBytesPerPixel(format, type) * width * height * depth; } - private static int calculateTexImage1DStorage(int format, int type, int width, int border) { - return calculateBytesPerPixel(format, type) * (width + (border << 1)); + private static int calculateTexImage1DStorage(int format, int type, int width) { + return calculateBytesPerPixel(format, type) * width; } - private static int calculateTexImage2DStorage(int format, int type, int width, int height, int border) { - return calculateTexImage1DStorage(format, type, width, border) * (height + (border << 1)); + private static int calculateTexImage2DStorage(int format, int type, int width, int height) { + return calculateTexImage1DStorage(format, type, width) * height; } - private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth, int border) { - return calculateTexImage2DStorage(format, type, width, height, border) * (depth + (border << 1)); + private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth) { + return calculateTexImage2DStorage(format, type, width, height) * depth; } private static int calculateBytesPerPixel(int format, int type) { diff --git a/src/templates/org/lwjgl/opengl/GL11.java b/src/templates/org/lwjgl/opengl/GL11.java index fc3675c7..16904da1 100644 --- a/src/templates/org/lwjgl/opengl/GL11.java +++ b/src/templates/org/lwjgl/opengl/GL11.java @@ -1261,7 +1261,7 @@ public interface GL11 { void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width, border)", canBeNull = true) + @Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true) @Const @GLbyte @GLshort @@ -1271,7 +1271,7 @@ public interface GL11 { void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height, border)", canBeNull = true) + @Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true) @Const @GLbyte @GLshort diff --git a/src/templates/org/lwjgl/opengl/GL12.java b/src/templates/org/lwjgl/opengl/GL12.java index 8dbd8cd3..0e461181 100644 --- a/src/templates/org/lwjgl/opengl/GL12.java +++ b/src/templates/org/lwjgl/opengl/GL12.java @@ -97,7 +97,7 @@ public interface GL12 { void glTexImage3D(@GLenum int target, int level, int internalFormat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth, border)", canBeNull = true) + @Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true) @Const @GLbyte @GLshort