I need a C++ module that takes two images and flips between them in sync with the monitor refresh rate, displaying one at a time. It must be possible to change the two images simultaneously by use of a single function call. If images A and B are currently being displayed, and images C and D are passed in, the module must switch directly to flipping between images C and D it must not flip between A and D or B and C as an intermediate stage.
Both images will have the same dimensions and colour depth.
The C++ module must be in the form of a C++ object. It must support the following prototype functions
extern bool Launch(long xRes, long yRes); //where xRes and yRes are the desired screen resolution
extern bool PutImages(unsigned char* img1Bytes, unsigned char* img2Bytes, long width, long height, long stride);
extern <type> GetEvent(); //this will check for keypress or mouse events and return them in an appropriate manner.
extern bool DisplayClose();
Pseudo code for displaying an image would be:
PutImage(image1, image2, 640, 480, 1920);
event = GetEvent();
while(event != event_close);
The code should be well commented and free of bugs including memory leaks. The required libraries for compilation must be clearly specified.
Bids using either DirectX or OpenGL will be considered. If DirectX is to be used then the version must be specified in advance.
It is a requirement that the module work in fullscreen mode.
It is preferable if the module works in windowed mode as well.