From 9890e7442943f7e2ae5642ad7d74c23b0d9e0300 Mon Sep 17 00:00:00 2001 From: Lukas Kogler Date: Tue, 8 Nov 2016 13:01:40 +0100 Subject: [PATCH] accidentally changed to indirect rendering - reverted that. formatting --- ng/drawing.tcl | 4 ++-- ng/parallelfunc.cpp | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ng/drawing.tcl b/ng/drawing.tcl index a0fcb102..a19b1c8e 100644 --- a/ng/drawing.tcl +++ b/ng/drawing.tcl @@ -21,7 +21,7 @@ puts "togl-version : $toglversion" set toglok 0 if { [Ng_GetToglVersion] == 2 } { # Togl 2.x - if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } { + if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false -create init -display draw -reshape reshape }] } { puts "no OpenGL" } { # puts "have Togl 2.1" @@ -29,7 +29,7 @@ if { [Ng_GetToglVersion] == 2 } { } } { # Togl 1.7 - if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } { + if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false }] } { puts "no OpenGL" } { # puts "have Togl 1.7" diff --git a/ng/parallelfunc.cpp b/ng/parallelfunc.cpp index 2985f0d0..d3e6d7d7 100644 --- a/ng/parallelfunc.cpp +++ b/ng/parallelfunc.cpp @@ -138,7 +138,7 @@ void ParallelRun() string redraw_cmd; // MyMPI_Recv (redraw_cmd, 0, MPI_TAG_VIS); redraw_cmd = MyMPI_RecvCmd(); - + // PrintMessage (1, "Redraw - ", redraw_cmd); static string displname; @@ -147,16 +147,17 @@ void ParallelRun() static Display * display = NULL; static GLXContext context; static XVisualInfo * visinfo = 0; - + // if (!display) if (redraw_cmd == "init") { MyMPI_Recv (displname, 0, MPI_TAG_VIS); MyMPI_Recv (curDrawable, 0, MPI_TAG_VIS); MyMPI_Recv (contextid, 0, MPI_TAG_VIS); - + display = XOpenDisplay (displname.c_str()); + /* PrintMessage (3, "displ - name = ", displname); PrintMessage (3, "display = ", display, @@ -179,8 +180,8 @@ void ParallelRun() cout << "P" << id << ": window-props: x = " << wx << ", y = " << wy << ", w = " << ww << ", h = " << wh << ", depth = " << depth << endl; - */ - + */ + #define VISUAL #ifdef VISUAL @@ -269,20 +270,22 @@ void ParallelRun() // context = glXCreateContext( display, visinfo, 0, /* curContext, */ False ); context = glXCreateContext( display, visinfo, glXImportContextEXT ( display, contextid ), False); glXMakeCurrent (display, curDrawable, context); + + #else // try to get GLXcontext from the master. // this needs an indirect context (BUT DOES NOT WORK ????) + context = glXImportContextEXT ( display, contextid ); - //PrintMessage (1, "GLX-contextid = " , contextid, - // " imported context ", context); + PrintMessage (1, "GLX-contextid = " , contextid, + " imported context ", context); glXMakeCurrent (display, curDrawable, context); #endif // PrintMessage (1, "redraw - init complete"); } - if (redraw_cmd == "broadcast") {