diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java index 511c1b9b9..9231804be 100644 --- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java +++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java @@ -43,6 +43,7 @@ package jogamp.opengl; import javax.media.opengl.*; import com.jogamp.common.util.IntIntHashMap; +import com.jogamp.common.util.PropertyAccess; /** * Tracks as closely as possible which OpenGL buffer object is bound @@ -82,7 +83,7 @@ public class GLBufferStateTracker { static { Debug.initSingleton(); - DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true); + DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLBufferStateTracker", true); } // Maps binding targets to buffer objects. A null value indicates @@ -104,8 +105,8 @@ public class GLBufferStateTracker { setBoundBufferObject(GL.GL_ARRAY_BUFFER, 0); setBoundBufferObject(GL4.GL_DRAW_INDIRECT_BUFFER, 0); setBoundBufferObject(GL.GL_ELEMENT_ARRAY_BUFFER, 0); - setBoundBufferObject(GL2.GL_PIXEL_PACK_BUFFER, 0); - setBoundBufferObject(GL2.GL_PIXEL_UNPACK_BUFFER, 0); + setBoundBufferObject(GL2ES3.GL_PIXEL_PACK_BUFFER, 0); + setBoundBufferObject(GL2ES3.GL_PIXEL_UNPACK_BUFFER, 0); } @@ -136,8 +137,8 @@ public class GLBufferStateTracker { case GL4.GL_DRAW_INDIRECT_BUFFER: return GL4.GL_DRAW_INDIRECT_BUFFER_BINDING; case GL4.GL_DISPATCH_INDIRECT_BUFFER: return GL4.GL_DISPATCH_INDIRECT_BUFFER_BINDING; case GL.GL_ELEMENT_ARRAY_BUFFER: return GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; - case GL2.GL_PIXEL_PACK_BUFFER: return GL2.GL_PIXEL_PACK_BUFFER_BINDING; - case GL2.GL_PIXEL_UNPACK_BUFFER: return GL2.GL_PIXEL_UNPACK_BUFFER_BINDING; + case GL2ES3.GL_PIXEL_PACK_BUFFER: return GL2ES3.GL_PIXEL_PACK_BUFFER_BINDING; + case GL2ES3.GL_PIXEL_UNPACK_BUFFER: return GL2ES3.GL_PIXEL_UNPACK_BUFFER_BINDING; // FIXME case GL4.GL_QUERY_BUFFER: return GL4.GL_QUERY_BUFFER_BINDING; case GL4.GL_SHADER_STORAGE_BUFFER: return GL4.GL_SHADER_STORAGE_BUFFER_BINDING; case GL2GL3.GL_TEXTURE_BUFFER: return GL2GL3.GL_TEXTURE_BINDING_BUFFER; @@ -159,8 +160,8 @@ public class GLBufferStateTracker { case GL4.GL_DRAW_INDIRECT_BUFFER: case GL4.GL_DISPATCH_INDIRECT_BUFFER: case GL.GL_ELEMENT_ARRAY_BUFFER: - case GL2.GL_PIXEL_PACK_BUFFER: - case GL2.GL_PIXEL_UNPACK_BUFFER: + case GL2ES3.GL_PIXEL_PACK_BUFFER: + case GL2ES3.GL_PIXEL_UNPACK_BUFFER: // FIXME case GL4.GL_QUERY_BUFFER: case GL4.GL_SHADER_STORAGE_BUFFER: case GL2GL3.GL_TEXTURE_BUFFER: @@ -185,7 +186,7 @@ public class GLBufferStateTracker { * @param target * @param bufferName */ - public final void setBoundBufferObject(int target, int bufferName) { + public final void setBoundBufferObject(final int target, final int bufferName) { checkTargetName(target); final int oldBufferName = bindingMap.put(target, bufferName); /*** @@ -215,7 +216,7 @@ public class GLBufferStateTracker { specified target (e.g. GL_ARRAY_BUFFER) is currently unknown. You must use isBoundBufferObjectKnown() to see whether the return value is valid. */ - public final int getBoundBufferObject(int target, GL caller) { + public final int getBoundBufferObject(final int target, final GL caller) { int value = bindingMap.get(target); if (bindingNotFound == value) { // User probably either called glPushClientAttrib / @@ -263,5 +264,5 @@ public class GLBufferStateTracker { } bindingMap.clear(); } - private final String toHexString(int i) { return Integer.toHexString(i); } + private final String toHexString(final int i) { return Integer.toHexString(i); } } |