2009/7/27 Javier Pimás <elpochodelagente@gmail.com>:
Hi, this is my first mail to the list so hello everybody.
I've been trying to make GLMorphic work on pharo and got some useful results. I investigated the plugin that was needed to integrate into the VM and noticed it was really small, so I thought why make this in C if you can implement it directly in smalltalk. Shortly after that I came up with a translation of it (through FFI) so that you can use it with the VM as is. The code isn't something I'd call good, but it works fine (only windows, sorry).
Yes, you could implement it purely using FFI, but there's few things, why i decided to make a plugin instead: - you can't access the squeak window handle directly, there is no primitive. Accessing the window handle, as it shown in Win32/FFI examples , using activeWindow() function, is not what i like to be depend on. As well as filling the boring PIXELFORMATDESCRIPTION fields is not very easy in smalltalk... :) But anyways, if you did it, it is good, because now, it could work w/o additional plugin. An initialization & windowing stuff can be ported onto another platforms with a bit of pain, but the rest should work as usual because its OpenGL :)
If you want to try it, you should do
ScriptLoader loadFFI.
and then download the GLMorphic-JEP version of GLMorphic package from squeaksource (after GLMorphic-sig? ). I also made some modifications to FFI-Examples, so you may also have to dowonload FF-Examples-JEP from squeakfoundation.org. I'm new to monticello so it wouldn't be strange if nothing got uploaded correctly.
Some things work and most looks messed up, specially fonts... try
i suspect that the source of mess is texture handling. Especially with font glyphs. I had plans to rewrite the texture/font cache for it, to not use weak finalization. Because i suspect that this is a reason why sometimes textures go wild - because finalization process interrupts UI process in the middle. And this potentially could damade the OpenGL state mechanism, because of out-of-order calls. At time, i implemented it, i was not aware of Squeak's scheduling nuances :)
World fullDrawOn: GLDisplayScreen testCanvas.
and you'll see.
Let me know what you think.
Bye!
-- Javier Pimás Ciudad de Buenos Aires
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.