ceifa / steamworks.js

A steamworks implementation for nw.js/electron games
MIT License
395 stars 64 forks source link

Steamworksjs interfering with WebGL #151

Closed kjmehta01 closed 2 weeks ago

kjmehta01 commented 1 month ago

I use pixijs for rendering for my game which relies on WebGL. Works just fine with my current electron-forge configuration and without any steamworksjs code.

By including just the following:

let steamworks = require('steamworks.js')

I see one of the following errors. I see this first one if I include the snippet above and then try to define my pixijs window later:

Uncaught Error: WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.

And if I include it later in my code, I lose access to the window and the graphics can't load, and I see the following warning:

WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost

I have included, and this also works with steamworksjs turned off:

const win = new BrowserWindow({
   ...
    webPreferences: {
        contextIsolation: false,
        nodeIntegration: true
    }
})

Thanks!

ceifa commented 1 month ago

Weird, never saw this problem before. What happens when you call or don't call electronEnableSteamOverlay? Which version of electron?

kjmehta01 commented 2 weeks ago

I figured it out, to be honest I'm not sure what I changed. I recreated my project in electron-fiddle to try to reproduce the issue and it ended up working, so I exported that locally and have been making edits to and building from that directory.