2 Questions

So after writing a (very primitive) font engine, and playing with SDL
for 3 days (snow days at work) I’ve crafted 3 little “demos” . I’m a
beginner at almost all of this, but no matter what I options I set
or whether I use double-buffering or not, my simple animation jitters on

my Dell Latitude (PII 350) (in addition to being rather more slow than
I would expect).

Is there some trick people use to make their animations smooth? How
are you guys doing timing? (Is using 800 x 600 depth 32 just Not a Good
Idea?)

My (extremely lame) efforts are at http://www.hackthis.net/wabe/

Do the OpenGL tutorials work on machines that don’t have hardware
OpenGL? (will they run at any sort of speed at all?)

-wabe
(thanks in advance. man. I feel quilty asking such lame questions
when the guy who wrote SDL is actually reading.)

So after writing a (very primitive) font engine, and playing with SDL
for 3 days (snow days at work) I’ve crafted 3 little “demos” . I’m a
beginner at almost all of this, but no matter what I options I set
or whether I use double-buffering or not, my simple animation jitters on

my Dell Latitude (PII 350) (in addition to being rather more slow than
I would expect).

Is there some trick people use to make their animations smooth? How
are you guys doing timing? (Is using 800 x 600 depth 32 just Not a Good
Idea?)

Nope, that’s fairly slow. You’ll notice that the qrash demo is 640x480.
In general, use the lowest resolution you can get away with. Especially
since you’re running fullscreen, you can probably fit your effects in a
smaller resolution.

Also, 32bpp is a lot of data to be pushing around. If you can get away
with it, try using palette tricks and set an 8-bit display mode. If you
need millions of colors, use 16 bpp - you’ll get nearly the same effect
at nearly twice the speed.

Do the OpenGL tutorials work on machines that don’t have hardware
OpenGL? (will they run at any sort of speed at all?)

They will run slowly. :slight_smile:

(thanks in advance. man. I feel quilty asking such lame questions
when the guy who wrote SDL is actually reading.)

Who me? I’m not reading! Really! :slight_smile:

See ya,
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

wabe wrote:

So after writing a (very primitive) font engine, and playing with SDL
for 3 days (snow days at work) I’ve crafted 3 little “demos” . I’m a
beginner at almost all of this, but no matter what I options I set
or whether I use double-buffering or not, my simple animation jitters on

What do you mean by “jitters”? Does the (1) screen flash wildly or
something, or (2) is the movement blocky? The former is caused by
improperly doing draw/erase cycles. Cure: double buffering. The latter
is also called temporal aliasing and can be cured by generating more and
finer frames.

my Dell Latitude (PII 350) (in addition to being rather more slow than
I would expect).

The only time I ever had the screen flashing wildly (jitter sense 1),
was when I disabled SDL_DOUBLEBUF when creating my screen surface. I’ve
never seen it happen otherwise on any of the machines I’ve developed SDL
programs for (a P133 with an S3 ViRGE, a P133 with an old S3 Trio64V+,
and my present AMD K6-2 450 with an Nvidia Riva TNT: the first two
machines are very much slower than what you have unless it’s a
degenerate configuration). If the movement is blocky (sense 2), that
probably means that you aren’t making enough frames so that whoever’s
watching thinks its continuous motion. My SDL program right now is a
simple (it’s not OpenGL) 3D animation engine, and the animation is
smooth, albeit it can become extremely slow in terms of frame rate. If
your jitter is sense 1, then you may have a hardware quirk of some
sort. Real lame explanation but it’s the only reason I can think of.
Maybe SDL can’t create a double buffered surface automatically on your
hardware, and so you’ll have to do software double buffering (something
I can’t really explain in a short space and won’t unless it really turns
out to be the solution). Check to see if SDL really is making a double
buffered surface when you try making it. What version are you using?
Maybe you’re trying to do SDL_FULLSCREEN on X using a really old version
of SDL that uses DGA on its X Windows fullscreen; double buffering and
XF86_DGA don’t mix. If it’s sense 2, then you simply ought to generate
more frames of your animation: make more frames with less change between
them so that the eye gets fooled more convincingly. If your machine
can’t really produce frames quickly enough, it will usually still look
smooth, but extremely slow to an ordinary viewer.–

| Rafael R. Sevilla @Rafael_R_Sevilla |
| Instrumentation, Robotics, and Control Laboratory |

College of Engineering, University of the Philippines, Diliman

Sam Lantinga wrote:

Is there some trick people use to make their animations smooth? How
are you guys doing timing? (Is using 800 x 600 depth 32 just Not a Good
Idea?)

Nope, that’s fairly slow. You’ll notice that the qrash demo is 640x480.
In general, use the lowest resolution you can get away with. Especially
since you’re running fullscreen, you can probably fit your effects in a
smaller resolution.

Also, 32bpp is a lot of data to be pushing around. If you can get away
with it, try using palette tricks and set an 8-bit display mode. If you
need millions of colors, use 16 bpp - you’ll get nearly the same effect
at nearly twice the speed.

Argh… 800x600 with 32 bpp is just fine with DirectDraw (2D hardware
acceleration)…

(just my usual whining about the unavailability of 2D hardware
acceleration in XFree86)–
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/

Argh… 800x600 with 32 bpp is just fine with DirectDraw (2D hardware
acceleration)…

Try performing the same test he posted - locking the surface and modifying
each individual pixel, each frame.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec