Commit a087368e authored by Tim Übelhör's avatar Tim Übelhör

Require explicit swap_buffer

parent 9e945bd6
......@@ -48,13 +48,16 @@ public:
another read is running on the backbuffer :)
\retuns might return NULL otherwise the data
*/
void* do_read();
void *do_read();
/*!
Unmaps the OpenGL memory and swaps front- & backbuffer.
Unmaps the OpenGL memory.
*/
void end_read();
/*! Swap the front- and backbuffer */
void swap_buffers();
private:
int width;
int height;
......@@ -66,8 +69,5 @@ private:
int backbuffer_index = 0;
// transfer from pbo to CPU memory
int frontbuffer_index = 1;
/*! Swap the front- and backbuffer */
void swap_buffers();
};
} // namespace scigl_render
......@@ -52,6 +52,7 @@ void ExampleRender::next_frame(const CvCamera &camera, const Model &model,
check_gl_error("synchronous reading from pbo");
display_data(data);
offscreen_render.end_read();
offscreen_render.swap_buffers();
check_gl_error("end synchronous reading");
}
......
......@@ -56,7 +56,6 @@ void *OffscreenRender::do_read()
void OffscreenRender::end_read()
{
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
swap_buffers();
}
void OffscreenRender::swap_buffers()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment