Re: [AD] set_display_mode and screen update handling |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Elias Pschernig wrote:
Then the question comes in, as to what should have priority?
Windowed/fullscreen or bitdepth? If the bitdepth and screen mode combo
isn't available, should the screen mode switch first or bitdepth?
True.
Not that it's impossible. It's just that the only way I can think of to
get that kind of "requesting" from Allegro's functions is to loop and
try until something succeeds. As you can see, it loops for
windowed/fullscreen currently, so if the last tried mode isn't
available, it tries the other.. until it runs out of user-supplied
options and just gives up (with the exception being if the user supplies
neither windowed or fullscreen, it'll just try GFX_AUTODETECT once).
Though there probably is a bug related to that that I'd need to fix.
I can do the same for the bitdepths too.. I'd just need to know if it
should give priority to changing the bitdepth first or the
windowed/fullscreen setting. It'd just be the difference of:
while(more_depths_to_try) {
while(more_fs_win_settings_to_try) {
}
}
and
while(more_fs_win_settings_to_try) {
while(more_depths_to_try) {
}
}
I personally think the fullscreen/windowed settings should give-way and
change first. On most (all?) systems, windowed mode is just as fast as
fullscreen, I believe.
The same goes for switching between page-flipping and double-buffering.
I think we could set_display_mode remember the last values, and when it
is called again, and only the update method changed, only do what's
necessary to change that.
Hmm.. that should be possible. Just check what the user passed against
the current screen (if it exists), and then just not bother trying to
reset the mode if there's a match.
Does set_gfx_mode kill the current video mode if it tries to set a bad
mode while still in a valid mode?
Well, just an al_get_front_buffer would work as well. It would return
the video bitmap currently being displayed, so you can set screen to it
before calling a GUI function.
The get_screen function returns a pointer to the bitmap currently being
displayed on screen (changing it will change what you see).
- Kitty Cat