- int flip_y = 0, frame_state = command->frame->get_opengl_state();
- switch( frame_state ) {
-// Upload texture and composite to screen
- case VFrame::RAM:
- flip_y = 1;
- case VFrame::SCREEN:
- command->frame->to_texture();
- 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:
- printf("Playback3D::write_buffer_sync unknown state\n");
- break;
+ int frame_state = command->frame->get_opengl_state();
+ if( frame_state != VFrame::TEXTURE )
+ command->frame->to_texture();
+ if( frame_state != VFrame::RAM ) {
+ command->in_y1 = command->frame->get_h() - command->in_y1;
+ command->in_y2 = command->frame->get_h() - command->in_y2;