Interesting that Ubuntu turns out to be the trouble spot.  I take no joy in 
that, because I have found Ubuntu to be a good platform for me, but the "now it 
works, now it's broken again" vpn and a few other snags have me casually 
looking at other distributions.  Mandriva looks interesting based on a LiveCD.  
As always, recommendations (both positive and negative) are welcome.

One thing lacking (when I last looked) was an Alien plugin for Linux.  There is 
a configuration for VMMaker, but I have been too busy to get much beyond 
noticing that.

Bill

________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[mailto:pharo-project-boun...@lists.gforge.inria.fr] On Behalf Of Eliot Miranda
Sent: Wednesday, February 10, 2010 1:11 PM
To: Pharo-project@lists.gforge.inria.fr
Cc: Ryan Macnak
Subject: Re: [Pharo-project] OpenGL in pharo?



2010/2/10 Javier Pimás 
<elpochodelage...@gmail.com<mailto:elpochodelage...@gmail.com>>
Fernando,
            thanks for the tips. I read about lumiere before, but I'm not 
looking for a complete 3d framework, just the opengl wrappers to do some 
experiments. A complete framework would be too much for what I want to try (hw 
acelerated 2d animations). Anyway, your pdf gave me a better idea of the status 
of all the available projects.

 As of Croquet, yes, someone decoupled the OpenGL part (which is the same I 
tested yesterday and depends on Ballon3D). I finally was able to load it in 
pharo! If anyone is interested here are the steps:

Take a pharo image (mine had FFI and VMMaker already loaded, I don't know if 
they were needed at all)

In monticello add 
squeaksource.com/Balloon3D<http://squeaksource.com/Balloon3D>. Open it and load 
just this packages in order: Balloon3D-constants, Balloon3D-kernel, 
Balloon3D-math.

Now add squeaksource.com/OpenGL<http://squeaksource.com/OpenGL> and load it.

That's all to load it, to try it, doit this code, and when you get errors 
change occurrences of Smalltalk to SmalltalkImage current.


ogl := OpenGL newIn: (0...@0 extent: 3...@300).
green := 1.
canvas := OGLCanvas new initialize: ogl.
fade:= 0.

    1000 timesRepeat: [
       ogl glClearColor:0 with: fade with: 0 with: 1.
        ogl glClear: 16r4000.
        ogl swapBuffers.
       fade := fade + 0.001.
    ].

fade := 0.


I think the best way would be to use AlienOpenGL, which is the future, but for 
that I'll have to wait alien support in linux.

The alien code should "just work" on linux, but subtleties in alloca mean it 
crashes on e.g. Ubuntu.  But Ryan Macnak juts got the AlienFFI working in 
Newspeak on Ubuntu.

I think what's happened is that recent Linux gcc versions increase the stack 
alignment to 16 bytes to support x86 sse2 instructions, where 16 byte alignment 
is required to avoid alignment violations using 128-bit transfers to/from the 
xmm registers.    So in platforms/Cross/plugins/ia32abicc.c where it states

#if __APPLE__ && __MACH__ && __i386__
# define STACK_ALIGN_BYTES 16
#endif

this should probably read

#if ((__APPLE__ && __MACH__) || __linux__) && __i386__
# define STACK_ALIGN_BYTES 16
#endif

Give it a go and you should find the AlienFFI will work on linux.


Regards,
          Javier.

2010/2/10 Fernando olivero <olive...@lu.unisi.ch<mailto:olive...@lu.unisi.ch>>
Hola Javier,  on top of AlienOpenGL , which is just an interface to OpenGL, 
i've built a 3d framework with better abstractions called Lumiere. 
(http://www.inf.usi.ch/phd/olivero/LumierePage.html  (A little bit 
outdated...i've added a couple of more things recently..)

In this  paper that  we presented at the last ESUG/IWST 09 , with also did 
brief survey of OpenGL in smalltalk. 
(www.esug.org/data/ESUG2009/IWST/iwst09_submission_6.pd<http://www.esug.org/data/ESUG2009/IWST/iwst09_submission_6.pd>)

If there's a plugin for AlienFFI for Linux i'm not sure. But have you tried the 
FFI binding of OGL of Croquet? That one works in Linux. Look in squeaksource, 
because i remember someone decoupled the OGL wrapper from Croquet and put it 
there.

I dont know if June ( for visual works) works in linux, but you could take a 
look of it.




Saludos,
Fernando


On Feb 10, 2010, at 3:01 AM, Javier Pimás wrote:

Hi, I've been browsing the different ways to use OpenGL in pharo and squeak. 
Here is a log of the results:

1 - Baloon3D - It looks like a layer on which 
squeaksource.com/OpenGL<http://squeaksource.com/OpenGL> stands, so to use 
opengl you load balloon3d, then opengl and if you have the Balloon3dPlugin 
available then you can use OpenGL. This seems to include code dated from 
2007/before. It loads fine in Squeak but in pharo I get many errors (load 
balloon3d-all in pharo1.0 rc2).

2 - GLMorphic - It uses FFI, so no plugin is needed, but it seems to be 
programmed only for windows, and I'm working in linux now.

3 - AlienOpenGL - It uses the new Alien FFI, which is only available in Mac 
platform.

So, the question is: is there any way to play with OpenGL in pharo on linux 
platform ?

Regards,
             Javier.

--
Javier Pimás
Ciudad de Buenos Aires
<ATT00001..txt>


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr<mailto:Pharo-project@lists.gforge.inria.fr>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Javier Pimás
Ciudad de Buenos Aires

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr<mailto:Pharo-project@lists.gforge.inria.fr>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to