jump to navigation

Querying WebGL Commands and Symbols May 29, 2010

Posted by Andor Saga in Open Source, webgl.
trackback

The Khronos specification is detailed, organized and official. The WebGL Cheat Sheet by Nihilogic is a great quick reference tool. But sometimes I just want to query the WebGL context and get all the raw commands and symbols. This can be very useful and it’s easy:

var gl = document.createElement('canvas').getContext("experimental-webgl");
var symbols= "";
for(currSymbol in gl) {
  symbols += currSymbol + "\n";
}

symbols will then be filled with the commands and symbols available for your browser:
canvas
viewport
clearColor
clear
enable
blendFunc
...

This of course works for either Minefield, Webkit, but also Chrome. Yeah, CHROME, isn’t that sweetness?

Advertisements

Comments»

1. Schell Scivally - August 20, 2010

You could also use Chromium’s javascript console by pressing command-alt-j (or the windows alternative), clicking ‘Scripts’ tab, then adding a new watch expression for ‘gl’. At first it may seem like more work, but I always have the console open, so it’s rather simple.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: