Skip to content

Instantly share code, notes, and snippets.

@nilium
Created March 25, 2012 23:17
Show Gist options
  • Select an option

  • Save nilium/2201317 to your computer and use it in GitHub Desktop.

Select an option

Save nilium/2201317 to your computer and use it in GitHub Desktop.
GLFW/webgl test in CoffeeScript
glfw = require('node-glfw')
gl = require('node-webgl').webgl
glfw.Init()
glfw.OpenWindow 800, 600, 0, 0, 0, 0, 16, 0, glfw.WINDOW
glfw.events.addListener 'keyup', (event) ->
glfw.CloseWindow() if event.which is glfw.KEY_ESC
# /listener
running = yes
while running
grey = Math.abs Math.sin glfw.GetTime()
gl.clearColor grey, grey, grey, 1.0
gl.clear gl.COLOR_BUFFER_BIT
running = glfw.GetWindowParam glfw.OPENED
glfw.SwapBuffers()
# /running
glfw.Terminate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment