change composer to chroma only - no src alpha blend, resize about pref, new expanders...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / playback3d.C
index 6d6dee358b5bc18e72fae98e0ed45ce3b131cf59..2ca2a4c68e4d43f35f03595d76f23e8a6483d1d4 100644 (file)
@@ -659,6 +659,13 @@ void Playback3D::write_buffer_sync(Playback3DCommand *command)
                                window->enable_opengl();
 // Composite texture to screen and swap buffer
                        case VFrame::TEXTURE:
+                               if( !flip_y ) {
+                                       int fh1 = command->frame->get_h()-1;
+                                       float in_y1 = fh1 - command->in_y1;
+                                       float in_y2 = fh1 - command->in_y2;
+                                       command->in_y1 = in_y2;
+                                       command->in_y2 = in_y1;
+                               }
                                draw_output(command, flip_y);
                                break;
                        default:
@@ -717,11 +724,11 @@ void Playback3D::draw_output(Playback3DCommand *command, int flip_y)
                        BC_GL_YUV_TO_RGB(shader);
                }
 
-               if(BC_CModels::components(color_model) == 4)
-               {
-                       glEnable(GL_BLEND);
-                       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-               }
+//             if(BC_CModels::components(color_model) == 4)
+//             {
+//                     glEnable(GL_BLEND);
+//                     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+//             }
 
                command->frame->draw_texture(
                        command->in_x1, command->in_y1, command->in_x2, command->in_y2,
@@ -960,19 +967,6 @@ void Playback3D::overlay_sync(Playback3DCommand *command)
                glColor4f(1, 1, 1, 1);
                glDisable(GL_BLEND);
 
-               if(command->frame) {
-// Render to PBuffer
-                       command->frame->enable_opengl();
-                       command->frame->set_opengl_state(VFrame::SCREEN);
-                       canvas_w = command->frame->get_w();
-                       canvas_h = command->frame->get_h();
-               }
-               else {
-// Render to canvas
-                       canvas_w = window->get_w();
-                       canvas_h = window->get_h();
-               }
-
 
 //printf("Playback3D::overlay_sync 1 %d\n", command->input->get_opengl_state());
                switch( command->input->get_opengl_state() ) {
@@ -987,16 +981,26 @@ void Playback3D::overlay_sync(Playback3DCommand *command)
                case VFrame::SCREEN:
                        command->input->enable_opengl();
                        command->input->screen_to_texture();
-                       if(command->frame)
-                               command->frame->enable_opengl();
-                       else
-                               window->enable_opengl();
                        break;
                default:
                        printf("Playback3D::overlay_sync unknown state\n");
                        break;
                }
 
+               if(command->frame) {
+// Render to PBuffer
+                       command->frame->enable_opengl();
+                       command->frame->set_opengl_state(VFrame::SCREEN);
+                       canvas_w = command->frame->get_w();
+                       canvas_h = command->frame->get_h();
+               }
+               else {
+// Render to canvas
+                       window->enable_opengl();
+                       canvas_w = window->get_w();
+                       canvas_h = window->get_h();
+               }
+
 
                const char *shader_stack[16];
                memset(shader_stack,0, sizeof(shader_stack));