- Hands-On Game Development with WebAssembly
- Rick Battagline
- 213字
- 2021-06-24 13:41:03
WebGL and canvas contexts
WebGL is a rendering context for drawing to the HTML5 element, and is an alternative to the 2D rendering context. Often, when someone mentions the canvas, they are referring to the 2D rendering context, which is accessed by calling getContext and passing in the string 2d. Both contexts are methods of rendering to the HTML5 canvas element. A context is a type of API for immediate mode rendering. Two different WebGL contexts can be requested, both of which provide access to different versions of the WebGL API. These contexts are webgl and webgl2. In the following examples, I will be using the webgl context and will be using the WebGL 1.0 API. There is also a rarely used context for rendering a bitmap to the canvas that we can access by passing in bitmaprenderer as a string value.
In the next section, I will introduce you to shaders and the GLSL shader language.
- Raspberry Pi 3 Cookbook for Python Programmers
- 龍芯應用開發標準教程
- 基于Proteus和Keil的C51程序設計項目教程(第2版):理論、仿真、實踐相融合
- 微軟互聯網信息服務(IIS)最佳實踐 (微軟技術開發者叢書)
- Spring Cloud微服務架構實戰
- 筆記本電腦使用、維護與故障排除從入門到精通(第5版)
- Managing Data and Media in Microsoft Silverlight 4:A mashup of chapters from Packt's bestselling Silverlight books
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- 單片機技術及應用
- 單片微機原理及應用
- 計算機電路基礎(第2版)
- The Machine Learning Workshop
- MicroPython Cookbook
- Applied Deep Learning with Keras
- 計算機組裝與維護教程