diff options
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index a20611c9..f69d3301 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1,8 +1,19 @@ mergeInto(Library, { - glGetString: function() {}, + 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() {}, +// glGenVertexArrays: function() {}, - glBindVertexArray: function() {}, +// glBindVertexArray: function() {}, }); |