-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathassignment0.js
More file actions
53 lines (37 loc) · 837 Bytes
/
assignment0.js
File metadata and controls
53 lines (37 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
let GL, vao, program1, program2;
let currColor = [0, 0, 0, 0];
let currTriangles = 1;
let maxTriangles = 1;
let useJSON = false;
window.updateTriangles = function() {
}
window.updateColor = function() {
}
window.checkBox = function() {
}
function uploadFile(event) {
// load file and create buffers
}
async function createPrograms() {
// create vertex and fragment shaders, create programs
}
function createShader(source, type) {
// create shader
};
function createBuffer(vertices) {
// create buffer
}
function createVAO(posAttribLoc, posBuffer, colAttribLoc, colBuffer) {
// create vertex array
}
function draw() {
// bind vao
// use program
// draw arrays
};
async function initialize() {
// initialive canvas
// create programs
// draw
};
window.onload = initialize;