i need to draw in an offscreen buffer a gl (simple) scene and to retrieve the result pixel data.
to retrieve the data i use glReadPixels.
i don’t need any window at all, so my wish is not to use glut.
i’d like to have something simple like:
init_buffer(GL_AUX0, width, height); glDrawBuffer(GL_AUX0); glReadBuffer(GL_AUX0); Draw(); //function ususally passed to glutDisplayFunc //initialization of data array glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT, &data);
i haven’t found a way to do this, because i’m not able to initialize the buffer size and the
contents of data array are totally wrong.
any help, please?