4 ** Copyright (c) 2012 The Khronos Group Inc.
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
31 <meta charset="utf-8">
32 <title>WebGL Information</title>
33 <script src="../../demos/common/webgl-utils.js"> </script>
38 function createCell(txt) {
39 var str = txt.toString();
40 if (typeof txt != 'string') {
41 if (txt.length !== undefined) {
43 for (var ii = 0; ii < txt.length; ++ii) {
44 str += (ii == 0 ? "" : ", ") + txt[ii];
48 var t = document.createTextNode(str);
49 var d = document.createElement("div");
50 var td = document.createElement("td");
57 var canvas = document.getElementById("example");
58 var gl = WebGLUtils.setupWebGL(canvas);
67 'MAX_COMBINED_TEXTURE_IMAGE_UNITS',
68 'MAX_CUBE_MAP_TEXTURE_SIZE',
69 'MAX_FRAGMENT_UNIFORM_VECTORS',
70 'MAX_RENDERBUFFER_SIZE',
71 'MAX_TEXTURE_IMAGE_UNITS',
73 'MAX_VARYING_VECTORS',
75 'MAX_VERTEX_TEXTURE_IMAGE_UNITS',
76 'MAX_VERTEX_UNIFORM_VECTORS',
79 var table = document.createElement("table");
80 var tb = document.createElement("tbody");
81 for (var ii = 0; ii < pnames.length; ++ii) {
82 var pname = pnames[ii];
83 var value = gl.getParameter(gl[pname]);
84 var tr = document.createElement("tr");
85 var td1 = createCell(pname);
86 var td2 = createCell(value);
91 table.appendChild(tb);
92 document.getElementById("info").appendChild(table);
99 <canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>