From bf7c4f0c51ce10f6e4d612775cad5a19d8b0f7e1 Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Thu, 2 Mar 2023 10:49:18 +0200 Subject: [PATCH] chore(nimqml): Add threaded renderer support --- src/nimqml/private/dotherside.nim | 1 + src/nimqml/private/qguiapplication.nim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/nimqml/private/dotherside.nim b/src/nimqml/private/dotherside.nim index 97d0a20..428f87b 100644 --- a/src/nimqml/private/dotherside.nim +++ b/src/nimqml/private/dotherside.nim @@ -132,6 +132,7 @@ proc dos_chararray_delete(str: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_application_dir_path(): cstring {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_enable_hdpi(uiScaleFilePath: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_initialize_opengl() {.cdecl, dynlib: dynLibName, importc.} +proc dos_qguiapplication_try_enable_threaded_renderer() {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_create() {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_exec() {.cdecl, dynlib: dynLibName, importc.} proc dos_qguiapplication_quit() {.cdecl, dynlib: dynLibName, importc.} diff --git a/src/nimqml/private/qguiapplication.nim b/src/nimqml/private/qguiapplication.nim index c1fc5ca..e6808c0 100644 --- a/src/nimqml/private/qguiapplication.nim +++ b/src/nimqml/private/qguiapplication.nim @@ -60,6 +60,9 @@ proc enableHDPI*(uiScaleFilePath: string) = proc initializeOpenGL*() = dos_qguiapplication_initialize_opengl() + +proc tryEnableThreadedRenderer*() = + dos_qguiapplication_try_enable_threaded_renderer() proc applicationDirPath*(app: QGuiApplication): string = let str = dos_qguiapplication_application_dir_path()