4
votes

I am interested in using SDL for graphics. I didn't use it before because when I went into fullscreen mode I would get black borders on the left and right side. I switched to SFML, and it worked just fine because I wasn't in fullscreen mode, but I had a window that stretched to the entire screen. The graphics stretched along with it. I've been noticing a few games are beginning to use a windowed-fullscreen mode.

Is there a way to stretch SDL's window with graphics instead of pure fullscreen mode?

1
Assuming that the black bars are there at all because the resolution you chose didn't match the screen (in which case, try to use a resolution that fits perfectly), I think this is a per-PC graphics card setting type o'thingy and not something you'd expect to change from your program.Leushenko
@Leushenko: Yes, although the goal is to just stretch a borderless window with its graphics to a full screen. I understand that SDL doesn't stretch when going into fullscreen mode.Phil

1 Answers

3
votes

Consider using this function to get fullscreen:

SDL_SetWindowFullscreen - https://wiki.libsdl.org/CategoryVideo

And just this function to stretch it to the screen size:

SDL_MaximizeWindow - https://wiki.libsdl.org/SDL_MaximizeWindow

Hope that was what you were looking for.