Animation and Printing to Terminal

  • Follow


Hi.  I've got a GLUT-based OpenGL application that does 3-D volume
rendering with a single fragment program.  The computation this program
does is considerable.  Occasionally, it spits out messages to stdout,
which happens to be the terminal from which the program was invoked.
However, when the terminal goes to display the message, a strange
staggered refresh occurs -- it is quite jarring.

For instance, if my terminal happens to allow for four lines (not
realistic), and the program spits out line 5 to stdout, I see flicker
before my eyes a sequence of the following stages:

STAGE 1
line 1
line 2
line 3
line 4

STAGE 2
line 2
line 3
line 4
line 5

The sequence goes something like 1, 2, 1, 2, 1, 2, ... for however many
lines are displayed in the terminal window.  This happens when I'm
using either glutTimerFunc (at every 16 ms) or glutIdleFunc to perform
animation.  The terminal I use is gnome-terminal, it doesn't occur in
xterm, and I have no other terminal application.  The problem doesn't
seem to mind which shell is running.

I liken the problem to a competitive arm-wrestling match between the
terminal window and the application window.  At first it seems like the
application window is winning, then the terminal, then the application,
then the terminal, and so on, until finally, with the crowd on the edge
of their seats, the application window deals one last blow to silence
the terminal forever.

Anyone run into this strange n-way handshaking?

- Chris

0
Reply crjjrc (28) 1/3/2007 8:52:33 PM

"crjjrc" <crjjrc@gmail.com> wrote in message 
news:1167857553.436386.174490@42g2000cwt.googlegroups.com...
> Hi.  I've got a GLUT-based OpenGL application that does 3-D volume
> rendering with a single fragment program.  The computation this program
> does is considerable.  Occasionally, it spits out messages to stdout,
> which happens to be the terminal from which the program was invoked.
> However, when the terminal goes to display the message, a strange
> staggered refresh occurs -- it is quite jarring.
>
> For instance, if my terminal happens to allow for four lines (not
> realistic), and the program spits out line 5 to stdout, I see flicker
> before my eyes a sequence of the following stages:
>
> STAGE 1
> line 1
> line 2
> line 3
> line 4
>
> STAGE 2
> line 2
> line 3
> line 4
> line 5
>
> The sequence goes something like 1, 2, 1, 2, 1, 2, ... for however many
> lines are displayed in the terminal window.  This happens when I'm
> using either glutTimerFunc (at every 16 ms) or glutIdleFunc to perform
> animation.  The terminal I use is gnome-terminal, it doesn't occur in
> xterm, and I have no other terminal application.  The problem doesn't
> seem to mind which shell is running.
>
> I liken the problem to a competitive arm-wrestling match between the
> terminal window and the application window.  At first it seems like the
> application window is winning, then the terminal, then the application,
> then the terminal, and so on, until finally, with the crowd on the edge
> of their seats, the application window deals one last blow to silence
> the terminal forever.
>
> Anyone run into this strange n-way handshaking?
>
> - Chris
>

What exactly is strangly flickering? The terminal window? The Graphics 
window?
The gnome terminal probably has some property that causes the window manager 
to restack windows. Or you are sending special characters to stdout...

jbw


0
Reply jbwest 1/4/2007 2:01:42 AM


jbwest wrote:

> > Hi.  I've got a GLUT-based OpenGL application that does 3-D volume
> > rendering with a single fragment program.  The computation this program
> > does is considerable.  Occasionally, it spits out messages to stdout,
> > which happens to be the terminal from which the program was invoked.
> > However, when the terminal goes to display the message, a strange
> > staggered refresh occurs -- it is quite jarring.
> >
> > For instance, if my terminal happens to allow for four lines (not
> > realistic), and the program spits out line 5 to stdout, I see flicker
> > before my eyes a sequence of the following stages:
> >
> > STAGE 1
> > line 1
> > line 2
> > line 3
> > line 4
> >
> > STAGE 2
> > line 2
> > line 3
> > line 4
> > line 5
> >
> > The sequence goes something like 1, 2, 1, 2, 1, 2, ... for however many
> > lines are displayed in the terminal window.
>
> What exactly is strangly flickering? The terminal window? The Graphics
> window?
> The gnome terminal probably has some property that causes the window manager
> to restack windows. Or you are sending special characters to stdout...

It's the terminal window that flickers.  No special characters are
being sent.  I've tried out konsole and that terminal program doesn't
flicker.  I suppose I'll switch terminals.

- Chris

0
Reply crjjrc 1/4/2007 3:38:10 PM

2 Replies
124 Views

(page loaded in 0.073 seconds)

Similiar Articles:




7/13/2012 10:27:22 PM


Reply: