August 2012
Beginner
356 pages
9h 21m
English
APPENDIX C
![]()
WebGL Spec. Odds and Ends
This appendix contains some parts of the specification that we mentioned but did not fully cover and are listed here for reference.
WebGLContextAttributes
When we obtain our WebGL context, we can optionally pass it an object containing some or all of the following properties:
dictionary WebGLContextAttributes {
boolean alpha = true;
boolean depth = true;
boolean stencil = false;
boolean antialias = true;
boolean premultipliedAlpha = true;
boolean preserveDrawingBuffer = false;
};
We showed how to preserve the drawing buffer in a Chapter 5 projectile example using this:
gl = canvas.getContext("webgl", ...
Read now
Unlock full access