ruby-opengl, ruby-glut


A

Alwin Blok

Hello!

I'm trying ruby-opengl on osx. (without x11) and so far, with some
changes I managed to compile it and even run the samples once, but now
it broke again. (strangely)
This probably (surely) is an OSX question, but maybe someone can help
me here

Here's the error

ruby sample/planet.rb
objc: failed objc_getClass(NSObject) for GLUTApplication->isa->isa
objc: please link appropriate classes in your program
Trace/BPT trap

I'm using ruby 1.8.1 (2003-10-30) [powerpc-darwin] on mac osx version
10.3.2 (panter)

Alwin
 
Ad

Advertisements

A

Alwin Blok

Whohoo!

I've got Ruby-opengl to work on osX 10.3 (panther). Without X11!
It seems that I forgot to link to the glut framework. (stupid..)

Regards Alwin.
 
F

Frank Schmitt

Alwin Blok said:
Whohoo!

I've got Ruby-opengl to work on osX 10.3 (panther). Without X11!
It seems that I forgot to link to the glut framework. (stupid..)

How did you manage that? I tried to compile it last week, but gave up
frustrated.

thanks in advance & kind regards
frank
 
J

James Adam

Frank Schmitt said:
How did you manage that? I tried to compile it last week, but gave up
frustrated.

thanks in advance & kind regards
frank

I wrote up some instructions for doing this here:

http://www.rubygarden.org/ruby?RubyOnMacintosh/OpenGLandGLUT

I'm pretty sure they are still current but please, PLEASE do modify
them if you've got anything new to offer. The one thing i ought to add
to them is that it seems that GLUT.BitmapCharacter(font, char) doesn't
seem to work - it's to do with the (void *)font argument. I've got
around it by adding my own glut_BitmapCharacterX(char) with the font
value hard-coded in, within the glut.c file, but this isn't a
show-stopper bug.

anyway - please update those instructions, lets try and collate all
the ruby on osx info if we can :)

- james
 
A

Alwin Blok

I wrote up some instructions for doing this here:

http://www.rubygarden.org/ruby?RubyOnMacintosh/OpenGLandGLUT

I'm pretty sure they are still current but please, PLEASE do modify
them if you've got anything new to offer. The one thing i ought to add
to them is that it seems that GLUT.BitmapCharacter(font, char) doesn't
seem to work - it's to do with the (void *)font argument. I've got
around it by adding my own glut_BitmapCharacterX(char) with the font
value hard-coded in, within the glut.c file, but this isn't a
show-stopper bug.

anyway - please update those instructions, lets try and collate all
the ruby on osx info if we can :)

- james

The problem is I don't remember exactly the steps I took, so I can't
provide a step-by-step guide.
I'll try to put together a guide from the edited files as soon as
possible.

Regards Alwin.
 
Ad

Advertisements

A

Alwin Blok

--Apple-Mail-6--254042018
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed

Hello,

Here are my instructions to get rbogl-0.32c compiled on Mac OSX 10.3
(Panther)
(the attached .rtf file)

It's a bit different from the instructions listed on
http://www.rubygarden.org/ruby?RubyOnMacintosh/OpenGLandGLUT but this
is what makes it work on my machine. (I hope I haven't missed
something)

Regards Alwin.


--Apple-Mail-6--254042018
Content-Transfer-Encoding: 7bit
Content-Type: application/rtf;
x-unix-mode=0644;
name="rbogl_panther.rtf"
Content-Disposition: attachment;
filename=rbogl_panther.rtf

{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fnil\fcharset77 LucidaGrande-Bold;\f1\fnil\fcharset77 Monaco;\f2\fnil\fcharset77 LucidaGrande;
}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww13000\viewh14880\viewkind0
\pard\tx565\tx1133\tx1700\tx2266\tx2833\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b\fs32 \cf0 In extconf.rb\
\pard\tx565\tx1133\tx1700\tx2266\tx2833\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs24 \cf0 Comment out the lines:\

\f1\b0 header = nil\
\
idir, ldir = dir_config("x11", "/usr/X11R6")\
have_library("Xi", "XAllowDeviceEvents")\
have_library("Xext", "XMITMiscGetBugMode")\
have_library("Xmu", "XmuAddCloseDisplayHook")\
have_library("X11", "XOpenDisplay")\
\
dir_config("opengl", idir, ldir)\
dir_config("glut", idir, ldir)\
\

\f0\b replace the line:\

\f1\b0 have_library(lib, func) || have_library("Mesa"+lib, func)\

\f0\b with\

\f1\b0 true\
\

\f0\b Comment out the lines:\

\f1\b0 if have_library(glut_libname)\
\
end\
\

\f0\b Now run ruby extconf.rb. \
This creates the makefiles you'll have to edit by hand.\
\
\pard\tx565\tx1133\tx1700\tx2266\tx2833\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs32 \cf0 In rbogl and ogl.c:\
\pard\tx565\tx1133\tx1700\tx2266\tx2833\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs24 \cf0 replace the line: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 #include "GL/gl.h"\

\f0\b with:\

\f1\b0 #include <OpenGL/gl.h>\

\f2 \
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b\fs32 \cf0 In glu.c\
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs24 \cf0 replace the lines: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 #include "GL/gl.h"\
#include "GL/glu.h"\

\f0\b with:\

\f1\b0 #include <OpenGL/gl.h>\
#include <OpenGL/glu.h>\
\
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b\fs32 \cf0 In glut.c\
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs24 \cf0 replace the line: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 #include "GL/glut.h"\

\f0\b with:\

\f1\b0 #include <GLUT/glut.h>\

\f2 \
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b\fs32 \cf0 In Makefile.ogl and Makefile.glut: \
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\fs24 \cf0 replace the lines: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 CFLAGS = -fno-common -g -O2 -fno-common -pipe -fno-common \

\f0\b with:\

\f1\b0 CFLAGS = -fno-common -g -O2 -pipe -I/System/Library/Frameworks/OpenGL.framework/Headers -I/System/Library/Frameworks/GLUT.framework/Headers\

\f0\b and:\

\f1\b0 LIBS = $(LIBRUBYARG_SHARED) -ldl -lobjc \
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b \cf0 with: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 LIBS = -ldl -lruby -lGLU -lGL -lobjc -framework GLUT\

\f0\b and:\
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f1\b0 \cf0 DLDFLAGS = \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b \cf0 with:\

\f1\b0 DLDFLAGS = -L$(topdir) -L$(libdir) -L/System/Library/Frameworks/OpenGL.framework/Libraries\

\f2 \
\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural

\f0\b\fs32 \cf0 Compile: \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\fs24 \cf0 compile with:\

\f1\b0 make\

\f0\b Test with:\

\f1\b0 ruby sample/robot.rb\

\f0\b Install with:\

\f1\b0 sudo make install}
--Apple-Mail-6--254042018--
 
Ad

Advertisements


Top