Package java.nio

Examples of java.nio.FloatBuffer.flip()


            center = new Vector3f();
        }
        FloatBuffer buf = BufferUtils.createFloatBuffer(points.limit());
        points.rewind();
        buf.put(points);
        buf.flip();
        recurseMini(buf, buf.limit() / 3, 0, 0);
    }

    /**
     * Used from calcWelzl. This function recurses to calculate a minimum
View Full Code Here


            tb.put(0f).put(1f);
            tb.put(1f).put(1f);
            tb.put(0f).put(0f);
            tb.put(1f).put(0f);
        }
        tb.flip();
       
        buf = getBuffer(VertexBuffer.Type.TexCoord);
        if (buf != null) {
            buf.updateData(tb);
        } else {
View Full Code Here

            texcoords.put(startX).put(startY).put(endX).put(endY);
        }
        positions.flip();
        colors.flip();
        sizes.flip();
        texcoords.flip();

        // force renderer to re-send data to GPU
        pvb.updateData(positions);
        cvb.updateData(colors);
        svb.updateData(sizes);
View Full Code Here

          if (this.quadCount > 0) {
            colorBuffer = BufferUtils.createFloatBuffer(this.quadColorBuffer.length).put(this.quadColorBuffer);
            vertexBuffer = BufferUtils.createFloatBuffer(this.quadVertexBuffer.length).put(this.quadVertexBuffer);

            colorBuffer.flip();
            vertexBuffer.flip();

            GL11.glColorPointer(4, 0, colorBuffer);
            GL11.glVertexPointer(3, 0, vertexBuffer);
            GL11.glDrawArrays(GL11.GL_QUADS, 0, this.quadCount);
View Full Code Here

          if (this.lineCount > 0) {
            colorBuffer = BufferUtils.createFloatBuffer(this.lineColorBuffer.length).put(this.lineColorBuffer);
            vertexBuffer = BufferUtils.createFloatBuffer(this.lineVertexBuffer.length).put(this.lineVertexBuffer);

            colorBuffer.flip();
            vertexBuffer.flip();

            GL11.glColorPointer(4, 0, colorBuffer);
            GL11.glVertexPointer(3, 0, vertexBuffer);
            GL11.glDrawArrays(GL11.GL_LINES, 0, this.lineCount);
View Full Code Here

        FloatBuffer buffer = BufferUtils.createFloatBuffer(16);

        for (int i=0; i<16; i++) {
            buffer.put(matrix.at(i));
        }
        buffer.flip();

        glMatrixMode(mode);
        glLoadMatrix(buffer);
    }
View Full Code Here

                buff.put(data[x].getRed()).put(data[x].getGreen()).put(data[x].getBlue()).put(data[x].getAlpha());
            } else {
                buff.put(0).put(0).put(0).put(0);
            }
        }
        buff.flip();
        return buff;
    }

    /**
     * Create a new FloatBuffer of an appropriate size to hold the specified number of ColorRGBA object data.
View Full Code Here

                buff.put(data[x].getXf()).put(data[x].getYf()).put(data[x].getZf()).put(data[x].getWf());
            } else {
                buff.put(0).put(0).put(0);
            }
        }
        buff.flip();
        return buff;
    }

    /**
     * Create a new FloatBuffer of an appropriate size to hold the specified number of Vector4 object data.
View Full Code Here

                buff.put(data[x].getXf()).put(data[x].getYf()).put(data[x].getZf());
            } else {
                buff.put(0).put(0).put(0);
            }
        }
        buff.flip();
        return buff;
    }

    /**
     * Create a new FloatBuffer of an appropriate size to hold the specified number of Vector3 object data.
View Full Code Here

                buff.put(data[x].getXf()).put(data[x].getYf());
            } else {
                buff.put(0).put(0);
            }
        }
        buff.flip();
        return buff;
    }

    /**
     * Create a new FloatBuffer of an appropriate size to hold the specified number of Vector2 object data.
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.