public
Description: ruby-opengl wrapper for quick applets
Homepage: http://alltom.com/pages/glapp
Clone URL: git://github.com/alltom/glapp.git
Tom Lieber (author)
Mon May 18 18:31:23 -0700 2009
commit  8304c51842c5aec663221f1bbf4b71b0a812d7b9
tree    8dc184aadf3f5841e5d432ef3056cf336d2bc22f
parent  0d2621ff40644af512ce173989e03b2d6ea80852
glapp / README.textile
100644 41 lines (32 sloc) 0.867 kb

GLApp – A tiny wrapper for ruby-opengl

It’s simple:

  1. require “glapp”
  2. Include GLApp
  3. Override as many of the callbacks as you need:
  • setup
  • update(seconds)
  • draw
  • keyboard_down(key, modifiers)
  • keyboard_up(key, modifiers)
  • special_keyboard_down(key, modifiers)
  • special_keyboard_up(key, modifiers)
  • mouse_click(button, state, x, y)
  • mouse_dragging_motion(x, y)
  • mouse_passive_motion(x, y)
  • If you need more control, override the default behavior of these:
  • setup_context
  • pre_draw
  • post_draw
  • resize
  • Call show with width, height, title, and whether to be full-screen

Look at the scripts in the examples/ directory.
In fact, here’s one:

require ‘glapp’ class MyGame include GLApp def draw glTranslate(0, 0, -5) glutSolidCube(2) end end MyGame.new.show 800, 600, “My Game”