Browse Source

Lower OpenGL version for ImGui on Windows

I'm not sure why I need to do this, because a tool reported my PC
supports 4.6.
windows-imgui
Macoy Madson 11 months ago
parent
commit
f8e15b9ad9
  1. 12
      src/ImGui.cake
  2. 4
      src/ImGuiSDLOpenGL.cpp

12
src/ImGui.cake

@ -134,10 +134,14 @@
once-per-frame array
shutdown array)
(tokenize-push output
(defun (token-splice entry-point-name) (&return int)
;; TODO Don't set these so high; I only did this for RenderDoc
(SDL_GL_SetAttribute SDL_GL_CONTEXT_MAJOR_VERSION 4)
(SDL_GL_SetAttribute SDL_GL_CONTEXT_MINOR_VERSION 6)
(defun (token-splice entry-point-name) (&return int)
;; Must do this before choosing the GL version
(SDL_Init SDL_INIT_VIDEO)
;; TODO Don't set these so high; I only did this for RenderDoc
;; Not actually used: ImGuiSDLOpenGL_SetAttributes override these for SDL_GL_CreateContext
(SDL_GL_SetAttribute SDL_GL_CONTEXT_MAJOR_VERSION 3)
(SDL_GL_SetAttribute SDL_GL_CONTEXT_MINOR_VERSION 2)
;; (SDL_GL_SetAttribute SDL_GL_CONTEXT_PROFILE_MASK SDL_GL_CONTEXT_PROFILE_COMPATIBILITY)
(var window (* SDL_Window) null)
(set window

4
src/ImGuiSDLOpenGL.cpp

@ -60,8 +60,8 @@ void ImGuiSDLOpenGL_SetAttributes(const char** glsl_version_out)
const char* glsl_version = "#version 130";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#endif
// Create window with graphics context

Loading…
Cancel
Save