Skip to content

Commit d798280

Browse files
committed
REVIEWED: macOS issues #3767
1 parent deaffb0 commit d798280

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/platforms/rcore_desktop_sdl.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,9 @@ void PollInputEvents(void)
12751275
// Initialize platform: graphics, inputs and more
12761276
int InitPlatform(void)
12771277
{
1278-
// Initialize SDL internal global state
1279-
int result = SDL_Init(SDL_INIT_EVERYTHING);
1278+
// Initialize SDL internal global state, only required systems
1279+
// NOTE: Not all systems need to be initialized, SDL_INIT_AUDIO is not required, managed by miniaudio
1280+
int result = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER);
12801281
if (result < 0) { TRACELOG(LOG_WARNING, "SDL: Failed to initialize SDL"); return -1; }
12811282

12821283
// Initialize graphic device: display/window and graphic context
@@ -1328,11 +1329,7 @@ int InitPlatform(void)
13281329
{
13291330
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
13301331
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
1331-
#if defined(__APPLE__)
1332-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // OSX Requires forward compatibility
1333-
#else
13341332
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
1335-
#endif
13361333
}
13371334
else if (rlGetVersion() == RL_OPENGL_43)
13381335
{

0 commit comments

Comments
 (0)