Hi,
You can set desktop default refresh rate and this is done by most users (I
don’t know many win95/98 users which are working in 60Hz). After this, 99%
of applications automaticaly sets this refresh rate when opening a new
fullscreen.
No, in Win95/98 Direct Draw sets up by default 60 Hz no matter what
system settings are.
And all SDL apps on all Win95/98 (and on at least half Win2000/WinXP)
uses 60 Hz, no matter what default settings are.
That’s why this is the problem.
Most modern games don’t touch the refresh; that’s why tools exist to hack
the refresh list. SDL is in the 99.9% that isn’t doing it, because doing
so makes programs not work on some systems.
Most modern games touches the refresh rate, I say it as member of
swrus-games conference, I know dozens game authors and companies and
ALL of them changes refresh rate in their games because 60 Hz is no so
good for commercial game (and for user too).
The only potentially safe trick is to look at the desktop resolution, and if
the resolution being set by SDL is <= that, use the highest available refresh
rate <= the desktop refresh.
In Win95/98 it can’t be done in all cases
The way out is to provide programmer with SDL API that can change
monitor frequency.
And programmer could decide - either use it or not.
Why would he? It’s not his job.
It is. His job is to write perfect program (game).
Maybe you want an interface to fix
IRQ and DMA settings with SDL, too?
No, this is done by OS.
I’d say SDL should try to use the maximum allowed refresh rate, and=20
rely on the system configuration to be correct. I’ve seen very few=20
commercial games that have a user option for refresh rate, but that=20
doesn’t seem to be a problem.
You are right, but sometimes user has got incorrect monitor drivers in
Windows, so we cannot know true maximum allowed refresh rate, but we
still can get list of supported refresh rates. For game it is OK (±
5% of users no matter), but for well known graphics library I suppose
it is unsuitable.
My patch (I posted it here) goes this way.
But now I prefer this API:
int frequency;
SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO);
frequency = SDL_GetMaxRefreshRate(800, 600, 32, SDL_HWSURFACE|SDL_FULLSCREEN | SDL_DOUBLEBUF);
SDL_SetDefaultRefreshRate(frequency);
SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE| SDL_FULLSCREEN | SDL_DOUBLEBUF);
This is optional in use, compatible with old programs and useful for
those who wants change refresh rate.
I ask you to add two bogus functions SDL_GetMaxRefreshRate and
SDL_SetDefaultRefreshRate for all SDL video drivers like this:
int SDL_GetMaxRefreshRate(int width, int height, int bpp, int flags) { return 0; }
void SetDefaultRefreshRate(int frequency) { };
Then we can step by step fulfill them.–
Best regards,
Dmitry Yakimov, ISDEF member
ActiveKitten.com