Hi Owen,
Thanks for your detailed posts.
It is now looking like the text problem is a bug in the QT4 renderText. I compiled the latest stellarium-0.10.1 from source and got similar problems. in particular missing chars. (See this post "problem with fonts in Stellarium 0.10.1"
http://sourceforge.net/forum/forum.php?thread_id=2978794&forum_id=278769, but I think the problem may be in QT rather than the video driver)
I found a very crude work around by adding these line in GLView. (you may need to do an svn update)
if (!Cfg::quickStart)
{
renderText(10,10,"~", m_timeRatingFont); //fixme this is a work around for a QT bug.
renderText(10,10,"~", m_timeSigFont); //fixme this is a work around for a QT bug.
}
The "~" char would be missing from any text (if you changed "~" to "B" then the B of Bar would be missing). I now get the flickering you describe for each bar but only with the video optimisation
turned on and only with the time signature text. It would be useful to try PB with the latest version of Qt in case there is already a bug fix for this problem. We really should report this as a bug to qt since I have seen exactly the same problem in stellarium-0.10.1.
There is an alternative and that is to manually draw the text and not use qt renderText as per the stroke.c example code available on this page
http://www.sgi.com/products/software/opengl/examples/redbook/The video optimisation is something that I have implemented myself and it works by only redrawing just the scrolling area that is moving and not clearing and redrawing the whole screen every frame. Unfortunately it seems that some gl graphic drivers do not like it if you do not redraw the whole screen every frame and so I added the option to disable it. I have not found an example/tutorial on how to do a partial screen redraw so I may not be doing it correctly.
At first sight it might appear quite easy to scroll the notes across the page but in reality it is quite difficult which is probably explains why most other (all other?) sequencers don't do it. Instead they keep the notes still and move a marker across the page.
The first problem is in order to
read the notes from the page you don't want see any flickering when scrolling. So to try and get the notes to move smoothly I have a _very_ high frame rate. currently it is 12msec or 83Hz. (You can try playing with this value, search for "m_timer.start" in GlView.cpp. What value works best for you?).
At the moment the midi update rate is tied to the graphics refresh rate but ideally the midi update rate should go much faster at once every 1msec.
If you put in a lower video frame rate then the "opengl tearing problem" becomes more obvious. The tearing problem is much worse because we are scrolling
across the screen. Programs like Frets on Fire scroll down the screen and so the tearing problem may not be so noticeable. Can you see any tearing on TuxRacer?
Incidentally the green on black colours is to try and use they eyes ability to persist a flash of light on the retina. If I had used black notes on a white background then it would be the white light of the background that would persist in the retina causing the black notes to blur when they are moved.
The problem with a high frame rate is that pb then starts to eat up CPU time, this bad news for a real-time app. I have tried hard to use as little of the CPU time as possible so that I don't use up all of my allocated CPU time. I have not given PB any special real time status/priority as I do not know how to do this. Does any body know how to do this?
THE FIX for the tearing problem is to use QGLFormat::setSwapInterval() with a value of 0, but unfortunately I could not get this to work.(start pb with the -X2 to enable this experimental code). If someone can get this work then this would also mean we could use a more sensible video frame rate.
Also see this very old post about the tearing problem
http://lists.trolltech.com/qt-interest/2006-04/msg00313.htmlL o u i s