Giter VIP home page Giter VIP logo

Comments (5)

agnivade avatar agnivade commented on June 16, 2024

Hmm.. I don't have a mac. But I will see if I can find something.

from wasmbrowsertest.

agnivade avatar agnivade commented on June 16, 2024

@hajimehoshi - does it work if you manually paste the commands in a browser console? I just tried the following and got null for webgl

> let cc = document.createElement("canvas")
< undefined
> cc.getContext("2d")
< CanvasRenderingContext2D {canvas: canvas, globalAlpha: 1, globalCompositeOperation: 'source-over', filter: 'none', imageSmoothingEnabled: true, …}
> cc.getContext("webgl")
< null

from wasmbrowsertest.

hajimehoshi avatar hajimehoshi commented on June 16, 2024

The result was the same on the console.

EDIT: skipping to get 2d canvas changed the result:

image

from wasmbrowsertest.

hajimehoshi avatar hajimehoshi commented on June 16, 2024

Hm, apparently this is the same on Windows

> cat .\examples\test\main_test.go
package main_test

import (
        "syscall/js"
        "testing"
)

func TestWebGL(t *testing.T) {
        window := js.Global().Get("window")
        document := window.Get("document")
        body := document.Get("body")
        canvas := document.Call("createElement", "canvas")
        body.Call("appendChild", canvas)
        if context := canvas.Call("getContext", "webgl"); !context.Truthy() {
                t.Fatal("getContext('webgl') failed")
        }
}

> & (Get-Process -Id $PID).Path { $env:GOOS="js"; $env:GOARCh="wasm"; go test -exec="\\Mac\Home\ebiten\wasmbrowsertest.exe" .\examples\test\ }
--- FAIL: TestWebGL (0.00s)
    main_test.go:18: getContext('webgl') failed
FAIL
exit with status 1
FAIL    github.com/hajimehoshi/ebiten/v2/examples/test  1.130s
FAIL

from wasmbrowsertest.

agnivade avatar agnivade commented on June 16, 2024

Ok, so it's a chromedp thing: chromedp/chromedp#1190. I'll take a deeper look.

from wasmbrowsertest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.