diff options
author | Kenneth Russel <[email protected]> | 2006-03-03 22:14:02 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-03-03 22:14:02 +0000 |
commit | 4c70a805051c325f77ac6a5bde41bb94205df663 (patch) | |
tree | 5a5733f2cd6790986f22cd6bd0a294e715d5ef65 /src/classes/com/sun/opengl/util | |
parent | 25ba92c62f752884dde5cb59feaa71d6003da80b (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl/util')
-rwxr-xr-x | src/classes/com/sun/opengl/util/texture/Texture.java | 7 |
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++) { |