Commit graph

7 commits

Author SHA1 Message Date
Simon Hausmann
6faf7439c2 Delete GL shader programs automatically
We already keep the context in an RC, might as well keep another copy :-)

This re-applies commit 9b0dfa14b5 but
replaces the Clone trait on Shader, which would lead to duplicate and
too early program deletion, with an Rc<Shader>.
2020-08-10 11:20:58 +02:00
Simon Hausmann
d9c776eb57 Revert "Delete GL shader programs automatically"
This reverts commit 9b0dfa14b5 as there's
an issue with webgl and everything disappearing.
2020-08-10 09:50:04 +02:00
Simon Hausmann
9b0dfa14b5 Delete GL shader programs automatically
We already keep the context in an RC, might as well keep another copy :-)
2020-08-08 13:31:37 +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
994d47a529 Shader module cleanup
Move the specific shaders into the shaders module and then hide the Shader
type. It's not necessary to export it anymore.
2020-05-20 13:27:07 +02:00
Simon Hausmann
4834de04f9 Shader code cleanup
Move the shader code into a separate file
2020-05-20 10:50:49 +02:00