Flip() CPU usage

software that I am working on. I noticed that when I would call flip()
X would use up to %20 of the CPU at only 10 fps Once I stopped calling
flip() X went down to .5 . I had a doublebuffer | hwsuport enabled.
The image size I have been using a 720*480 image on a Celeron533 under
X3 Any thoughts? Does this sound about right? Does this mean that to
get it up to 30fps I would have too allow up to 60% of the cpu. Also I
am curius if I ran it using svgalib would it be faster?

-Benjamin Meyer

software that I am working on. I noticed that when I would call flip()
X would use up to %20 of the CPU at only 10 fps Once I stopped calling
flip() X went down to .5

Well, your image won’t be updated on the screen without the flip().

:slight_smile:

It would probably be faster with fbcon or SVGAlib, or even XFree86 4.0

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

software that I am working on. I noticed that when I would call flip()
X would use up to %20 of the CPU at only 10 fps Once I stopped calling
flip() X went down to .5

Well, your image won’t be updated on the screen without the flip().

If X11 performance is at all important, careful use of SDL_UpdateRects()
is preferred instead of flip.

“Mattias Engdeg?rd” wrote:

software that I am working on. I noticed that when I would call flip()
X would use up to %20 of the CPU at only 10 fps Once I stopped calling
flip() X went down to .5

Well, your image won’t be updated on the screen without the flip().

If X11 performance is at all important, careful use of SDL_UpdateRects()
is preferred instead of flip.

It is a full screen update. I.e. camera fotage. From the docs it seems that
flip() would be faster in that case.

-Benjamin

It is a full screen update. I.e. camera fotage. From the docs it seems that
flip() would be faster in that case.

It is no slower when running in windowed mode, and with hardware acceleration
in fullscreen mode, it’s faster.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I’m not sure if this is too off-topic…

My game is currently divided into several main packages, one for the
source, one for the media, (images/sounds) and one for script files. I
need a Makefile that will respond to a “make install” by putting these
somewhere standardized, like /usr/local/games/angelwars/ or something, but
I don’t even know where to start with this…can anyone help with this, or
tell me where I can find more information?

Incidentally, SDL_image loads some PCX files with the wrong colors on my
(Redhat-6.1-x86) system…looks like it reverses red and green or
something, since our red demon comes out dark green. This isn’t TERRIBLY
important since we’re not using PCXs for the game anymore, but I’m rather
curious as to whether anyone else has seen this. :slight_smile:

- lancekt

Orin K. Tresnjak-Smith schrieb am 08 Jun 2000:

I’m not sure if this is too off-topic…

My game is currently divided into several main packages, one for the
source, one for the media, (images/sounds) and one for script files. I
need a Makefile that will respond to a “make install” by putting these
somewhere standardized, like /usr/local/games/angelwars/ or something, but
I don’t even know where to start with this…can anyone help with this, or
tell me where I can find more information?

I can only tell you what I did in glTron:
First, I put everything in one tar-ball, everything else is just a
support hassle. If you really want seperate packages, make sure they
extract to the right directory and use AC_CHECK_FILE in ./configure.in
to make sure everything is there and tell them they probably forgot
to download all tar balls.

About file locations: What I do is, I wrote a function
char* getFullPath(char *filename) that just checks a few paths
(i.e. ./data, /usr/local/share/games/gltron, /usr/share/games/gltron)
and returns the right path (or NULL), so the calling routine can do fopen().

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.53)

Incidentally, SDL_image loads some PCX files with the wrong colors on my
(Redhat-6.1-x86) system…looks like it reverses red and green or
something, since our red demon comes out dark green.

I wouldn’t be surprised if it’s one of the bugs I found in SDL_image.
Fix for that and several other bugs, as well as some other new stuff
will be in next SDL_image release (if Sam accepts my patches).