From 775fc270e606cc73aff8e39899ff9a6a446ea183 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Apr 2016 07:00:22 -0400 Subject: [PATCH] Fixed bug whereby first frame drawn has random collection of data. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index a9afeb42e..5b7b07a37 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -78,13 +78,15 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int buffer_depth) : _output_mutex(new std::mutex), _visible_area(Rect(0, 0, 1, 1)), _composite_src_output_y(0), + _cleared_composite_output_y(0), _composite_shader(nullptr), _rgb_shader(nullptr), _output_buffer_data(nullptr), _source_buffer_data(nullptr), _input_texture_data(nullptr), _output_buffer_data_pointer(0), - _source_buffer_data_pointer(0) + _source_buffer_data_pointer(0), + _drawn_source_buffer_data_pointer(0) { _run_builders = new CRTRunBuilder *[NumberOfFields]; for(int builder = 0; builder < NumberOfFields; builder++) @@ -229,7 +231,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out } // for television, update intermediate buffers and then draw; for a monitor, just draw - if(_output_device == Television) + if(_output_device == Television || !rgb_shader_program) { // decide how much to draw if(_drawn_source_buffer_data_pointer != _source_buffer_data_pointer)