From 0caba5083ddd31f4210ea61fa30934e7201ceb1c Mon Sep 17 00:00:00 2001 From: Daniel Morlock Date: Wed, 9 Sep 2020 12:45:55 +0200 Subject: [PATCH] Fix error "GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command" on systems without hardware acceleration by disabling GPU usage by setting the environment variable ELECTRON_DISABLE_GPU. --- render/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/render/index.js b/render/index.js index 435c94b..3601f0f 100644 --- a/render/index.js +++ b/render/index.js @@ -11,6 +11,15 @@ var path = require('path'), ipcMain = require('electron').ipcMain, os = require('os'); + +/** + * Disable electron hardware acceleration if requested by environment. + * See https://stackoverflow.com/a/58351011/381166. + */ +if (process.env.ELECTRON_DISABLE_GPU) { + app.disableHardwareAcceleration(); +} + /** * The step option * To reduce the number of rendered frames (step > 1)