开发者

PGM and WebGL General Information

开发者 https://www.devze.com 2023-02-13 14:04 出处:网络
I really could use some help here. I\'ve read up and many of the sites I\'ve checked all say the same thing -- that WebGL uses canvas.

I really could use some help here. I've read up and many of the sites I've checked all say the same thing -- that WebGL uses canvas.

However, my qustion is 开发者_Python百科-- even OpenGL uses the canvas element. What makes WebGL any different?

Also, if a PGM uses canvas, is it by default a WebGL?

I'm sorry if this seems like a dumb question. :)


A canvas is just something in the DOM that JS can draw on using a context. You can use a 2D context, which is what HTML5 introduced, or you can use the WebGL context. It is with the context that you draw things with onto the canvas.

The browser has to have support for the context type when calling canvas.getContext in order for it to work. See the MDC guide for a bit more info.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号