diff options
author | Sven Gothel <[email protected]> | 2013-08-23 00:33:38 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-08-23 00:33:38 +0200 |
commit | c6555b09c455d0db238e4cf57ee3efd4e426f215 (patch) | |
tree | db3fc2283f12630fecbb13a7fbe16a15385b2169 /src | |
parent | f18a94b3defef16e98badd6d99f2422609aa56c5 (diff) |
Texture: Add 'toString()' and 'getTextureObject()' w/o GL instance to read existing object name.
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java index f2ef3ac25..496836d3c 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java @@ -187,6 +187,12 @@ public class Texture { /** The texture coordinates corresponding to the entire image. */ private TextureCoords coords; + + public String toString() { + return "Texture[target 0x"+Integer.toHexString(target)+", name "+texID+", "+ + imgWidth+"/"+texWidth+" x "+imgHeight+"/"+texHeight+", y-flip "+mustFlipVertically+ + ", "+estimatedMemorySize+" bytes]"; + } /** An estimate of the amount of texture memory this texture consumes. */ private int estimatedMemorySize; @@ -858,12 +864,26 @@ public class Texture { * </p> * @param gl required to be valid and current in case the texture object has not been generated yet, * otherwise it may be <code>null</code>. + * @see #getTextureObject() */ public int getTextureObject(GL gl) { validateTexID(gl, false); return texID; } + /** + * Returns the underlying OpenGL texture object for this texture, + * maybe <code>0</code> if not yet generated. + * <p> + * Most applications will not need to access this, since it is + * handled automatically by the bind(GL) and destroy(GL) APIs. + * </p> + * @see #getTextureObject(GL) + */ + public int getTextureObject() { + return texID; + } + /** Returns an estimate of the amount of texture memory in bytes this Texture consumes. It should only be treated as an estimate; most applications should not need to query this but instead let |