How to take a screenshot of an OpenGL window in C++ and save it to file.
I found the glReadPixels() function, but I don\'t know what to do next. Where I can set path
glReadPixels will copy the bits into a memory buffer that you supply. You have to manually format the data (to the image format of your choice) and write it to disk after glReadPixels returns.