[Newbies] OpenGL in Squeak
Bert Freudenberg
bert at freudenbergs.de
Fri Jan 19 09:55:37 UTC 2007
Am Jan 19, 2007 um 0:47 schrieb Mike O'Brien:
> Has anyone hooked up the OpenGL libraries in Squeak on
> the FreeBSD platform? Squeak runs great on FreeBSD. I'm
> running the 3.7 VM from the FreeBSD ports collection right
> now. Problem is, I'm trying to run Croquet, which tries
> to make OpenGL calls. Squeak tries to use GLUnixX11LE
> calls on my i386 box, but an automatically generated method
> tries to hook up to "opengl32.dll", which is a Windows
> sort of thing which doesn't exist on a FreeBSD box.
Actually, no - it's just that the source code does not match what
gets executed.
When starting up, the setup code patches the correct library name
into all the glue code methods (see OpenGL>>privateInstallLibrary:).
Actually, after running OpenGL once, switch to decompiled code in the
browser and you should see the correct name there.
This is confusing to a lot of newcomers (actually, I suspect most of
the seasoned folks never looked at that stuff either), so you might
lobby for getting the source code changed to make this more obvious -
it works, so hasn't been touched in years.
> Automatically generated methods give me the heeb-jeebs.
> How can I get the Squeak VM hooked up correctly to
> /usr/X11R6/lib/libGL.*?
Most probably you just have to put in the actual library name. See
method #openGLLibraryName - this might return an invalid library for
your system.
Per default we just return 'GL' on unixish systems, which the module
loader expands into various names like 'libGL.so'. However, on Linux
there most often is no 'libGL.so', but only 'libGL.so.1', so the
library would not be found. Therefore, a special case is in there
that returns 'libGL.so.1' on Linux. I'm not sure what the library is
named on FreeBSD, but you only have to patch this in a single place,
namely #openGLLibraryName.
HTH,
- Bert -
More information about the Beginners
mailing list