Skip to content

Commit 0fde664

Browse files
committed
fix attribute-state table
1 parent 377cc26 commit 0fde664

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

webgl/lessons/resources/webgl-state-diagram.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,6 @@
158158
</div>
159159
</template>
160160

161-
<template id="vertex-attributes-template">
162-
<table>
163-
<thead><th>enabled</th><th>size</th><th>type</th><th>int</th><th>normalize</th><th>stride</th><th>offset</th><th>divisor</th><th>buffer</th></thead>
164-
<tbody>
165-
</tbody>
166-
</table>
167-
</template>
168-
169161
<template id="vertex-array-template">
170162
<div class="webgl-object window-content vertex-array" data-help="
171163
Vertex Arrays contain all attribute state. Attributes define how

webgl/lessons/resources/webgl-state-diagram/vertex-array-ui.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as twgl from '/3rdparty/twgl-full.module.js';
55
import {
66
addElem,
77
createTemplate,
8+
createTable,
89
formatBoolean,
910
formatUniformValue,
1011
getColorForWebGLObject,
@@ -53,9 +54,11 @@ export function createVertexArrayDisplay(parent, name /*, webglObject */) {
5354
`);
5455
const attrExpander = createExpander(vaElem.querySelector('.state-table'), 'attributes');
5556
expand(attrExpander);
56-
const table = createTemplate(attrExpander, '#vertex-attributes-template');
57-
const attrsElem = table.querySelector('tbody');
58-
57+
//const table = createTemplate(attrExpander, '#vertex-attributes-template');
58+
//const attrsElem = table.querySelector('tbody');
59+
const attrsElem = createTable(attrExpander, globals.isWebGL2
60+
? ['enabled', 'size', 'type', 'int', 'normalize', 'stride', 'offset', 'divisor', 'buffer']
61+
: ['enabled', 'size', 'type', 'normalize', 'stride', 'offset', 'divisor', 'buffer']);
5962
for (let i = 0; i < maxAttribs; ++i) {
6063
const tr = addElem('tr', attrsElem);
6164

0 commit comments

Comments
 (0)