-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
29 lines (21 loc) · 848 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const electron = require('electron')
const { app, BrowserWindow } = require('electron')
const dev = (process.argv[2]=="dev"||process.argv[2]=="test") ? true : false
let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({
width: 800, height: 600,
icon:`${__dirname}/BBlogo.png`
})
let path = (process.argv[2]=="test") ?
`file:///${__dirname}/webGL-test.html` :
`file:///${__dirname}/index.html`
mainWindow.loadURL(path)
// Open the DevTools.
if( dev ) mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', ()=>{ mainWindow = null })
}
app.on('ready', createWindow)
app.on('window-all-closed',()=>{ if(process.platform!=='darwin') app.quit() })
app.on('activate', ()=>{ if (mainWindow === null) createWindow() })