How to take screenshot in OpenGL
This piece of code captures the OpenGL window and export to a BMP file. You must have FreeImage library to run it. // Make the BYTE array, factor of 3 because it’s RBG. BYTE* pixels = new BYTE[3 * width * height]; glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); // Convert to FreeImage format & … Read more