Request for a clib2 static link library
I suppose this ticket is not valid anymore, when RebelSDL works with SDL 2.0.12.
Can't manually load libSDL2.so
This was fixed with 2.0.12 release.
SDL2Prefs tool
Done, https://github.com/AmigaPorts/SDL-2.0/blob/main/amiga-extra/prefs.c
.so support is broken with r135
Cleanup - native makefile is ok.
Finish CMake support
Revisit if CMake becomes maintained again
Some keys (cursor left/right) not reacting on mode switch
Cleanup - https://github.com/AmigaPorts/SDL/issues/70#issuecomment-533813567
Add a version tag
See https://github.com/AmigaPorts/SDL/issues/27
Please retest with 2.0.9 RC 2 and if necessary, open a new ticket here: https://github.com/AmigaPorts/SDL We could clean this old project up.
Hiding the mouse pointer doesn't always work
This should be fixed by now, in another dimension ( https://github.com/AmigaPorts/SDL ) -> closing
OpenGL (MiniGL) renderer: render targets are not supported
Documented, closing.
OpenGL (MiniGL) renderer: blend modes ADD and MOD are not really supported
Documented, closing.
Support for 16-bit textures (compositing renderer)
Not likely to fix this. Accelerated renderers generally support truecolor textures only.
Missing window/screen redraw(?) when there is no animation on screen/window/switch
Closing this too, ResidualVM issue?
Screen resize (downsize) fails to draw the whole screen on certain modes
Let's close this ticket and maybe return to the issue later on GitHub.
Missing iconification support
https://github.com/AmigaPorts/sdl2-amigaos4/tree/iconification followed here. Closing this ticket.
Yeah, but do the game suffer from the aspect ratio issue like the launched does? I still don't know if the problem is related to the GUI or general drawing in OpenGL mode.
Restore OpenGL version flags after OGLES2 test so that they don't affect following tests
What about actual games? Are you able to break the display ratio after outside the launcher GUI?
Added some comments regarding test code
Fix test code: don't call legacy OpenGL functions in OGLES2 context
Please try r213 http://capehill.kapsi.fi/sdl2/ . Don't get your hopes high, it's only a partial correction. I'm really stuck with the issue. There is a work around: try CTRL-ALT-A to toggle aspect ratio. This fixes the launcher dialog. So I have debugged both Linux and Amiga builds but the debug outputs are similar. Linux SDL sends a couple more events but even simulating those don't change the dialog behaviour. Also SDL1 build behaves similarly. You cannot resize launcher in window mode (AFAIK)...
Allocate OpenGL buffers based on the given window size (partial fix for ticket #40)
By the way: do you mean LCTRL + LALT + PLUS/MINUS which changes the scaling? After I fixed the bitmap buffer dimensions, there is still some very peculiar issue that affects at least the launcher window. Haven't tried any game. Default 640 * 480 is fine. Same with 320 * 240. But going upwards from 640 breaks the width/height ratio. Coming back to 640, it's still broken. Going lower to 320 fixes it. I made SDL1 build as well and in window mode it's not possible to adjust the scaling? But in fullscreen...
By the way: do you mean LCTRL + LALT + PLUS/MINUS which changes the scaling? After I fixed the bitmap buffer dimensions, there is still some very peculiar issue that affects at least the launcher window. Haven't tried any game. Default 640 * 480 is fine. Same with 320 * 240. But going upwards from 640 breaks the width/height ratio. Coming back to 640, it's still broken. Going lower to 320 fixes it. I made SDL1 build as well and in window mode it's not possible to adjust the scaling? But in fullscreen...
Same in r212?
Screen resize (downsize) fails to draw the whole screen on certain modes
There is surely something wrong in OpenGL mode. In fact from the serial log: [OS4_SetWindowSize] New window size 960720 [OS4_GL_AllocateBuffers] Allocate double buffer bitmaps 640480*32 So there. Dimensions are not in sync for some reason. ... Other thing(s) noticed that going back and forth modes, it's possible to crash either MiniGL or newlib. 2 different stack traces seen so far. Something to investigate further, but I can't do anything about newlib crash if it reproduces (there is no SDL in ...
Modifier key press not released when window is re-created
Super.
Please report to ResidualVM devs. Game enters pause mode (4) when F1 is pressed. If I understand it correctly, in pause mode display is never updated.
Please try r212: http://capehill.kapsi.fi/sdl2/
In my opinion a switch would be better. Maybe you or somebody else would like to build a dynamic version.
[ScummVM] Static projects always builds with -use-dynld
Tabs to spaces
Sync qualifier key states with SDL after window creation. This seems to help with ticket #38. Also refactored headers a bit
Yes, it was asked by configure: https://github.com/scummvm/scummvm/blob/master/configure#L3494 If you want to use static lib, you need to modify that line (--static-libs), or config.mk. It's less hacky than modifying SDK.
I try to implement a workaround first and perhaps ask further tips from SDL folks. When reading Win/X11 backend code I noticed that we don't check CAPS/NUMLOCK status either. Lock might be on before SDL starts.
Take a look at config.mk, included by makefile. -use-dynld switch is there. I think this issue has nothing to do with SDL, but is related ScummVM build system. I propose closing.
This is an SDL issue. I modified "checkeys" program to toggle fullscreen on a certain key press. It can be seen that a modifier key, for example ALT, stays pressed even though released during mode switch. Most likely SDL doesn't get information about key up event, and it also doesn't reset its internal modifier state.
Modifier key press not released when window is re-created
Modifier key press not released
All platforms don't have concept of multiple screens, so they don't have to reopen window during mode switch. I looked at some Win32 API examples on the web and they seem to mostly resize their window, so their "message port" is static. SDL keyboard event should contain current modifier state. This info could be used in the engine instead of keeping book of it separately (have to check). Also there is a separate function call for querying the current modifiers.
[ScummVM] Static projects always builds with -use-dynld
Thanks for detailed steps, it makes my life so much easier. Now, I'm able to reproduce the issue but step 3 is not needed, in my opinion. Since SDL event handling is dead-simple, my hypothesis is simply that since we are dealing with two separate windows, modifier "key up" event is lost during the "blind period" between window 1 closing and window 2 opening. Therefore game thinks it was never freed. But I have to debug it. Technically it would be possible to fake all kind of key up events from SDL...
Thanks for detailed steps, it makes my life so much easier. Now, I'm able to reproduce the issue but step 3 is not needed, in my opinion. Since SDL event handling is dead-simple, my hypothesis is simply that since we are dealing with two separate windows, modifier "key up" event is lost during the "blind period" between window 1 closing and window 2 opening. Therefore game thinks it was never freed. But I have to debug it. Technically it would be possible to fake all kind of key up events from SDL...
I checked ScummVM's configure --help but I don't see which option should force it to link statically. Can you help?
Missing iconification support
Please check commands again from the attachment.
SDL 2.0.7: OpenGL crash on (window/screen) resize
Uh, sourceforge ate some characters but you know what to do..
Please repeat this experiment: /Code/test> echo sdl2-config --static-libs -L/SDK/local/newlib/lib -lSDL2 -lpthread /Code/test> echo sdl2-config --libs -L/SDK/local/newlib/lib -use-dynld -lSDL2 -lpthread
Merge 2.0.6 and 2.0.7
I can see that sometimes during a mode switch cursor reappears but as soon as mouse is moved, it will go away. Have to test more.
Ok, please create a new ticket and let's close this crash ticket for clarity?
Yay, I'm closing a bunch of tickets now..
SDL2 (r208) enters an infite loop on screen(window) switch
Screen elements drawn in crorectly (half missing)
Screen draws elements shifted
Please try also this with r210.
Any update with r210?
Hiding the mouse pointer doesn't always work
Screen elements drawn in crorectly (half missing)
SDL2 (r208) enters an infite loop on screen(window) switch
Please verify also this issue with r210. http://capehill.kapsi.fi/sdl2/
Please try with r210, let's decide after that what to do with this ticket. Probably a new ticket will be needed for input issues. http://capehill.kapsi.fi/sdl2/
Is the window active/focused during cursor issue? Other keys work? Which revision?
Which revision? I have fixed some issues but don't remember providing a new test release. Maybe you built one yourself? (Fullscreen stuff proved to be more complex than I thought initially. This is partially because I didn't read properly SDL documentation and there are also various functions that affect window/screen size. Or to be more accurate, one must use a separate function to set window size and another function to set screen size (when in fullsreen window mode), which is kind of logical....
Fix for mouse cursor hiding issue (ticket #33)
Modified fullscreen window behaviour: windows use now screen width and height as specified. Added IDCMP_CHANGEWINDOW event. Added detection for window resizing during fullscreen toggling (potential fix for ticket #34)
I started to add some debug prints in relevant "key repeat" functions and then I noticed that a critical part which was supposed to disable the repeat was missing. Meanwhile it seems that ResidualVM devs have added it. After rebase, ALT+ENTER seems to work for me. There is SDL issue which leaves the window inactive after screen -> window switch, I will have to investigate it at some point.
Was this code supposed to go away? https://github.com/residualvm/residualvm/blob/master/backends/events/default/default-events.cpp#L258 It is still there, and commenting it out fixes the issue. But I didn't debug it further yet.
ScummVM seems to contain some workaround for Linux: https://github.com/scummvm/scummvm/blob/7d8d2f80fbc9cf96b3bd03b85a9722b576d23adc/backends/graphics/openglsdl/openglsdl-graphics.cpp#L485 See, it always opens window (without fullscreen flag, line 475), which is afterwards promoted to fullscreen. That happens in OpenGL at least. I didn't check other backends. But it's ok, if it shows a bug in our SDL2 then we will fix it.
Tried, based on the serial log window was first opened on WB screen and the immediately toggled to fullscreen. Centering didn't work (SDL2 used the same window coordinates on a differently sized screen) which possibly causes some issue. Have to do some debugging.
Alright, thank you. Missing key ups might be explained by the transition between window and fullscreen because we have close our window and then reopen it on another screen. We assign a shared message port during window creation. So there is a certain "blind" period for SDL, if you happen to release key during the blind period, then we could miss it. SDL2 key repeat sounds a promising idea. r196 should support it.
Finally found where the extra events are coming: https://github.com/residualvm/residualvm/blob/13ad766b312f301c709f747451c3fa287fd69e4f/backends/events/default/default-events.cpp#L235 In fact if you comment out 233-242 the fullscreen loop goes away. Otherwise it will send the keydown event (ALT+ENTER) again and again even though AmigaOS is not sending it. I don't know the purpose of this code. Maybe ScummVM devs could help as my progress is slow.
I'm not much wiser today, but it looks like some event sends code frequently here: https://github.com/residualvm/residualvm/blob/13ad766b312f301c709f747451c3fa287fd69e4f/engines/grim/grim_controls.cpp#L294 So flag is set to true all the time and then engine toggles fullscreen mode. You can see it if you put a debug print inside.
Thanks. I was able to build ResidualVM and reproduce the issue with Grim demo. Some random notes: 1) It's possible to build engine with GCC 4.2.4, you may want to try it to test with .so crash issue 2) Tried also SW renderer, looks like broken endian due to colour mess 3) If you keep ALT + ENTER pressed, engine may calm down and stop toggling between window and fullscreen Will continue debugging later.
Could you try first the checkkey program? It's an SDL test program. For me, ALT + ENTER combo works expectedly - it doesn't hang, loop or anything. I'm cloning residualvm and if it's simple to build, might try myself. More debug is needed.
Which key triggered this issue? I have checked some Residual code and there is a fullscreen toggling functionality if ALT is pressed. So if this was an SDL issue then it would most likely have something to do with modifier keys. https://github.com/residualvm/residualvm/blob/89265016a8a5d59d673f5a6b7c768e9c90b7daac/engines/myst3/myst3.cpp#L479 Is there any way to enable event debug from the game engine? I suppose it doesn't happen with the "launcher"? Is it reproducible issue? "Cannot close" prints...
Yeah, maybe 1) deserves a separate ticket. It could be that backend reports wrong drawable size or something similar. 2) It seems that the Intuition window which has a hidden pointer must be active. It could be that at time when system pointer is visible, focus is somewhere else. Well, I will try to test it more at some point.
It helps in a way that we know that "graphicsManager" variable is not a nullptr at least. I still recommend to find a simpler test case, perhaps a minimal .so and minimal binary. This sounds like it's not SDL2 issue but I cannot rule it out completetly.
SDL2.0.5: OpenGL crashing
What I need to reproduce the list jumping issue? ScummVM and how many games? Problem sounds like it's related to mouse events somehow so it's difficult to see any connection with OpenGL. I could try some build, sure.
Great. Shall we close this ticket?
Thanks. Well I cannot suggest you to use older GCC since ScummVM uses C++11. You could try to find a smaller example that reproduces the crash and if so, report it against adtools? Random idea: you could also try to print the value of _graphicsManager (before https://github.com/scummvm/scummvm/blob/master/backends/platform/sdl/sdl.cpp#L297 , just IExec->DebugPrintF("%p\n", _graphicsmanager); ) Your crash logs show a zero page hit. R9 contains value 8 (smells like a NULL pointer somewhere).
Which compiler do you use? Is it DSI or ISI exception? Where exactly? Log, please.