Create 'gl3' build option

This commit is contained in:
Roza 2020-02-24 23:25:06 -05:00
parent 4e5294e184
commit 7ff57d3851
4 changed files with 11 additions and 3 deletions

View file

@ -89,6 +89,13 @@ if get_option('threaded_gl_init')
global_args += '-DTHREADED_GLINIT'
endif
# Mainly for virtual machines
if get_option('gl3')
global_args += ['-DZ_GL_MINOR=3','-DZ_GL_MAJOR=3']
else
global_args += ['-DZ_GL_MINOR=1','-DZ_GL_MAJOR=4']
endif
# Objectify our C
global_args += run_command(objfw,'--cppflags').stdout().split()

View file

@ -3,6 +3,7 @@ option('mk', type: 'boolean', value: false, description: 'Build to fit Marin\'s
option('console', type: 'boolean', value: true, description: 'Whether to debug information in the console')
option('macos_min_version', type: 'string', value: '10.10', description: 'Minimum macOS system version to support')
option('threaded_gl_init', type: 'boolean', value: true, description: 'Init GL on secondary thread')
option('gl3', type: 'boolean', value: false, description: 'Use OpenGL 3.3 instead of 4.1')
option('shared_fluid', type: 'boolean', value: false, description: 'Dynamically link fluidsynth at build time')
option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font')

View file

@ -1,4 +1,4 @@
#version 410
#version 330
#define attribute in
#define varying out

View file

@ -412,8 +412,8 @@ static SDL_GLContext initGL(SDL_Window *win, Config &conf,
// Core profile enables OpenGL4 on macOS
// Using OpenGL 4.1 requires a GPU with max texture size of 16384 or better
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, Z_GL_MAJOR);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, Z_GL_MINOR);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
glCtx = SDL_GL_CreateContext(win);