Package java.nio

Examples of java.nio.ShortBuffer.flip()


    ShortBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.clear();
    int saved_position = buffer.position();
    direct_buffer.put(buffer);
    buffer.position(saved_position);
    direct_buffer.flip();
    return direct_buffer;
  }

  private static FloatBuffer lookupBuffer(FloatBuffer buffer) {
    CachedBuffers buffers = getCachedBuffers(buffer.remaining()*4);
 
View Full Code Here


        } else {
            for (Bone bone : skeleton.getRoots()) {
                this.writeConnections(sib, bone);
            }
        }
        sib.flip();

        this.updateCounts();
    }

    /**
 
View Full Code Here

            return null;
        }
        ShortBuffer buff = createShortBuffer(data.length);
        buff.clear();
        buff.put(data);
        buff.flip();
        return buff;
    }

    /**
     * Creates a new ShortBuffer with the same contents as the given ShortBuffer.
View Full Code Here

            sib.put( (short) (curIndex++) );
            sib.put( (short) (curIndex++) );
        }

        fpb.flip();
        sib.flip();

        setBuffer(Type.Position, 3, fpb);
        setBuffer(Type.Index, 2, sib);
       
        setMode(Mode.Lines);
View Full Code Here

            // triangle 2
            ib.put((short)(startIdx + 1))
              .put((short)(startIdx + 2))
              .put((short)(startIdx + 3));
        }
        ib.flip();

        buf = getBuffer(VertexBuffer.Type.Index);
        if (buf != null) {
            buf.updateData(ib);
        } else {
View Full Code Here

            return null;
        }
        final ShortBuffer buff = createShortBuffer(data.length);
        buff.clear();
        buff.put(data);
        buff.flip();
        return buff;
    }

    /**
     * Create a new ShortBuffer of an appropriate size to hold the specified number of shorts only if the given buffer
View Full Code Here

            if (size > 0) {
                final String[] strings = tmpEl.getAttribute("data").split("\\s+");
                for (final String s : strings) {
                    tmp.put(Short.valueOf(s));
                }
                tmp.flip();
            }
            ret = tmp;
        } catch (final Exception e) {
            final IOException ex = new IOException();
            ex.initCause(e);
View Full Code Here

        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );

        ShortBuffer indexDataBuffer = BufferUtils.createShortBuffer( indexData.length );
        indexDataBuffer.put( indexData );
        indexDataBuffer.flip();

        indexBufferObject = glGenBuffers();
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, indexBufferObject );
        glBufferData( GL_ELEMENT_ARRAY_BUFFER, indexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 );
View Full Code Here

        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );

        ShortBuffer indexDataBuffer = BufferUtils.createShortBuffer( indexData.length );
        indexDataBuffer.put( indexData );
        indexDataBuffer.flip();

        indexBufferObject = glGenBuffers();
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, indexBufferObject );
        glBufferData( GL_ELEMENT_ARRAY_BUFFER, indexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 );
View Full Code Here

        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );

        ShortBuffer indexDataBuffer = BufferUtils.createShortBuffer( indexData.length );
        indexDataBuffer.put( indexData );
        indexDataBuffer.flip();

        indexBufferObject = glGenBuffers();
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, indexBufferObject );
        glBufferData( GL_ELEMENT_ARRAY_BUFFER, indexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 );
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.