URL87
URL87

Reputation: 11022

Get float[] as FloatBuffer class

Having a float[] and I want to put it as argument for glLoadMatrixf(FloatBuffer m) (interface of GLMatrixFunc) .

How could I get the float[] as FloatBuffer ?

The code is -

float[] currentMatrix = {.....} ;
gl.glLoadMatrixd(currentMatrix ); 

The above prompts - The method glLoadMatrixf(FloatBuffer) in the type GL is not applicable for the arguments (float[])

Upvotes: 0

Views: 149

Answers (1)

René Link
René Link

Reputation: 51393

float[] floatArray = ...;
FloatBuffer floatBuffer = FloatBuffer.wrap(floatArray);

Upvotes: 3

Related Questions