X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fvframe3d.C;h=42d91ba1af0b77d1a9243a3d1db105e02a84c6e8;hb=048758971ba1956419f8f6d60100c2de28f1b16f;hp=52f096d7fa444385895067c2bce5a2bf82bf0949;hpb=3305343c3d9bfb889f6892e7821cc0e2d68669de;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/vframe3d.C b/cinelerra-5.1/guicast/vframe3d.C index 52f096d7..42d91ba1 100644 --- a/cinelerra-5.1/guicast/vframe3d.C +++ b/cinelerra-5.1/guicast/vframe3d.C @@ -398,13 +398,16 @@ unsigned int VFrame::make_shader(const char **segments, ...) unsigned int program = 0; #ifdef HAVE_GL // Construct single source file out of arguments - int nb_segs = 1; - if( !segments ) { + int nb_segs = 0; + if( !segments ) { // arg list va_list list; va_start(list, segments); while( va_arg(list, char*) != 0 ) ++nb_segs; va_end(list); } - const char *segs[nb_segs]; + else { // segment list + while( segments[nb_segs] ) ++nb_segs; + } + const char *segs[++nb_segs]; if( !segments ) { va_list list; va_start(list, segments); for( int i=0; i=0 ? clear_color : 0; + int a = clear_color>=0 ? clear_alpha : 0; + int r = (rgb>>16) & 0xff; + int g = (rgb>> 8) & 0xff; + int b = (rgb>> 0) & 0xff; + if( BC_CModels::is_yuv(get_color_model()) ) + YUV::yuv.rgb_to_yuv_8(r, g, b); + glClearColor(r/255.f, g/255.f, b/255.f, a/255.f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); #endif }