Don't add border when checking image sizes

This commit is contained in:
Elias Naur 2007-04-15 19:33:03 +00:00
parent 5d15006837
commit ca35f3b2b4
4 changed files with 16 additions and 16 deletions

View file

@ -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);
}
/**

View file

@ -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) {