raylib
raylib copied to clipboard
[rcore] Small issues on MacOS with SDL2
Issue description
When building raylib with SDL2 as backend I faced 2 issues:
- The
InitPlatform()method callsSDL_Init(SDL_INIT_EVERYTHING)which results in some SDL2 fatal exceptions, which I cannot reproduce now, but I found thatSDL_Init(SDL_INIT_VIDEO)works fine. I found something on the internet that theSDL_INIT_AUDIOis the issue, a subsystem which is included bySDL_INIT_EVERYTHING, but not actually needed for raylib. - Another error I caught was
Failed creating OpenGL context at version requestedbecause on Apple if you are using OpenGL 3.3 theSDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE)is not called, even though for OpenGL 4.3 it is. - There is no automatic way of building with SDL2? The
PLATFORMvariable only supportsDesktopwhich defaults toGLFW.
Environment
MacOS Sonoma 14.1.1 M1, OpenGL 3.3
- Is certainly a bug, in
GLFWimplementation,rcore_desktop.c, the call is not missing.
@atticus5 Thanks for reporting! It has been reviewed 1. and 2. but about 3., Makefile supports PLATFORM=PLATFORM_DESKTOP_SDL.
@raysan5 thank you, but I'm using CMake and GLFW is hardcoded:
https://github.com/raysan5/raylib/blob/7ec43022c177cbf00b27c9e9ab067bd6889957a4/cmake/LibraryConfigurations.cmake#L11
@atticus5 Oh, I'm afraid I'm not the user neither maintainer of CMake build system. It was contributed by the community and I kept it for convenience but any expert on CMake should review and maintain it.