Package java.nio

Examples of java.nio.FloatBuffer.rewind()


            // we need to check to make sure that the vbo is available each time through the loop because loading
            // textures may force vbos out of the cache (see loop below).
            if (!this.shouldUseVBOs(dc))
            {
                FloatBuffer vb = this.coordBuffer;
                gl.glVertexPointer(ColladaAbstractGeometry.COORDS_PER_VERTEX, GL.GL_FLOAT, 0, vb.rewind());
            }

            for (Geometry geometry : this.geometries)
            {
                Material nextMaterial = geometry.material != null ? geometry.material : defaultMaterial;
View Full Code Here


                {
                    vboIds = this.getVboIds(dc);
                    if (vboIds == null)
                    {
                        FloatBuffer vb = this.coordBuffer;
                        gl.glVertexPointer(ColladaAbstractGeometry.COORDS_PER_VERTEX, GL.GL_FLOAT, 0, vb.rewind());
                    }
                }

                if (vboIds != null)
                    this.doDrawInteriorVBO(dc, geometry, vboIds);
View Full Code Here

        try
        {
            FloatBuffer vb = this.coordBuffer;
            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboIds[0]);
            gl.glBufferData(GL.GL_ARRAY_BUFFER, vb.limit() * Buffers.SIZEOF_FLOAT, vb.rewind(), GL.GL_STATIC_DRAW);
        }
        finally
        {
            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
        }
View Full Code Here

    vertices
      .put(-50).put(-50)
      .put(50).put(-50)
      .put(-50).put(50)
      .put(50).put(50);
    vertices.rewind();

    final IntBuffer indices = BufferUtils.createIntBuffer(4);
    indices.put(0).put(1).put(2).put(3);
    indices.rewind();
View Full Code Here

        if (_supportsAniso) {
            // Due to LWJGL buffer check, you can't use smaller sized
            // buffers (min_size = 16 for glGetFloat()).
            final FloatBuffer max_a = BufferUtils.createFloatBuffer(16);
            max_a.rewind();

            // Grab the maximum anisotropic filter.
            GL11.glGetFloat(EXTTextureFilterAnisotropic.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, max_a);

            // set max.
View Full Code Here

        if (vertexBuffer == null) {
            GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
        } else {
            GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
            vertexBuffer.rewind();
            GL11.glVertexPointer(vertexBufferData.getValuesPerTuple(), 0, vertexBuffer);
        }
    }

    public void setupNormalData(final FloatBufferData normalBufferData) {
View Full Code Here

        if (normalBuffer == null) {
            GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
        } else {
            GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
            normalBuffer.rewind();
            GL11.glNormalPointer(0, normalBuffer);
        }
    }

    public void setupColorData(final FloatBufferData colorBufferData) {
View Full Code Here

        if (colorBuffer == null) {
            GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
        } else {
            GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
            colorBuffer.rewind();
            GL11.glColorPointer(colorBufferData.getValuesPerTuple(), 0, colorBuffer);
        }
    }

    public void setupFogData(final FloatBufferData fogBufferData) {
View Full Code Here

        if (fogBuffer == null) {
            GL11.glDisableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT);
        } else {
            GL11.glEnableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT);
            fogBuffer.rewind();
            EXTFogCoord.glFogCoordPointerEXT(0, fogBuffer);
        }
    }

    public void setupTextureData(final List<FloatBufferData> textureCoords) {
View Full Code Here

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData.getBuffer();

                    GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                    textureBuffer.rewind();
                    GL11.glTexCoordPointer(textureBufferData.getValuesPerTuple(), 0, textureBuffer);
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.