Make threaded GL initialization optional

This commit is contained in:
Struma 2020-02-10 12:38:27 -05:00 committed by Roza
parent 0f767dbfe3
commit 1bf5f4f3da
3 changed files with 12 additions and 7 deletions

View file

@ -1,4 +1,4 @@
project('mkxp-z', 'cpp', 'objc', 'objcpp', version: '1.2.0', meson_version: '>=0.47.0', default_options: ['cpp_std=c++11', 'buildtype=release'])
project('mkxp-z', 'cpp', 'objc', 'objcpp', version: '1.2.0', meson_version: '>=0.47.0', default_options: ['cpp_std=c++11', 'objcpp_std=c++11','buildtype=release'])
minimum_macos_version = get_option('macos_min_version')
@ -84,6 +84,11 @@ if get_option('mk')
global_args += '-DMARIN'
endif
# This MUST be disabled if building for macOS >= 10.15
if get_option('threaded_gl_init')
global_args += '-DTHREADED_GLINIT'
endif
# Objectify our C
global_args += run_command(objfw,'--cppflags').stdout().split()

View file

@ -1,8 +1,8 @@
option('mri_version', type: 'string', value: '1.8', description: 'Version of MRI to link with')
option('mk', type: 'boolean', value: false, description: 'Build to fit Marin\'s MK standard')
option('ruby_lib', type: 'string', value: 'ruby', description: 'Name of the Ruby library')
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('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')
@ -14,4 +14,4 @@ option('workdir_current', type: 'boolean', value: false, description: 'Keep curr
option('independent_appimage', type: 'boolean', value: true, description: 'Set current directory to the original location of the AppImage when contained within one')
option('discord_sdk_path', type: 'string', value: '', description: 'Path to Discord GameSDK')
option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')
option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')

View file

@ -49,7 +49,7 @@
#import "icon.png.xxd"
#ifdef __APPLE__
#ifndef THREADED_GLINIT
#define GLINIT_SHOWERROR(s) showInitError(s)
#else
#define GLINIT_SHOWERROR(s) rgssThreadError(threadData, s)
@ -75,7 +75,7 @@ static SDL_GLContext initGL(SDL_Window *win, Config &conf,
int rgssThreadFun(void *userdata) {
RGSSThreadData *threadData = static_cast<RGSSThreadData *>(userdata);
#ifndef __APPLE__
#ifdef THREADED_GLINIT
threadData->glContext =
initGL(threadData->window, threadData->config, threadData);
if (!threadData->glContext)
@ -322,7 +322,7 @@ int main(int argc, char *argv[]) {
EventThread eventThread;
#ifdef __APPLE__
#ifndef THREADED_GLINIT
SDL_GLContext glCtx = initGL(win, conf, 0);
#else
SDL_GLContext glCtx = NULL;
@ -439,4 +439,4 @@ static SDL_GLContext initGL(SDL_Window *win, Config &conf,
// GLDebugLogger dLogger;
return glCtx;
}
}