Bread has been achieved.
- Window now creates and loads properly (Due to config not being created halted vue) - Foundation for app.ts created for functions to run in certain stages of the app (start/init, ready, exit) - Electron-Store created in class ConfigStore. Store instance stored in ConfigStore.store. Gets a bit compilicated and might change the class or variable name later on.
This commit is contained in:
parent
7cdb0afaa4
commit
a7b5b36590
4 changed files with 196 additions and 35 deletions
48
src/main/base/app.ts
Normal file
48
src/main/base/app.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
import * as electron from 'electron';
|
||||
|
||||
export class App {
|
||||
constructor() {
|
||||
console.log('App started');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles all actions that occur for the app on start (Mainly commandline arguments)
|
||||
* @returns {void}
|
||||
*/
|
||||
public start(store: any): void {
|
||||
console.log('App started');
|
||||
|
||||
switch (store.get("visual.hw_acceleration")) {
|
||||
default:
|
||||
case "default":
|
||||
electron.app.commandLine.appendSwitch('enable-accelerated-mjpeg-decode')
|
||||
electron.app.commandLine.appendSwitch('enable-accelerated-video')
|
||||
electron.app.commandLine.appendSwitch('disable-gpu-driver-bug-workarounds')
|
||||
electron.app.commandLine.appendSwitch('ignore-gpu-blacklist')
|
||||
electron.app.commandLine.appendSwitch('enable-native-gpu-memory-buffers')
|
||||
electron.app.commandLine.appendSwitch('enable-accelerated-video-decode');
|
||||
electron.app.commandLine.appendSwitch('enable-gpu-rasterization');
|
||||
electron.app.commandLine.appendSwitch('enable-native-gpu-memory-buffers');
|
||||
electron.app.commandLine.appendSwitch('enable-oop-rasterization');
|
||||
break;
|
||||
|
||||
case "webgpu":
|
||||
console.info("WebGPU is enabled.");
|
||||
electron.app.commandLine.appendSwitch('enable-unsafe-webgpu')
|
||||
break;
|
||||
|
||||
case "disabled":
|
||||
console.info("Hardware acceleration is disabled.");
|
||||
electron.app.commandLine.appendSwitch('disable-gpu')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public stop() {
|
||||
console.log('App stopped');
|
||||
}
|
||||
|
||||
public ready() {
|
||||
console.log('App ready');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue