diff options
author | Sven Gothel <[email protected]> | 2011-08-22 01:59:00 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-08-22 01:59:00 +0200 |
commit | 6c346d98f04e2355210960fe9ffde47432f04d62 (patch) | |
tree | 938536365abee309d5acf9ada1ac75bc1a49e939 /src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java | |
parent | 47b0d317df3c860b6cf3ea10196dfee82b3b3dc1 (diff) |
Misc Rename/Reloc; GLArrayData*/PMVMatrix enhancments; Test fixes/adds (GearsES1/ES2)
rename/reloc:
- javax.media.nativewindow.util:
DimensionReadOnly -> DimensionImmutable
PointReadOnly -> PointImmutable
RectangleReadOnly -> RectangleImmutable
unified 'immutable' name as used within jogamp already
- remove array handler from public API
com.jogamp.opengl.util.GL*ArrayHandler -> jogamp.opengl.util.GL*ArrayHandler
- GLArrayData: Clarify method names
getComponentNumber() -> getComponentCount()
getComponentSize() -> getComponentSizeInBytes()
getElementNumber() -> getElementCount()
getByteSize() -> getSizeInBytes()
- FixedFuncPipeline: Moved def. array names to GLPointerFuncUtil
enhancement:
- GLArrayDataServer: Add support for interleaved arrays/VBO
- GLArrayData*.createFixed(..) remove 'name' argument (non sense for fixed function)
- PMVMatrix:
- one nio buffer
- removed 'Pmv' multiplied matrix
- removed 2x2 cut down 'Mvi' normal matrix (use 4x4 Mvi)
-
tests:
- RedSquare -> RedSquareES1/RedSquareES2
- Gears ES1 fixed + ES2 added. Both work properly and share common Gears VBO construction
- Added TestMapBuffer01NEWT, testing glMapBuffer
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java index 4296ebee2..13c61766e 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java @@ -1,33 +1,26 @@ package com.jogamp.opengl.util; -import com.jogamp.common.nio.Buffers; -import java.security.*; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; -import javax.media.opengl.*; +import javax.media.opengl.GL; +import javax.media.opengl.GLException; +import javax.media.opengl.fixedfunc.GLPointerFuncUtil; -import com.jogamp.opengl.util.glsl.*; +import jogamp.opengl.util.GLFixedArrayHandler; +import jogamp.opengl.util.glsl.GLSLArrayHandler; -import jogamp.opengl.SystemUtil; +import com.jogamp.common.nio.Buffers; +import com.jogamp.opengl.util.glsl.ShaderState; -import java.nio.*; public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayDataEditable { /** - * The OpenGL ES emulation on the PC probably has a buggy VBO implementation, - * where we have to 'refresh' the VertexPointer or VertexAttribArray after each - * BindBuffer ! - * - * This should not be necessary on proper native implementations. - */ - public static final boolean hasVBOBug = AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return SystemUtil.getenv("JOGL_VBO_BUG"); - } - }) != null; - - /** * Create a client side buffer object, using a predefined fixed function array index * and starting with a new created Buffer object with initialSize size * @@ -36,10 +29,10 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData * EnableVertexAttribArray and VertexAttribPointer calls, * and a predefined vertex attribute variable name will be chosen. * + * The default name mapping will be used, + * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}. + * * @param index The GL array index - * @param name The optional custom name for the GL array index, maybe null. - * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'. - * This name might be used as the shader attribute name. * @param comps The array component number * @param dataType The array index GL data type * @param normalized Whether the data shall be normalized @@ -47,12 +40,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData * * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int) */ - public static GLArrayDataClient createFixed(int index, String name, int comps, int dataType, boolean normalized, int initialSize) + public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int initialSize) throws GLException { GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc); - adc.init(name, index, comps, dataType, normalized, 0, null, initialSize, false, glArrayHandler, 0, 0, 0, 0); + adc.init(null, index, comps, dataType, normalized, 0, null, initialSize, false, glArrayHandler, 0, 0, 0, 0); return adc; } @@ -65,10 +58,10 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData * EnableVertexAttribArray and VertexAttribPointer calls, * and a predefined vertex attribute variable name will be chosen. * + * The default name mapping will be used, + * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}. + * * @param index The GL array index - * @param name The optional custom name for the GL array index, maybe null. - * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'. - * This name might be used as the shader attribute name. * @param comps The array component number * @param dataType The array index GL data type * @param normalized Whether the data shall be normalized @@ -77,13 +70,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData * * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int) */ - public static GLArrayDataClient createFixed(int index, String name, int comps, int dataType, boolean normalized, int stride, + public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride, Buffer buffer) throws GLException { GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc); - adc.init(name, index, comps, dataType, normalized, stride, buffer, comps*comps, false, glArrayHandler, 0, 0, 0, 0); + adc.init(null, index, comps, dataType, normalized, stride, buffer, comps*comps, false, glArrayHandler, 0, 0, 0, 0); return adc; } @@ -271,9 +264,9 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData ", isVertexAttribute "+isVertexAttribute+ ", dataType "+componentType+ ", bufferClazz "+componentClazz+ - ", elements "+getElementNumber()+ + ", elements "+getElementCount()+ ", components "+components+ - ", stride "+stride+"u "+strideB+"b "+strideL+"c"+ + ", stride "+strideB+"b "+strideL+"c"+ ", initialSize "+initialSize+ ", sealed "+sealed+ ", bufferEnabled "+bufferEnabled+ |