how to switch between full screen and windowed mode ? and other questions.

7 views
Skip to first unread message

ha...@dse.nl

unread,
Dec 2, 2018, 8:27:03 AM12/2/18
to Simple 2D
Hi great project !

Some questions :

1) how to switch between full screen and windowed mode ?

Adding S2D_FULLSCREEN to window->flags in an on_key function does not do the trick.
Looks like this can only be set on S2D_CreateWindow.
Must I therefore S2D_FreeWindow and create a new window with S2D_CreateWindow ?
Or is there a better option ?

2) how to get mouse scroll wheel direction and distance ?

We have the S2D_MOUSE_SCROLL event. How to read in which direction the wheel was scrolled, and how far ?
We have the normal/inverted flags
#define S2D_MOUSE_SCROLL_NORMAL   SDL_MOUSEWHEEL_NORMAL
#define S2D_MOUSE_SCROLL_INVERTED SDL_MOUSEWHEEL_FLIPPED
and while this is a good thing to have, this does not change on wheel-up or down.
Is SDL_MouseWheelEvent struct exposed somewhere ? Looks like that has the needed info.

3) I wrote a simple CMake config. Would this be interesting for others ?

-- Hans

Simple 2D

unread,
Jan 16, 2019, 8:05:19 PM1/16/19
to Simple 2D
Hi Hans,

Sorry I missed your message — the listserv is usually pretty quiet and most the convos are in repo issues now. I don't think we have the ability (yet) to make full screen after window creation, but it is possible (using SDL_SetWindowFullscreen). We can add a new function for this, but in the meantime, you can use SDL directly with:

SDL_SetWindowFullscreen(window->sdl, SDL_WINDOW_FULLSCREEN);
// or...
SDL_SetWindowFullscreen
(window->sdl, SDL_WINDOW_FULLSCREEN_DESKTOP);

Regarding the mouse scroll event, I'm not sure. Do you mind opening an issue on the repo and figure it out there?

Regarding CMake, pretty cool. I'm not sure of others using it, but could be neat to look at, see if it could be helpful.

Thanks,
Tom
Reply all
Reply to author
Forward
0 new messages