Hi Ken, sorry for the delayed reply. (i was away in summer school)
What i did , in my OpenGl binding that uses Alien is to reify the data
types.
For example, i created the class GLEnnum ( subclass of Alien).
You have to re-implement the method #dataSize, so you can just do
e := GLEnum false.
GLEnum>>false
| f |
f := self new.
f value: 0.
^ f
GLEnum>>#dataSize
^ self unsignedLongSize
Alien>>#unsignedLongSize
^ 4
Johan is going to add better abstractions to import definitions to
Alien, i did it by "hand" (which didn't take much though).
Saludos,
Fernando
Il giorno Sep 16, 2009, alle ore 8:37 PM, Ken Treis ha scritto:
> * I'm creating a partial Alien library for GemStone so that I can
> use the CairoGraphics package in both Pharo and GLASS. But on
> x86-64, there there's a size difference between a pointer/long and
> an integer. It'd be nice to have some more explicit APIs on Alien,
> so I could say "Alien newCInteger" or "Alien newCLong" and have the
> platform return me the proper size Alien. Even without the platform
> size differences, it seems awkward to use "Alien newC: 4" everywhere
> I want an integer, "Alien newC: 8" where I want a double, etc.
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project