5 ms·
Is the rationale for switching away from GLFW documented anywhere? I'd love to read about it, I have some projects which use GLFW myself and I'm always wonderin
by mort96 3mo ago
Is the rationale for switching away from GLFW documented anywhere? I'd love to read about it, I have some projects which use GLFW myself and I'm always wondering whether or not SDL would be better
- dismalaf 3mo agoSDL is more of a "platform" you can use anywhere. It includes literally everything you'd want from the OS layer (windowing, graphics, audio, input, network code, threads) whereas GLFW is just windowing, graphics context and input, you need to bring your own audio, network code and threading library. Not a big deal for some but SDL does do more... Plus it's even more portable than GLFW.
- mort96 3mo agoI'm aware of those things, but are those the reasons? Are they actually planning on moving away from their existing audio, networking and threading solutions and switch it out for SDL's implementations? Are they planning on porting Minecraft Java to platforms GLFW doesn't support?
- dismalaf 3mo agoA little AI assisted digging indicates SDL3 has better support for switching between keyboard layout keys and physical keys depending on context (ie. Game controls can be WASD or whatever letters those physical keys are while it can use international keyboard layouts for chat boxes).
- mort96 3mo agoIs that why they are doing this? Did your little chat bit tell you anything about Mojang's stated rationale, which is what I asked about? Also, GLFW reports both the scan code and the key code, just like SDL, so I'm not sure I really trust those technical details either. Usually, you want to use scan code for some things (e.g key binds) and key code for others (e.g typing), so you can't have a global switch.
- dismalaf 3mo agoWell the article doesn't state why so all anyone has is speculation. Here's a bunch of GLFW questions on Microsoft's website, quite a few are Minecraft related errors: https://learn.microsoft.com/en-us/search/?terms=glfw&category=QnA https://learn.microsoft.com/en-us/search/?terms=glfw&categor... Also do a search for GLFW here: https://bugs.mojang.com/browse/MC https://bugs.mojang.com/browse/MC
- mort96 3mo agoIn case you missed it, the question was: > Is the rationale for switching away from GLFW documented anywhere? "Not that I know" is a perfectly good answer. Don't spew ChatGPT slop at me.
- dismalaf 3mo agoYou're pleasant. Should I have just said no, RTFA? Which clearly doesn't state why. That better? Or say you can search yourself? As for ChatGPT slop, I've never used that particular LLM, but some are good for bypassing ads/SEO slop while searching the internet.
- nvme0n1p1 3mo agoIf he wanted AI slop, I'm sure he's capable of asking an AI himself. He asked a forum full of people because he wants a real answer from a knowledgeable person. If you didn't have anything to contribute, you could have just left it for someone else to reply.
- dismalaf 3mo agoWell, I've used both GLFW and SDL and can say SDL is more robust, covers more edge cases, etc... And he specified he only wanted an answer from someone in the know, so probably no one here anyway. Also it's weird complaining about slop when HN is 99% slop, and has been for a long time. It was only interesting from 2008-2016 or so.
- chlorion 3mo agoSDL3 also includes a "GPU API", that allows low level programming of the GPU, similar to vulkan, though not quite as low level.
- groundzeros2015 3mo agoYou could make an entire 2D game using the SDL API without OpenGL/vulkan.
- mort96 3mo agoAre they going to do that? If not, that's not the reason they're doing this either
- creatonez 3mo agoMinecraft essentially only uses GLFW (and now SDL3) to create the window and accept input. The game itself is essentially coded in raw OpenGL (and now vulkan).
- chlorion 3mo agoYou can make an entire 3d game using SDL3 as well, without opengl or vulkan, using the new GPU API!
- akazantsev 3mo ago> I'm always wondering whether or not SDL would be better SDL supports mobile; GLFW doesn't. Maybe they're unifying codebases between the platforms. Edit: BTW SDL3 still works even on Android 4.2. I made an app using it and ImGui, without any Java.
- mort96 3mo agoYour suspicion is that they're going to discontinue Bedrock and replace the iOS and Android versions with Java? Even though iOS doesn't even allow Java with JIT?
- akazantsev 3mo agoDunno. Apple makes exceptions for big companies and might do so for something as big as Minecraft. Also, SDL3 supports far more platforms https://wiki.libsdl.org/SDL3/README-platforms https://wiki.libsdl.org/SDL3/README-platforms Now they can release a Java edition even for PlayStation and Xbox. At least porting to SDL3 opens the door to consoles and mobiles if they want to do so.
- HenryMulligan 3mo agoIf both sides are willing to do that, why didn't they do that the first time instead of creating Minecraft PE?
- small_scombrus 3mo agoPE was created in a time where phones were VERY unimpressive when it came to compute
- mghackerlady 3mo agoAlso, minecraft wasn't nearly as big as it was today. It was noticeable, but it wasn't headed by microsoft. There's no way it would've gotten an exception
- deleted 3mo ago[deleted]
- LoganDark 3mo agoFor one, input method editor support.
- creatonez 3mo agoNot sure, but they were able to get Wayland support working out of the box in this update. Previously it required workarounds, and even with workarounds, new issues would pop up in a game of whack-a-mole, and nobody really cared because running MC in XWayland was good enough for most people. Whereas SDL3 has very solid Wayland support out of the box. Minecraft only really uses GLFW to create the window, set the taskbar icon, go into fullscreen mode, and accept input, with everything else being handled by raw OpenGL, so this was an easy switchover. Now that Minecraft supports Vulkan, it's able to use a fully modern stack on Linux desktops / Steam Decks.
- mort96 3mo agoGLFW 3.4 has always just worked under Wayland for me. What has been the issue for Minecraft?
- creatonez 3mo agoGLFW itself is supposed to work, but there are areas of the API surface that Minecraft touches that have been a problem, so Minecraft hasn't been able to enable it. I believe the two major issues that cause crashes have been the way Minecraft sets the taskbar icon and the way it sets the window geometry. And various quality of life problems with the mouse (like hovering over the window capturing the mouse instantly).