glColor3fv([n][3])

Started by macninja, February 08, 2012, 20:05:07

Previous topic - Next topic

macninja

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]);
}

abcdef

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.