Linux to Windows port questions

  1. as SDL_WM_ToggleFullScreen does nothing in Windows, is there
    currently any way to get around this, any recommended reading, or am I
    condemned to insist on a restart to change resolution?

  2. My OpenGL framerate dropped from about 330fps in Linux to 85fps, is
    there a known reason this is likely to happen or am I a stuck? As it
    stands, the Linux binary hogs the CPU quite nicely while the
    Windows .exe chugs along at 5% even if set to realtime priority.

I’ll probably have other joyful questions to ask at some point, but at
least one of them is OpenGL specific so you’re spared that one :op

tia, Paul

Send instant messages to your online friends http://uk.messenger.yahoo.com

Hey paul, if for #2 it’s capped constantly at 85fps or just about, the
"problem" is you have vsync on in windows and not in linux. Vsync limits
your drawing refresh rate to the refresh rate of your monitor.

Vsync SHOULD be left on though unless your benchmarking because it reduces
tearing (:

If you want to take it off though, you can turn it off through your driver
or I actually have a function here to do it:

void VSyncOn(char On)
{
#ifdef WIN32
typedef void (APIENTRY * WGLSWAPINTERVALEXT) (int);

WGLSWAPINTERVALEXT wglSwapIntervalEXT = (WGLSWAPINTERVALEXT)
wglGetProcAddress(“wglSwapIntervalEXT”);
if (wglSwapIntervalEXT)
{
wglSwapIntervalEXT(On); // set vertical synchronisation
}
#endif
}

I think you just need to include windows.h and you should be good to go on
the above.

VSyncOn(0); to turn off vsync and VSyncOn(1); to turn it on (:> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Paul Duffy
Sent: Sunday, June 04, 2006 5:27 PM
To: sdl at libsdl.org
Subject: [SDL] Linux to Windows port questions

  1. as SDL_WM_ToggleFullScreen does nothing in Windows, is there
    currently any way to get around this, any recommended reading, or am I
    condemned to insist on a restart to change resolution?

  2. My OpenGL framerate dropped from about 330fps in Linux to 85fps, is
    there a known reason this is likely to happen or am I a stuck? As it
    stands, the Linux binary hogs the CPU quite nicely while the
    Windows .exe chugs along at 5% even if set to realtime priority.

I’ll probably have other joyful questions to ask at some point, but at
least one of them is OpenGL specific so you’re spared that one :op

tia, Paul

Send instant messages to your online friends http://uk.messenger.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Check the wiki:

http://www.libsdl.org/cgi/docwiki.cgi/FAQ_20SDL_5fWM_5fToggleFullScreen>

  1. as SDL_WM_ToggleFullScreen does nothing in Windows, is there
    currently any way to get around this, any recommended reading, or am I
    condemned to insist on a restart to change resolution?

Hello Paul,

Monday, June 5, 2006, 1:27:10 AM, you wrote:

PD> 1) as SDL_WM_ToggleFullScreen does nothing in Windows, is there
PD> currently any way to get around this, any recommended reading, or am I
PD> condemned to insist on a restart to change resolution?

SDL_WM_ToggleFullScreen() has been marked depracted for quite a while now.

Why do you have to restart your app to change res? Plenty of windows
games manage this without a restart. You can call SDL_SetVideoMode()
again with another resolution, just bear in mind that you will
probably have to reload textures.

PD> 2) My OpenGL framerate dropped from about 330fps in Linux to 85fps, is
PD> there a known reason this is likely to happen or am I a stuck? As it
PD> stands, the Linux binary hogs the CPU quite nicely while the
PD> Windows .exe chugs along at 5% even if set to realtime priority.

The hint is the CPU usage. You will have vsync on as this is the
default for most Windows 3D drivers.–
Best regards,
Peter mailto:@Peter_Mulholland