def drawRect(r)
glClearColor(0.2, 0.4, 0.1, 0.0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity
gluLookAt(@radius * Math::sin(@theta), 0, @radius * Math::cos(@theta), 0,0,0,0,1,0)
lightPosition = [@lightX, 1, 3, 0.0]
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition)
if !@displayList
@displayList = glGenLists(1)
glNewList(@displayList, GL_COMPILE_AND_EXECUTE)
glTranslatef(0,0,0)
glutSolidTorus(0.3, 1.8, 35 , 31) <= error occurs here `drawRect': undefined local variable or method `glut' for #<GlissView:0x10df210> (NameError)
I am actually uncertain whether it is a MacRuby issue or just that I am not loading the glut framework or requiring it properly or something else.
Both the OpenGL and GLUT frameworks are in the Xcode project , and i do the framework calls:
framework 'Cocoa'
framework 'OpenGL'
framework 'GLUT'
in rb_main.rb. Though in fact it seems to not fall over any earlier if i remove the last two framework calls.
I am using macruby version 766.
Any ideas?
cheers and thanks,
John