Method: GLApp#resize
- Defined in:
- lib/glapp.rb
#resize ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/glapp.rb', line 103 def resize # Reset the coordinate system glMatrixMode(GL_PROJECTION) glLoadIdentity # Set the viewport to be the entire window glViewport(0, 0, width, height) # Set the correct perspective gluPerspective(45, width.to_f / height.to_f, 1, 1000) glMatrixMode(GL_MODELVIEW) glLoadIdentity gluLookAt(0, 0, 5, 0, 0, -1, 0, 1, 0) end |