Hello,
I can get OpenGL to render 3D scenes to the screen, but I want to render them to a pixel array. Basically I want some magical code to fill in the blanks for this code segment:
int width=500;
int height=500;
uint32_t *colours=new uint32_t[width*height];
//Magic code!
glBegin(GL_TRIANGLES);
//other drawing stuff, preferably no magic here?
glEnd();
//Magic code!
uint32_t c=*colours;//c should be the top-left pixel rendered by opengl
From my research it seems as though I should use a framebuffer object to do this, I am just not sure exactly how they work. Any help?