self._on_quit_event(event.quit)elifevent_type == sdl2.SDL_WINDOWEVENT: self._on_window_event(event.window)elifevent_type == sdl2.SDL_KEYDOWN: self._on_key_down_event(event.key, scene_state)elifevent_type == sdl2.SDL_KEYUP: self._on_key_up_event(event.key)elifevent_type == sd...
window.event == SDL_WINDOWEVENT_SIZE_CHANGED)) { SDL_SetWindowSize(window, e.window.data1, e.window.data2); } if(e.type == SDL_QUIT) { SDL_Quit(); return 0; } } } I'm not really sure if this issue would belong here, as this really is the product of dubious code, so ...
}#endif/* See if the current window has lost focus */if(mouse->focus) {SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_LEAVE,0,0); } mouse->focus = window;if(mouse->focus) {SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_ENTER,0,0); }/* Update cursor visibility */SDL_SetCur...
It seems like that with SDL 2.30.0-1.1 as packaged by OpenSUSE, KDE Plasma Shell 5.27.10 with a Wayland session, SDL defaulting to SDL_VIDEODRIVER=x11 in this setup, causes the window creates a bogus SDL_WINDOWEVENT_ENTER and bogus SDL_MOUSEMOTION event. This leads to the app incorrectly...
float scale_factor = SDL_GetDisplayContentScale(SDL_GetDisplayForWindow(window)); In this case scale_factor will be 1.f if the system display scale is at 100% or 2.f if the scale is at 200% If I change this scale while the game is running the SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED ev...
SDL_WINDOW_OPENGL | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_ALWAYS_ON_TOP; pWindow =SDL_CreateWindow("My first SDL2 application",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,643,487, fgs);if( pWindow ) {for(inti =0; i <100; i++) { SDL_Event event;while(SDL_PollEvent(&event))...
new decl:typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg, SDL_Window *window, Sint64 *return_val); Modified the event loop and handler so that any message in the event queue can be delivered to the hook function, not just the ones that SDL dispatches. ...
After using SDL_CreateWindowFrom(hwnd) to create a window, using SDL_WaitEvent(&vEvent) to get the keyboard SDL_KEYDOWN and SDL_KEYUP events, what should I do? Collaborator slouken commented Dec 28, 2021 It's assumed that if you're creating the window yourself, you're also handling ...
Keyboard event is only triggered when the mouse cursor is over the SDL window. I still have a lib that I compiled yesterday and it still worked perfectly. So the bug must have been recent. Linux Mint 64bit Cinnamon