Problem with SDL

Hello all
I have a problem (is nothing new) :
I am even thereby a Pong clone to be programmed and have a problem that the
impacts be moved somewhat to flicker. As I cannot eliminate this, other
plays have the problem. The SOURCE code is on http://www.simply-all.de (a
German page) has this with the image repetition frequency of the monitor to
do much? If like wars I it out? Thanks in advance

HP: That is translated with Bablefish into English

Ferhat

here the the same in german:

Halli alle
Ich habe ein Problem (ist nichts neues):
Ich bin gerade dabei ein Pong Clone zu programmieren und habe ein Problem
mit den Schl?gern die ein bisschen ruckeln. Ich konnte dies nicht
beseitigen, ander spiele haben dieses Problem nicht. Der Source code ist auf
der Seite http://www.simply-all.de ( eine deutsche Seite). Hat dies
vieleicht mit der Frequenz des Monitors zutun. Wenn ja wie bekomme ich sie
heraus.

Danke im Voraus

Ferhat
ferhat ziba schrieb in Nachricht <96ejde$155$1 at ftp.lokigames.com>…> Hello all

I have a problem (is nothing new) :
I am even thereby a Pong clone to be programmed and have a problem that the
impacts be moved somewhat to flicker. As I cannot eliminate this, other
plays have the problem. The SOURCE code is on http://www.simply-all.de (a
German page) has this with the image repetition frequency of the monitor to
do much? If like wars I it out? Thanks in advance

HP: That is translated with Bablefish into English

Ferhat

Ich bin gerade dabei eine Pong Klone zu Programmieren, aber die Schl?ger
Flackern. Ich dachte mir ob es an der Hz meines Monitors liegen k?nnte.
Und
ich wollte wissen wie man dieses Flackern vermeidet ! Andere Spiele haben
dieses Problem nicht .

I’m just programming a Pong clone, but the paddles flicker.

I thought of the frequency of my monitor, and I’d like to know if it’s

possible

to stop this flickering. Other games don’t have this problem.

IS there a way to stop it?
I looked up his code, btw, he’s using SetVideoMode with the flags
SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_HWPALETTE.

HTH
Pius

“Pius II.” wrote:

Ich bin gerade dabei eine Pong Klone zu Programmieren, aber die Schl?ger
Flackern. Ich dachte mir ob es an der Hz meines Monitors liegen k?nnte.
Und
ich wollte wissen wie man dieses Flackern vermeidet ! Andere Spiele haben
dieses Problem nicht .

I’m just programming a Pong clone, but the paddles flicker.

I thought of the frequency of my monitor, and I’d like to know if it’s

possible

to stop this flickering. Other games don’t have this problem.

IS there a way to stop it?
I looked up his code, btw, he’s using SetVideoMode with the flags
SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_HWPALETTE.

I’ve had this happen before. Out of curiosity, is it smoother without
the HWSURFACE and DOUBLEBUF flags?

-John–
Underfull \account (badness 10000) has occurred while \spend is active
John R. Hall - Student, Georgia Tech - Contractor, Loki Software

“Pius II.” wrote:

Ich bin gerade dabei eine Pong Klone zu Programmieren, aber die
Schl?ger

Flackern. Ich dachte mir ob es an der Hz meines Monitors liegen
k?nnte.
Und

ich wollte wissen wie man dieses Flackern vermeidet ! Andere Spiele
haben

dieses Problem nicht .

I’m just programming a Pong clone, but the paddles flicker.

I thought of the frequency of my monitor, and I’d like to know if it’s

possible

to stop this flickering. Other games don’t have this problem.

IS there a way to stop it?
I looked up his code, btw, he’s using SetVideoMode with the flags
SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_HWPALETTE.

I’ve had this happen before. Out of curiosity, is it smoother without
the HWSURFACE and DOUBLEBUF flags?

Perhaps the hardware surfaces and double buffering aren’t supported with his
graphics card?

Is he using a rectangle update method if using software mode?>From: “John R. Hall”

Reply-To: sdl at lokigames.com
To: sdl at lokigames.com
Subject: Re: [SDL] Problem with SDL
Date: Wed, 14 Feb 2001 16:30:27 -0500


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

I’ve had this happen before. Out of curiosity, is it smoother
without the HWSURFACE and DOUBLEBUF flags?

That seems to be no curiosity. If I remember right, someone earlier wrote on
this list, that Hardware Surfaces are slower than Software Surfaces. The
secound thing is, that doublebuffering must be supported by the graphics
hardware. The third problem might be the Surface blitting, best thing to do
is: blitting SWSURFACES to SWSURFACES or HWSURFACES to HWSURFACES. Anything
else would be real slow.

Maybe he should try to use SWSURFACE and no HWPALETTE. DOUBLEBUF only makes
sense, if supported by the graphics hardware, so check if to use it and than
decide what update function to use. (is he using SDL_Flip for updating?)

greets,

Sascha

(is he using SDL_Flip for updating?)
Yes, I am using SDL_Flip !

Sascha G?nther schrieb in Nachricht …

I’ve had this happen before. Out of curiosity, is it smoother
without the HWSURFACE and DOUBLEBUF flags?

That seems to be no curiosity. If I remember right, someone earlier wrote
on
this list, that Hardware Surfaces are slower than Software Surfaces. The
secound thing is, that doublebuffering must be supported by the graphics
hardware. The third problem might be the Surface blitting, best thing to do
is: blitting SWSURFACES to SWSURFACES or HWSURFACES to HWSURFACES. Anything
else would be real slow.

Maybe he should try to use SWSURFACE and no HWPALETTE. DOUBLEBUF only makes
sense, if supported by the graphics hardware, so check if to use it and
than>decide what update function to use. (is he using SDL_Flip for updating?)

greets,

Sascha

(is he using SDL_Flip for updating?)
Yes, I am using SDL_Flip !

Hmm… sorry for that just answered out of the box, without checking the
whole thread, so it seemed we are talking about a person in the 3rd person.

SDL_Flip (* SDL_Surface); makes a quick-blitting of the (double)buffered
Surface to the Surface representing the output (viewable). This blitting is
hardware accellerated, if doublebuffering is supported by the graphics
hardware. If it is not supported, or if you haven’t set the SDL_DOUBLEBUF
flag, when setting up the screen, it will work the same as SDL_UpdateRect (*
SDL_Surface, 0,0,* SDL_Surface->w, * SDL_Surface->h);

This means, if you have a screensize of 800x600 for example, there is a
whole screen update (what is pretty slow, if you it is not the "real"
SDL_Flip, but the SDL_UpdateRect). I am not sure, if you really need to
update the whole screen (only usefull, when you scroll the whole screen),
elseif, it might be faster, if you use SDL_UpdateRects (* SDL_Surface, *
SDL_Rect); and write a little routine, to collect the areas to be updated
(maybe optimize the set of SDL_Rects, before you call SDL_UpdateRects).

If you really need a fullscreen update, there might be other possibilities,
that are “smoother”, if you can’t access double-buffering. If SDL_DOUBLEBUF
is supported, SDL_Flip is definitly the only choice, to update a
SDL_Surface.

Greets,

Sascha