LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: macninja on February 08, 2012, 20:05:07

Title: glColor3fv([n][3])
Post by: macninja on February 08, 2012, 20:05:07
http://lwjgl.org/wiki/index.php?title=About_LWJGL   " Thrown out methods designed for efficient C programming that make no sense at all in java, such as glColor3fv."  


public void makeSense()
{
public float[][] colors = {{0,0,1},
    {0,1,0},
    {1,0,0},
    {0,1,1},
    {1,0,1},
            {1,1,0},};
GL11.glColor3f(colors[0][0], colors[0][1], colors[0][2]);
||
GL11.glColor3fv(colors[0]);
}
Title: Re: glColor3fv([n][3])
Post by: abcdef on February 09, 2012, 12:33:59
When you realise actually how its implemented in lwjgl you will realised it does indeed make no sense.

All float arrays are passed as FloatBuffers (java.nio), unlike c where you need to define your fixed array's upfront, in java using these you don't.