Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.48k stars 174 forks source link

I recieve `Uncaught TypeError: fullscreen error` when i attempt to set the window to fullscreen #1379

Closed jrdoughty closed 2 years ago

jrdoughty commented 2 years ago

Describe the bug I recieve Uncaught TypeError: fullscreen error when i attempt to set the window to fullscreen. The app does not break or really show any sign of response other than this debug log. I've put the code into the init project to show it doesn't seem to be dependant on outside libraries interfering in some way.

To Reproduce Steps to reproduce the behavior:

  1. Go to My pains repo and download the full screen folder (https://github.com/jrdoughty/pains/tree/master/fullscreen)
  2. run the build through node or vscode's extention
  3. watch the error appear in debugger/console and that the game doesn't change from being windowed

Expected behavior I'd expect the game to engage into full screen

Screenshots image

Execution Environment:

Additional context Neither the System.Start nor Window.get(0).mode = WindowMode.Fullscreen methods seem to work, and the error only seems to come from the Window method.

RobDangerous commented 2 years ago

HTML5 works as intended - browsers only allow fullscreen in response to an input event nowadays in which case method 2 works. Method 1 makes no sense for browsers for the same reason. Something is indeed wrong with the Windows target though...

PS: "HTML5 and hxcpp Windows" is not the build output - you can see the build output in the Terminal panel in vscode.

RobDangerous commented 2 years ago

No, I was just confused, both methods work fine on Windows. Also tested with your code. What's the output you get on Windows?

jrdoughty commented 2 years ago

ok... I apparently have a very different issue with Windows. My builds were failing to convert an asset. I still don't know why, but as a result I've realized my changes weren't getting built, hence that fullscreen never seemed to work. I need to look into this issue, as it appears that's my real problem.

What's interesting is the same asset (a png) builds fine for html5... very odd, but I'll see what I can find out. hopefully the asset just needs reexported or something... I'll close this as it sounds like the evidence that I had that was good says there's no issue.

RobDangerous commented 2 years ago

For html5 images are not built and the png files are just loaded by the browser. It's probably something fancy like a 32bit color channel png - load it in something like irfanview and save it as a non-fancy png.

jrdoughty commented 2 years ago

Apparently I'd updated my tasks in vscode to point to a different Kha than the one I'd wanted it to. I reverted it so it used my VSCode settings and now I'm back in shape. lesson learned, if you steal build settings, delete your build folder when you test them.

RobDangerous commented 2 years ago

That's why the issue template asks for the build output by the way - if you had filled that in I would have caught the problem right away.

jrdoughty commented 2 years ago

Apologies, I was a bit confused, but I understand it better now. Btw, Windows worked as expected with both methods (as you would have guessed), even in my larger project.

RobDangerous commented 2 years ago

All righty!