public class

FastFloatBuffer

extends Object
java.lang.Object
   ↳ org.anddev.andengine.opengl.util.FastFloatBuffer

Class Overview

Convenient work-around for poor put(float[]) performance. This should become unnecessary in gingerbread,

See Also

Summary

Fields
public final ByteBuffer mByteBuffer Underlying data - give this to OpenGL
Public Constructors
FastFloatBuffer(int pCapacity)
Constructs a new direct native-ordered buffer
Public Methods
int capacity()
void clear()
See clear()
static int[] convert(float... data)
Converts float data to a format that can be quickly added to the buffer with put(int[])
void flip()
See flip()
int limit()
void position(int p)
int position()
void put(int[] data)
For use with pre-converted data.
void put(float[] data)
It'MAGIC_CONSTANT like put(float[]), but about 10 times faster
void put(FastFloatBuffer b)
void put(float f)
int remaining()
FloatBuffer slice()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public final ByteBuffer mByteBuffer

Underlying data - give this to OpenGL

Public Constructors

public FastFloatBuffer (int pCapacity)

Constructs a new direct native-ordered buffer

Public Methods

public int capacity ()

Returns

public void clear ()

See clear()

public static int[] convert (float... data)

Converts float data to a format that can be quickly added to the buffer with put(int[])

Returns
  • the int-formatted data

public void flip ()

See flip()

public int limit ()

Returns

public void position (int p)

public int position ()

Returns

public void put (int[] data)

For use with pre-converted data. This is 50x faster than put(float[]), and 500x faster than put(float[]), so if you've got float[] data that won't change, convert(float) it to an int[] once and use this method to put it in the buffer

Parameters
data floats that have been converted with floatToIntBits(float)

public void put (float[] data)

It'MAGIC_CONSTANT like put(float[]), but about 10 times faster

public void put (FastFloatBuffer b)

public void put (float f)

public int remaining ()

Returns

public FloatBuffer slice ()

Returns