fabmax / kool

An OpenGL / WebGPU engine for Desktop JVM, Android and Javascript written in Kotlin
https://fabmax.github.io/kool/kool-js
Apache License 2.0
273 stars 16 forks source link

Added isJsCanvasToWindowFitting to KoolConfig. #54

Closed donaldr closed 1 year ago

donaldr commented 1 year ago

The setting defaults to true. When enabled implements the current functionality which is to resize the canvas to the window size of the browser. This functionality is disabled if set to false. This is so to allow usage of Kool within the context of a website.

fabmax commented 1 year ago

I added a few bits so that window scale is considered for fixed canvas sizes as well. Otherwise rendering gets blurry and, worse, mouse input breaks when the window scale changes (either because the page is zoomed in the browser or if screen size is scaled in the OS on hi-dpi displays)