diff options
author | Sven Gothel <sgothel@jausoft.com> | 2012-10-22 21:28:40 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2012-10-22 21:28:40 +0200 |
commit | 03cdffe5739ef8b032638cf4169e713c90fb36c6 (patch) | |
tree | 0728e1bf17f11acf824cca7e76e2a96d5d87d9ae /src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java | |
parent | 5bdd283a9c3d0c656c859d499476173e2f609839 (diff) |
FixedFuncHook/ImmModeSink: Fix *Pointer 'normalized' parameter
All *Pointer methods used 'normalized:=false', but we cannot assume
the fixed function code does use normalized (0f..1f) values.
On the contrary, it usually uses the native format value range.
Hence we have to pass normalized:=true for all fixed point data types
and normalized:=false for floating point data types.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java index 10d59bf7d..174935dcc 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java @@ -78,6 +78,27 @@ public class GLBuffers extends Buffers { } /** + * @param glType GL primitive type + * @return false if one of GL primitive floating point types, otherwise true + * GL_FLOAT, <br/> + * GL_HALF_FLOAT, <br/> + * GL_HALF_FLOAT_OES, <br/> + * GL_DOUBLE <br/> + */ + public static final boolean isGLTypeFixedPoint(int glType) { + switch(glType) { + case GL.GL_FLOAT: + case GL.GL_HALF_FLOAT: + case GLES2.GL_HALF_FLOAT_OES: + case GL2GL3.GL_DOUBLE: + return false; + + default: + return true; + } + } + + /** * @param glType shall be one of (29) <br/> * GL_BYTE, GL_UNSIGNED_BYTE, <br/> * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/> |