From 07df1ac59eca083ca01e230b629d4d67085114bc Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Thu, 21 Dec 2023 15:35:51 +0800
Subject: Force the GL profile to be the core one

on all platforms, not only on Darwin.
---
 indra/llwindow/llwindowsdl.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'indra')

diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 8fddbf05e2..ddd502e618 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -373,6 +373,14 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b
     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits);
     SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
 
+    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
+#if LL_DARWIN
+    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+#else
+    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6);
+#endif
+    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+
     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
 
     U32 context_flags = 0;
-- 
cgit v1.2.3