<disclaimer>
OK, let me say first that I know next to nothing about the C language but I'm writing a simple little OpenGL program and C is the language I have to use (and I mean pure C and glut.framework ... no cooca, appkit, Obj -C etc.. This is actually the 4th of a little series I have to write and they've all been written on my mac and run seamlessly on windows .. which is what I need) .
</disclaimer>
So here's the issue: I'm setting up a bunch of arrays for points of various polygons in OpenGL. Code looks like
GLfloat column[][2] = { {3.25, 1}, {3.75,1}, {3.75,13}, {3.25,13}};
easy enough so far. But, I need to set one such GLfloat array to the return value of a function ... something like
GLfloat piece[][2] = setpiece();
.. but I have no idea what the syntax should look like. I've tried a couple of things and get "invalid initializer" (amongst other things when I screw around with it). So how do I initialize and set piece[][2] to the return value of a function ? It is unknown when I call the function how many elements will be in the 2D array so the function needs to size and return a 2D array of GLfloats as when I was setting GLfloat column[][2] = { {3.25, 1}, {3.75,1}, {3.75,13}, {3.25,13}};
Any help or redirects to a similar code sample would be helpful ... I know this must be a piece of cake for any reasonably experienced C coder and I can't seem to find a similar code sample.
Muchos Gracias