mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +01:00
WebGLRenderingContext getters and getParameter
This implements the `canvas`, `drawingBufferHeight` and `drawingBufferWidth` getters to `WebGLRenderingContext`, and an initial version of `getParameter`.
This commit is contained in:
parent
0de09b936e
commit
eff2bb4310
6 changed files with 89 additions and 13 deletions
12
tests/html/test_webgl_context_get_parameter.html
Normal file
12
tests/html/test_webgl_context_get_parameter.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebGLRenderingContext getParameter test</title>
|
||||
<script>
|
||||
var gl = document.createElement("canvas").getContext("webgl");
|
||||
|
||||
if ( typeof gl.getParameter !== "function" )
|
||||
console.error("getParameter should be a function");
|
||||
|
||||
if ( gl.getParameter(gl.VERSION).indexOf("WebGL 1.0") !== 0 )
|
||||
console.error("getParameter(VERSION) should return a string beginning with \"WebGL 1.0\"");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue