app/headless: remove OpenGL assumptions

To prepare package headless for multiple backends, refactor the common headless
driver to no longer assume an OpenGL context. Instead, introduce a headless
backend type and the OpenGL implementation, glBackend.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-15 18:59:27 +01:00
parent 94fdc26cb5
commit b34216c124
5 changed files with 82 additions and 40 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ type jsContext struct {
f *glimpl.Functions
}
func newContext() (*jsContext, error) {
func newGLContext() (glContext, error) {
version := 2
doc := js.Global().Get("document")
cnv := doc.Call("createElement", "canvas")