aboutsummaryrefslogtreecommitdiff
path: root/src/library_gl.js
blob: f69d33010f52a4ecc5ca2c66a9c9eb955955de69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mergeInto(Library, {
  glGetString: function(name_) {
    switch(name_) {
      case Module.contextGL.VENDOR:
      case Module.contextGL.RENDERER:
      case Module.contextGL.VERSION:
        return Pointer_make(intArrayFromString(Module.contextGL.getParameter(name_)), null, ALLOC_NORMAL);
      case 0x1F03: // Extensions
        return Pointer_make(intArrayFromString(Module.contextGL.getSupportedExtensions().join(' ')), null, ALLOC_NORMAL);
      default:
        throw 'Failure: Invalid glGetString value: ' + name_;
    }
  }

//  glGenVertexArrays: function() {},

//  glBindVertexArray: function() {},
});