summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/util/texture
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/util/texture')
-rwxr-xr-xsrc/classes/com/sun/opengl/util/texture/Texture.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/util/texture/Texture.java b/src/classes/com/sun/opengl/util/texture/Texture.java
index 0e56c9b42..873ea006a 100755
--- a/src/classes/com/sun/opengl/util/texture/Texture.java
+++ b/src/classes/com/sun/opengl/util/texture/Texture.java
@@ -573,11 +573,16 @@ public class Texture {
}
private void updateSubImageImpl(TextureData data, int newTarget, int mipmapLevel, int x, int y) throws GLException {
+ Buffer buffer = data.getBuffer();
+ if (buffer == null) {
+ // Assume user just wanted to get the Texture object allocated
+ return;
+ }
+
GL gl = GLU.getCurrentGL();
gl.glBindTexture(newTarget, texID);
int width = data.getWidth();
int height = data.getHeight();
- Buffer buffer = data.getBuffer();
if (data.getMipmapData() != null) {
// Compute the width and height at the specified mipmap level
for (int i = 0; i < mipmapLevel; i++) {