Files
vimix/Screenshot.h
Bruno Herbelin 7858033628 Player Frame capture F10
New feature of Player: capture frame (F10 shortcut). Extending the Screenshot class for reading pixels and saving to PNG. Cleaup of screenshot (now associated to F9).
2022-06-22 01:40:47 +02:00

32 lines
659 B
C++

#ifndef SCREENSHOT_H
#define SCREENSHOT_H
#include <string>
class Screenshot
{
int Width, Height, bpp;
unsigned char * Data;
unsigned int Pbo;
unsigned int Pbo_size;
bool Pbo_full;
static void storeToFile(Screenshot *s, std::string filename);
void capture();
public:
Screenshot();
~Screenshot();
// Quick usage :
// 1) Capture screenshot
void captureGL(int w, int h);
void captureFramebuffer(class FrameBuffer *fb);
// 2) if it is full after capture
bool isFull();
// 3) then you can save to file
void save(std::string filename);
};
#endif // SCREENSHOT_H