Permalink
Browse files

Fix clearing of video area in quad-buffered stereo mode.

  • Loading branch information...
1 parent 3ffdada commit fe7181288edfca857e318b49e0d5a55bce15b118 Frédéric Devernay committed with marlam Dec 13, 2010
Showing with 20 additions and 3 deletions.
  1. +17 −2 src/video_output_opengl.cpp
  2. +2 −0 src/video_output_opengl.h
  3. +1 −1 src/video_output_opengl_qt.cpp
@@ -335,6 +335,21 @@ enum decoder::video_frame_format video_output_opengl::frame_format() const
return _src_preferred_frame_format;
}
+void video_output_opengl::clear()
+{
+ if (_mode == stereo)
+ {
+ glDrawBuffer(GL_BACK_LEFT);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glDrawBuffer(GL_BACK_RIGHT);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ else
+ {
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+}
+
static void draw_quad(float x, float y, float w, float h)
{
glBegin(GL_QUADS);
@@ -351,7 +366,7 @@ static void draw_quad(float x, float y, float w, float h)
void video_output_opengl::display(bool toggle_swap_eyes, float x, float y, float w, float h)
{
- glClear(GL_COLOR_BUFFER_BIT);
+ clear();
if (!_have_valid_data[_active_tex_set])
{
return;
@@ -567,7 +582,7 @@ void video_output_opengl::reshape(int w, int h)
{
// Clear
glViewport(0, 0, w, h);
- glClear(GL_COLOR_BUFFER_BIT);
+ clear();
// Compute viewport with the right aspect ratio
float dst_w = w;
@@ -86,6 +86,8 @@ class video_output_opengl : public video_output
// Swap the texture sets (one active, one for preparing the next video frame)
void swap_tex_set();
+ // Clear the video area
+ void clear();
// Display the current texture set. The first version of this function is used
// by Equalizer; simple windows will use the second version.
void display(bool toggle_swap_eyes, float x, float y, float w, float h);
@@ -86,7 +86,7 @@ void video_output_opengl_qt_widget::move_event()
void video_output_opengl_qt_widget::initializeGL()
{
- glClear(GL_COLOR_BUFFER_BIT);
+ _vo->clear();
if (opengl_version_vector.size() == 0)
{
set_opengl_version_vector();

0 comments on commit fe71812

Please sign in to comment.