glws::Context *context = NULL;
int window_width = 256, window_height = 256;
-bool reshape_window = false;
unsigned frame = 0;
long long startTime = 0;
static void snapshot(Image::Image &image) {
GLint drawbuffer = double_buffer ? GL_BACK : GL_FRONT;
GLint readbuffer = double_buffer ? GL_BACK : GL_FRONT;
- glGetIntegerv(GL_READ_BUFFER, &drawbuffer);
+ glGetIntegerv(GL_DRAW_BUFFER, &drawbuffer);
glGetIntegerv(GL_READ_BUFFER, &readbuffer);
glReadBuffer(drawbuffer);
glReadPixels(0, 0, image.width, image.height, GL_RGBA, GL_UNSIGNED_BYTE, image.pixels);
static void frame_complete(void) {
++frame;
- if (!reshape_window && (snapshot_prefix || compare_prefix)) {
+ if (snapshot_prefix || compare_prefix) {
Image::Image *ref = NULL;
if (compare_prefix) {
char filename[PATH_MAX];
}
}
- if (reshape_window) {
- // XXX: doesn't quite work
- drawable->resize(window_width, window_height);
- reshape_window = false;
- }
-
ws->processEvents();
}