Time Nick Message 18:07 ROllerozxa is there a preprocessor define for checking if minetest is being built with SDL2 or not? 18:10 ROllerozxa I know _IRR_COMPILE_WITH_SDL_DEVICE_ exists in irrlichtmt but would that be dirty to introduce into minetest 18:12 Krock RenderingEngine::get_raw_device()->getType() == EIDT_SDL for the active render. I cannot find any check for support 18:13 Krock you could probe it by calling createDeviceEx using SDL ... 18:14 Krock * params.DeviceType == EIDT_SDL 18:14 ROllerozxa preprocessor define. I can't wrap a header include within that without causing errors 18:15 ROllerozxa (this is for fixing building minetest w/ SDL2 on MSYS2, it requires including the SDL.h header in minetest main.cpp for SDL2main to work) 18:15 ROllerozxa would adding an USE_SDL2 to cmake_config.h.in be ok 18:15 Krock is there no way to implement it in Irrlicht? 18:16 Krock because Minetest currently does not (and should not) care which device is used 18:17 rubenwardy Minetest will need to care when it starts using SDL directly 18:17 rubenwardy ie: for gamepad input 18:17 ROllerozxa alternative would be https://github.com/minetest/irrlicht/pull/265 which seems to be the wrong way to do it 18:18 rubenwardy for my SDL gamepad PR, I just break compiling on non-SDL 18:18 Krock it might be possible to forward the define by using the IrrConfig something header 18:19 Krock IrrCompileConfig.h 18:19 Krock no that's not it. 18:23 sfan5 do we need to use sdl2main? iirc it was optional 18:23 Krock either way, the irrlicht PR does look correct. After all, SDL2::SDL2 is supposed to provide necessary include and lirary paths 18:24 Krock > Under Visual C++, you need to link with SDL2main.lib 18:24 Krock https://wiki.libsdl.org/SDL2/FAQWindows 18:24 Krock however, this is about msys2 so that does not apply. 18:25 Krock unless they mean the VC++ runtime and not MSVC 18:27 sfan5 optional in the sense that it is then your responsibility to adhere to platform specific init procedures 18:27 sfan5 > SDL2main provides SDL_main(), which is a global entry point for all SDL apps. You are not required/forced to use it, but is presence is based on the variety of the systems SDL supports. Windows uses WinMain(), Linux uses main(), Android needs JNI and some Java to actually use SDL, so SDL_main() makes things a little easier. 18:27 sfan5 (2013 forum post) 18:33 ROllerozxa the only other platform that has init stuff in SDL2main that we would reasonably support other than windows would be haiku 18:36 v-rob > Minetest will need to care when it starts using SDL directly 18:36 v-rob Yes, and my events code for the formspec replacement (which isn't in the current PR) uses SDL_Event heavily. I want to circumvent Irrlicht's event system from the get-go. 18:37 ROllerozxa I guess we could also stall and wait until SDL3 comes out which won't have this SDL2main library, sounds like the most minetesty option 18:37 v-rob After all, the new HUD/GUI code is the whole reason I started pushing for SDL from the beginning 18:37 rubenwardy let's not wait for v3 for projects which have an association with Valve 18:41 v-rob And SDL means that I can integrate #8679 into the UI API with both keycodes/scancodes. Woo! 18:41 ShadowBot https://github.com/minetest/minetest/issues/8679 -- Add FormSpec key and mouse events by v-rob 18:41 v-rob Yes, I am very happy about using SDL directly. 18:47 sfan5 btw (I have also commented this somewhere) I have built mt + sdl2 fine with mingw no changes to the current build script 18:47 sfan5 we can also take sdl2main out if that doesn't break anything else 18:51 ROllerozxa speaking about breaking things, I reopened https://github.com/minetest/irrlicht/pull/265 and the linux SDL CI now fails after I resolved merge conflicts, don't know why that happened 19:01 Krock possibly FindSDL2.cmake does not support the SDL2::SDL2 target yet in the CMake version that is used in the buildbot 19:02 Krock "-- Found SDL2: -lSDL2" is unlike the other outputs