AGG and X11 as rather native linux backend#24
Open
MeKo-Christian wants to merge 47 commits intogonutz:mainfrom
Open
AGG and X11 as rather native linux backend#24MeKo-Christian wants to merge 47 commits intogonutz:mainfrom
MeKo-Christian wants to merge 47 commits intogonutz:mainfrom
Conversation
BlurText would control the image blurring. Right now BlurText does nothing.
To make the WASM port look the same as the desktops, we do not draw the last pixel of a line.
When using a canvas stroke, we adjust the rectangle by half a pixel to align it to the actual pixel grid.
All the basic drawing primitives are now pixelated like on the desktop.
Eventually we want to render text like for desktop.
The serve command used to serve the files and open the browser. These are now two separate commands: - serve starts a local file server - open opens the browser at the local URL Command show was added to replace the old serve, i.e. drawsm show now serves the files and opens a browser in one command.
The font rendering was completely overhauled. It now uses Go-Mono.ttf, one of the Go fonts. It uses a bitmap font, generated by a C program which uses stb_truetype, for desktop (Windows and GLFW, SDL2 was dropped). For WASM, it uses the TTF font file directly. Everything was tweaked to make the desktop and WASM texts look as similar as possible. With the new text rendering, there is no crisp, pixelated text anymore, so the BlurText function was removed from Window. The SDL2 backend was removed altogether since GLFW has been the default for long, was tested on Mac, and our SDL2 backend was not up-to-date anymore.
Playing the music right from the start tests the new sound on WASM. In the browser sound only starts after the first user interaction (mouse or keyboard presses). This means that the sample code calls PlaySound right at the start but the music does not start. After the first user interaction the music will set in at the right offset as if it were played silently from the beginning.
When loading an image in JavaScript, loading happens asynchronously which we now report back to the caller using the new error constant ErrImageLoading.
If the same icon path is set multiple times, it is set only once.
Passing negative width and/or height to DrawImage... functions can be used to mirror the image. This now works on WASM as it does on desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi,
nicht ganz ernst gemeinter PR (ich hab die Änderungen im Code nicht komplett gereviewed), aber Lukas hatte vorgeschlagen mal meinen Port von AGG für Prototype verfügbar zu machen. Das sollte die Dependencies reduzieren.
Grundsätzlich auch ohne CGo lauffähig, aber dafür müsste man noch etwas mehr tun...