Skip to content

AGG and X11 as rather native linux backend#24

Open
MeKo-Christian wants to merge 47 commits intogonutz:mainfrom
CWBudde:main
Open

AGG and X11 as rather native linux backend#24
MeKo-Christian wants to merge 47 commits intogonutz:mainfrom
CWBudde:main

Conversation

@MeKo-Christian
Copy link
Copy Markdown
Contributor

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...

CWBudde and others added 30 commits April 12, 2025 21:54
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.
gonutz and others added 17 commits July 1, 2025 23:22
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants