I need to draw a specific shape using OpenGL, but the thing is that I don't want it to display inside the application window, but to save it as a 24-bit .bmp
file. I can create the .bmp
file header myself, and given some sort of an image array I can generate the entire .bmp
file.
My questions are:
- Can this be done automatically? Meaning, is there a command in OpenGL where instead of displaying the graphic, it saves it as a data array? Or even better, as a
.bmp
file? - If #1 is not possible, how do I access the buffer where OpenGL stores my drawing data, and what is the format of this data?
- In addition, can I avoid displaying the image? Or do I have to display the image, because the buffer needs to be created?