Closed gummybears closed 1 year ago
Not sure I understand the problem here.
WebGL is enabled by default and you don't need to toggle anything. Running your provided code does produce the required result.
You can try running examples from threejs
like:
require "webview"
wv = Webview.window(640, 480, Webview::SizeHints::NONE, "Hello WebGL", "https://threejs.org/examples/#webgl_animation_skinning_blending")
wv.run
wv.destroy
Are you running this on a Apple computer? I am running this on a Asus laptop with Linux Mint 21 installed. The HTML runs in my browser and displays a red rectangle, running the code I gave gives a black rectangle.
I have libwebkit2gtk-4.0-dev installed. May I ask which version you are using?
Thanks
Are you running this on a Apple computer?
Yes, above screenshot was showing this running on Apple Silicon. And I've tested same demo on Fedora running webkit2gtk4.0
with same results.
I believe its something related to how your linux box is configured. try opening https://whatsmybrowser.org
and see what information you see.
Thanks for your reply, good to know you are able to run the code on Fedora with webkit2gtk4.0. I will post the browser info later.
SOLVED
I needed to upgrade crystal to the latest version, that fixed the problem, thanks for your help.
Trying out your webview shard with the following code but alas webgl is not enabled by default. I see there is a setting in WebKit to enable webgl but not in lib.cr.