Croquet on mac os-9
Bob Arning
arning at charm.net
Sun Nov 17 20:54:44 UTC 2002
On Sun, 17 Nov 2002 12:39:44 -0800 John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
>Well keeping this stuff as a FFI call would be nicer. Once it gets into
>a library, then the VM builders have to
>make new VM or plugins for fixes or changes & additions. If the call is
>via FFI then any squeaker can fix it and distribute a change set.
>
>I think the only issue is that various platforms have different names
>for the module. Usually the api name, parm types etc are the same.
>So can one substitute an instance variable here for example for that
>hard coded 'OpenGLLibrary'? That for example is the only difference
>between the OS9 and OSX version of the openGL interface class.
FWIW, this is what I have been using to run on multiple platforms:
convertOpenGLAPIToPlatformOnTheFly
| myLibrary me allLibs |
allLibs _ OrderedCollection new.
me _ Smalltalk platformName.
{
{'Mac OS'. #'OpenGLLibrary'}.
{'Win32'. #'opengl32.dll'}.
{'unix'. #'libGL.so'}.
} do: [ :each |
each first = me ifTrue: [
myLibrary _ each second.
].
allLibs add: each second.
].
ExternalLibraryFunction allInstances do: [ :each |
(allLibs includes: each module) ifTrue: [each setModule: myLibrary].
me = 'unix' ifTrue: [
each setCallingConventionString: 'cdecl'
] ifFalse: [
each setCallingConventionString: 'apicall'
].
].
Cheers,
Boib
More information about the Squeak-dev
mailing list
|