Jump to content

Cordova / Android / Webpack and WEBGL renderer


Zor
 Share

Recommended Posts


I have a problem to initialize Phaser 3 on Android, with Cordova and Webpack.

When the game is created, I got that error that spam the logcat in android Studio: [ERROR:texture_definition.cc(171)] eglCreateImageKHR for cross-thread sharing failed: 0x3003. 

My problem appears only when the app is run directly on my device, a samsung galaxy s7 edge, with Cordova (in the emulator it's ok). With a cordova browser platform, the game start correctly.

When there's absolutly nothing (empty preload / create) it's the same, I have that error that spam the logcat in Android Studio.

When I create the Phaser Game Objet, to fit its parent, I set a width/height that come from the clientWidth/clientHeight of its parent (I did that because the '100%' on the width/height that was available in Phaser 2 seems to doesn't work in Phaser 3). That initialisation works everytime (browser/emulator), except when run on the device and I got the 'eglCreateImageKHR for cross-thread sharing' error.

With luck & a lot of test/tried, I realized that If I set a size of 10px less on the width/height ... it works, I don't have the error any more. It's crazy. But really, 9px doesn't works. 10px or more solve the problem and the game start normally. My solution is not to remove 10px on width/height because it's not a solution, but I after that, I realized that this problem doesn't exist when I set the renderer to CANVAS instead of WEBGL...

I suppose it's more a Cordova/Webview problem, but maybe someone know. Do you have an idea on what can cause that problem ? Google didn't give me any good result on the logcat error I got ...

Is there a big difference between CANVAS and WEBGL ? What's the best choice ?

Cheers.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...