insertion • Concept of undefined • Variable hoisting function printName() { console.log('Hello, ' + name); var name = 'Bob'; } function printName() { var name; console.log('Hello, ' + name); name = 'Bob'; }
variables can be typed... String myName = 'Don'; // but they don't need to be var myOtherName = 'Don'; var myName; // == undefined var myName; // == null int x; // == null // no support final name = 'Bob'; final String name = 'Bob'; // Raises an error name = 'Alice';
Contains a WebGLRenderingContext • Other classes hold references to WebGL bindings ◦ WebGLTexture ◦ WebGLBuffer • Need to know when to update Vertex Buffer Objects
= buffer.vertexDeclaration; int stride = declaration.vertexStride; // Enable each vertex attribute for (VertexElement element in declaration.elements) { int index = element.usage.value + element.usageIndex; int offset = element.offset; int size = element.format.value >> 2; _gl.enableVertexAttribArray(index); _gl.vertexAttribPointer( index, size, WebGLRenderingContext.FLOAT, false, stride, offset); } }
◦ Easier to develop large applications • Dart is built for performance ◦ 3D applications require speed • Dart comes with batteries included ◦ IDE and core libraries available out of the box