From 4c70a805051c325f77ac6a5bde41bb94205df663 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 3 Mar 2006 22:14:02 +0000 Subject: Added support requested by user mantesat on JOGL forum for null texture buffer git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@646 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/util/texture/Texture.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/classes/com/sun/opengl') 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++) { -- cgit v1.2.3