Skip to content

Instantly share code, notes, and snippets.

@ddnn55
Created March 28, 2012 02:54
Show Gist options
  • Save ddnn55/2223148 to your computer and use it in GitHub Desktop.
Save ddnn55/2223148 to your computer and use it in GitHub Desktop.
// example generated JavaScript
var buffer;
function init(gl)
{
var myData = new DavidsFloatData([1., 2., 3., 4.]);
buffer = gl.createBuffer(); // corresponding C function is glGenBuffers(GLsizei n, GLuint *buffers)
gl.bindBuffer(GL_ARRAY_BUFFER, buffer);
gl.bufferData(GL_ARRAY_BUFFER, DavidsSizeOf(myData), GL_STATIC_DRAW);
}
function draw(gl)
{
gl.bindBuffer(GL_ARRAY_BUFFER, buffer);
}
function mouseMoved(e)
{
// do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment