Hi All, I am starting being frustrated.
Im am trying to use SDL2 with my ogre3d engine game.
Have setup the SDL resources in order to have the video subsystem set in place without the gl context being created (the gl context is being created by ogre).
Ogre is being passed the sdl render window as an external resource.
Fine, I got rendered what I want in the “sdl window” and I got sdl events being sniffed too but…
No matter which configuration I use:
1 sdl initialization in the main thread/ogre main AND separate thread for sdl event processing
2 sdl initialization in the same (dedicated) sdl event processing thread
3 sdl initialization in the main thread/ogre main AND sdl event processing in the main thread
I can detect the correct events eg mouse move, mouse pressed, keyboard pressed events but I can not obtain their correct values (eg event.motion.xrel and event.motion.yrel are always both set to zero or at most I get 1 and 0 for each of them if I switch the setup configuration - one of the three above)
Theoretically sdl2 should not be able to gather events through SDL_PollEvent and SDL_WaitEvent if the initialization is being performed in a different thread than the one where we are sniffing for them but instead it does work.
This is not a matter of concern however cause I am able to arrange the sdl configuration in any fashion I want and it works till the point where I need to read event values.
The same applies for keyboard events…I am able to poll or wait for any keyboard event but I can not read which kind of key has fired the keyboard event.
Thank you so much.
Seems that I ve to use the SDL_GetRelativeMouseState() function in order to get the relative mouse coordinates…for some reason the xrel and the yrel values set in the mouse motion are not usable.
I checked if the SDL_Event went for some reason out of the scope and it is NOT the case - I get not usable values since I get the structure being compiled by the SDL_WaitEvent() call.
Is this behaviour known?
About my configuration, I am using mingw 7.1.0 and SDL 2.0.7
PS I please the moderators to remove the same topic in the game development forum, Thanks!