emscripten: replace shell_minimal.html with 'soft fullscreen' version #2498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the default shell_minimal.html in the new emscripten example with a more minimal version which stretches the WebGL canvas over the whole window client rectangle.
printf-output is routed to the Javascript console in the browser devtools.
Here's the code as live sample:
http://floooh.github.io/oryol-sticky-tests/emsc-imgui-test/example_emscripten.html
Note however that the text rendering still appears filtered, despite the "upscale-filtering" in the WebGL canvas disabled via CSS. This is because the font texture is created with GL_LINEAR filtering. In my own ImGui samples (https://floooh.github.io/sokol-html5/) I'm using GL_NEAREST for the sample which renders "LowDPI" and with the default font, and GL_LINEAR for the other sample which uses HighDPI rendering and another TTF font.
I think it's better to keep the texture creation as is, and live with the somewhat "foggy" text(?) (some elements look better when smoothed, for instance the top-left triangle and the checkmarks.
Oh, and the canvas resizing was already handled correctly in imgui_impl_sdl.cpp, SDL_GetWindowSize() returns the size of the WebGL canvas, and this is forwarded to ImGui's DisplaySize.