Commit graph

13 commits

Author SHA1 Message Date
Simon Hausmann
4f5d491bf7 Minor cleanup
Remove GL context parameters from texture functions that aren't needed.
2020-09-15 09:02:34 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
7807631ba0 Fix leaking texture atlas allocations
When a rendering primitive holding a reference into a texture atlas
allocation is dropped, we should free that area for future re-use.
2020-08-10 17:30:41 +02:00
Simon Hausmann
d6ef7c31a8 Fix rendering artifacts when scaling
The use of the texture atlas may result in pixels from adjacent textures
bleeding into the currently rendered texture. The standard technique appears to be
to add a padding around each image.
2020-08-10 15:53:44 +02:00
Simon Hausmann
ccb2e23cf5 Fix GL texture not freeing its texture id
Similar to the shaders, keep a reference count on the resource itself and
keep the context around for convenient deletion.

Fixes: #3
2020-08-10 11:20:58 +02:00
Olivier Goffart
d77d7cddc3 The viewer can use the Qt style with --style qt 2020-07-24 18:06:55 +02:00
Simon Hausmann
32f9f4117f Upgrade to a new upstream glow version
This includes our fix for the texture creation from canvas, and requires
a little source compatibility fix.
2020-07-08 20:25:40 +02:00
Simon Hausmann
fb2b12c28a Implement basic text rendering on the wasm port
Based on Olivier's suggestion, the text rendering primitive is created
by painting the text onto a temporary HTML canvas
element and binding that to a texture.
2020-06-08 17:00:59 +02:00
Simon Hausmann
aea81f5202 Upgrade glow to a patched version
The GL bindings were missing one feature on the web side, the ability to
set texture image data from an HTML canvas element.
We're going to need that soon.

The bump to a newer version also came with some odd (but sensible)
source incompatibilities.
2020-06-08 16:57:58 +02:00
Simon Hausmann
8e8943b8fe Clean up texture atlas allocation code
Let each atlas texture know its index, so that it can return the final
allocation result right away.
2020-05-21 18:54:46 +02:00
Simon Hausmann
86eaf027d4 Implement glyph runs grouped by texture
In order to support multiple font sizes, etc. we have to deal with the
fact that the glyphs for a string may not end up all in the same atlas
texture. Therefore splitting of glyph runs by texture is necessary.

This works but could be improved further by sharing the vertex arrays
and just re-binding to a different texture and drawing the run's
triangles by index.
2020-05-21 15:51:09 +02:00
Simon Hausmann
f27a715b30 GL texture handling cleanup
Move the gl texture handling code into a separate file/module.
2020-05-20 08:52:20 +02:00