Wednesday, August 5, 2015

WegGL Trial with Dartlang clear screen

Dartlang has very comfortable programming environment.Dart x Eclipse 's strong auto-complete function is excellent.  So, I have started to study WebGL with dartlang.

First time. I create a clear screen sample.




import 'dart:html' as html;
import 'dart:web_gl' as gl;

void main() {
  var canvas = new html.CanvasElement(width: 500, height: 500);
  html.document.body.append(canvas);

  gl.RenderingContext GL = canvas.getContext3d();
  double r = 0.6;
  double g = 0.2;
  double b = 0.2;
  double a = 1.0;
  GL.clearColor(r, g, b, a);
  GL.clear(gl.RenderingContext.COLOR_BUFFER_BIT);
}


Source

https://github.com/kyorohiro/dart_hetimagl/tree/master/web

-------
Kyorohiro work

No comments:

Post a Comment