class allowing to render to a texture and save the texture to a file (without intervention in the shaders)
USAGE:
-
Include the header
#include "ScreenDump.hpp"
-
Create an instance of the class
ScreenDump screenDump(width,height);
-
Use bool for triggering
bool dump_toFile;
-
Do the following in the render loop:
if (dump_toFile) { screenDump->bindData(width, height); // width, height of the screen }
draw();
if (dump_toFile) { screenDump->dumpTexImage(fileName); screenDump->unbindData(); dump_toFile = false; }