sfml problem/question regarding VideoMode

Started by
5 comments, last by BaneTrapper 11 years, 5 months ago
Hello.
I have no field of experience in sfml window sizes that are allowed, so here i ask :

If i want my screen window to be 800(width) x 600(height) for easy drawing and manipulation,
and the users configuration(The video card or the motherboard) does not accept this how to change resolution. So keep the blitting at 800 x 600? but the window to be 860 x 680?
Advertisement
You can use VideoMode::getFullscreenModes to get a vector of all valid (fullscreen) modes. If you require a resolution that is not supported then you can do as you suggest, and just draw to a sub-section of the window. Just check the enumerated mode for the next largest valid mode, or use native resolution, and center your active area. Be aware that this may annoy your players, some more than others. For such a small window, given the native resolution of modern LCD monitors (and you should try to stick to native resolution, for image quality) 800x600 will amount to more black-space than used-space. I would certainly complain about a game that did that. I highly recommend you do what you can to use a higher active resolution.

For windowed mode, 800x600 shouldn't be a problem.

I would certainly complain about a game that did that. I highly recommend you do what you can to use a higher active resolution.

I got sprites and images made to suit this need, sprites are 50x50 and if i made 1248 x 1024 that's a really small sprite you got there. (24x20=480 sprites fit on screen)
Also you could just fullscreen.

Am thinking about going 1024 x 768, but then i most reedit all my : Images, Tileset and "Sheet".

But if i make it 1248 x 1024 what if someone cant get that high resolution like my other old computer?
What are the solutions :
1 shrink before displaying
2 make it scrollable, this sounds good but id get annoying pretty soon.

How do modern games tackle this problem?
Modern games tackle this problem by either choosing the native resolution by default, or letting the user choose what resolution they want to use. It really is annoying to have to use a lower resolution that doesn't match the native res of your monitor, because then you get blurring. You can scale your sprites to match the resolution, or you can have different sprites created to match the different resolution, which is more work but creates better results. Either way, you really need to take into account modern hardware for this stuff.

Modern games tackle this problem by either choosing the native resolution by default, or letting the user choose what resolution they want to use. It really is annoying to have to use a lower resolution that doesn't match the native res of your monitor, because then you get blurring. You can scale your sprites to match the resolution, or you can have different sprites created to match the different resolution, which is more work but creates better results. Either way, you really need to take into account modern hardware for this stuff.

Well the test game when i made it, 800x600 and made it fullscreen(1280x1024), it still looked "okay".
I done understand how to do this :
Modern games tackle this problem by either choosing the native resolution by default, or letting the user choose what resolution they want to use[/quote]

1: Choosing a native resolution? ( Like setting a 1280x1024 ? )
2: Giving a player to chose what screen resolution to use? ( A tips on how to do this would be appreciated )
I mixed people thoughts, i thought allowing application fullscreen. But when i think about it, almost each game has "Select screen size" and then you pick which one you want, but what does happen actually?
What FLeblanc and I mean when we say "native resolution" is that every LCD monitor has a recommended resolution, dependent upon the monitor's size and quality. Using this recommended resolution means that there is a 1:1 correspondence between a "logical pixel" (what resides in the frame buffer) and a physical pixel (the actual bit of screen hardware that displays a pretty color). Choosing a resolution that is not the recommended resolution means that logical pixels can be spread across multiple physical pixels, resulting in blurring and shimmering artifacts as the picture moves.

By default, a game should detect optimal resolution by default (going with a user's current desktop resolution is probably best, since it will usually be the optimal setting) but present a dropdown box of alternative, allowable modes they can choose from if they have performance problems or other personal reasons to switch. But my personal opinion is that you shouldn't force a player to a non-optimal fullscreen resolution by default, and any game that does is likely to earn my ire.

What FLeblanc and I mean when we say "native resolution" is that every LCD monitor has a recommended resolution, dependent upon the monitor's size and quality. Using this recommended resolution means that there is a 1:1 correspondence between a "logical pixel" (what resides in the frame buffer) and a physical pixel (the actual bit of screen hardware that displays a pretty color). Choosing a resolution that is not the recommended resolution means that logical pixels can be spread across multiple physical pixels, resulting in blurring and shimmering artifacts as the picture moves.

I understand what you are trying to tell me.

By default, a game should detect optimal resolution by default (going with a user's current desktop resolution is probably best, since it will usually be the optimal setting) but present a dropdown box of alternative, allowable modes they can choose from if they have performance problems or other personal reasons to switch. But my personal opinion is that you shouldn't force a player to a non-optimal fullscreen resolution by default, and any game that does is likely to earn my ire.

But i got no clue how to set this one up, I am supposed to make a new code for each resolution?
1024x768 vs 1280x1024. Each resolution needs it own code, at 1024x768 my sprite needs to move 10,24 pixels per sec, at 1280x1024 my sprite needs to move 12,80 pixels per second to pass the same distance...
Or em i missing something big?
Any tutorials on this subject, how to set it up?



EDIT : After a long day i figured out something simple to break this. Thanks on help all.

This topic is closed to new replies.

Advertisement