[Pharo-project] ANN: OpenGL + NativeBoost + Mac ==> success
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac. The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup. In order to load project, take a fresh Pharo 1.4 image, load ConfigurationOfNBOpenGL package using MC from MCHttpRepository location: 'http://www.squeaksource.com/NBOpenGL' user: 'sig' password: '' or by Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load and then issue: ConfigurationOfNBOpenGL project lastVersion load. Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here: https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS... If everything goes well, you should be able to run a demo by doing: GLTTRenderingDemo new openInWorld. P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon. -- Best regards, Igor Stasenko.
Hi igor. I am the OpenGL biggest newbie you can find the world. I have just reproduced all your steps but I have an error in NBMacGLContextDriver >> createContext: initialExtent the error is "'invalid pixel format'" Any ideas? I attach PharoDebug.log Cheers On Fri, Jan 20, 2012 at 7:52 PM, Igor Stasenko <siguctua@gmail.com> wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
In order to load project, take a fresh Pharo 1.4 image, load
ConfigurationOfNBOpenGL package using MC from
MCHttpRepository location: 'http://www.squeaksource.com/NBOpenGL' user: 'sig' password: ''
or by
Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load
and then issue:
ConfigurationOfNBOpenGL project lastVersion load.
Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here:
https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS...
If everything goes well, you should be able to run a demo by doing:
GLTTRenderingDemo new openInWorld.
P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon.
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
On 20 January 2012 21:04, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi igor. I am the OpenGL biggest newbie you can find the world. I have just reproduced all your steps but I have an error in NBMacGLContextDriver >> createContext: initialExtent the error is "'invalid pixel format'" Any ideas? I attach PharoDebug.log
yes. It doesn't works with your hardware :) Strange that it worked on mine: - 4 years old Mac Pro - lion what you can do is go to #createContext: method and play with various options for GL pixel format. attribs := CGLPixelFormatAttributes for: { KCGLPFAFullScreen. KCGLPFADisplayMask -> self mainDisplayMask. KCGLPFADoubleBuffer. KCGLPFAColorSize -> 24. KCGLPFAAlphaSize -> 8. " KCGLRPAccelerated." KCGLPFAMultisample. KCGLPFASampleAlpha. KCGLPFASamples -> 8. 0 }. you should be able to create a context.. but of course it is a big question if with your format my demo will still run , because it wants some extensions :) -- Best regards, Igor Stasenko.
On 20 January 2012 22:36, Igor Stasenko <siguctua@gmail.com> wrote:
On 20 January 2012 21:04, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi igor. I am the OpenGL biggest newbie you can find the world. I have just reproduced all your steps but I have an error in NBMacGLContextDriver >> createContext: initialExtent the error is "'invalid pixel format'" Any ideas? I attach PharoDebug.log
yes. It doesn't works with your hardware :) Strange that it worked on mine:  - 4 years old Mac Pro  - lion
what you can do is go to #createContext: method and play with various options for GL pixel format.
attribs := CGLPixelFormatAttributes for: Â { Â Â Â Â Â Â Â Â KCGLPFAFullScreen. Â Â Â Â Â Â Â Â KCGLPFADisplayMask -> self mainDisplayMask. Â Â Â Â Â Â Â Â KCGLPFADoubleBuffer. Â Â Â Â Â Â Â Â KCGLPFAColorSize -> 24. Â Â Â Â Â Â Â Â KCGLPFAAlphaSize -> 8. Â Â Â Â Â Â Â Â " Â Â Â KCGLRPAccelerated." Â Â Â Â Â Â Â Â KCGLPFAMultisample. Â Â Â Â Â Â Â Â KCGLPFASampleAlpha. Â Â Â Â Â Â Â Â KCGLPFASamples -> 8. Â Â Â Â Â Â Â Â 0 Â Â Â Â Â Â Â Â }.
you should be able to create a context.. but of course it is a big question if with your format my demo will still run , because it wants some extensions :)
i'd like to add that creating an openGL context is the most delicate part of initialization. On all platforms without exception. Once you obtained it (hopefully with right capabilities), the rest is a piece of cake.
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
I'm sorry even loading the project was impossible on my mac. With the first strategy, Monticello kept insisting that "sig" had a possword. With the Gofer strategy, ConfigurationOfNBOpenGL project lastVersion load. informed me that #lastVersion was undefined. Trying with #latstVersion gave different errors. When I managed to force thigns to load using #loadBleedingEdge, classes were missing so I couldn't run your example code: GLTTRenderingDemo new openInWorld. Mac OS X leopard, using a fesh download of Pharo 1.4 iamge and sources, as well as a fresh download of the NBCog VM. L On 1/20/12 11:52 AM, Igor Stasenko wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
In order to load project, take a fresh Pharo 1.4 image, load
ConfigurationOfNBOpenGL package using MC from
MCHttpRepository location: 'http://www.squeaksource.com/NBOpenGL' user: 'sig' password: ''
or by
Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load
and then issue:
ConfigurationOfNBOpenGL project lastVersion load.
Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here:
https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS...
If everything goes well, you should be able to run a demo by doing:
GLTTRenderingDemo new openInWorld.
P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon.
On Fri, Jan 20, 2012 at 10:18 PM, Lawson English <lenglish5@cox.net> wrote:
I'm sorry even loading the project was impossible on my mac. With the first strategy, Monticello kept insisting that "sig" had a possword.
With the Gofer strategy,
ConfigurationOfNBOpenGL project lastVersion load.
informed me that #lastVersion was undefined.
That's normal, because the Compiler knows there is no #lastVersion defined in your image. But the message #project will cause Metacello to be boostraped if it is not already in the image. Hence, after sending #project you will have #lastVersion...so you have just need to accept the warning and everything will load fine.
Trying with #latstVersion gave different errors.
When I managed to force thigns to load using #loadBleedingEdge, classes were missing so I couldn't run your example code:
GLTTRenderingDemo new openInWorld.
Mac OS X leopard, using a fesh download of Pharo 1.4 iamge and sources, as well as a fresh download of the NBCog VM.
L
On 1/20/12 11:52 AM, Igor Stasenko wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
In order to load project, take a fresh Pharo 1.4 image, load
ConfigurationOfNBOpenGL package using MC from
MCHttpRepository location: 'http://www.squeaksource.com/**NBOpenGL<http://www.squeaksource.com/NBOpenGL> ' user: 'sig' password: ''
or by
Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load
and then issue:
ConfigurationOfNBOpenGL project lastVersion load.
Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here:
https://ci.lille.inria.fr/**pharo/view/NativeBoost/job/NB-** Cog-Mac-Carbon/**lastSuccessfulBuild/artifact/<https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS...>
If everything goes well, you should be able to run a demo by doing:
GLTTRenderingDemo new openInWorld.
P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon.
-- Mariano http://marianopeck.wordpress.com
OK, I've got NB and NBOpenGL isntalled on my Mac. Very slick! I'm doing a video on how to install it for my tutorial series. However, many things pop up as I experiment. If I attempt to create more than one instance of the demo I sometimes get errors. If the instances create without error, then resizing one window will resize the drawing a the other, even though they are still drawing different images. Regardless, very slick and smooth. I hope that this becomes an extremely popular package for both Pharo and Squeak and eventually will let us use OpenGL as the main drawing engine at the lowest level (or other 3D engines as they become available). test := GLTTRenderingDemo new openInWorld. test1 := GLTTRenderingDemo new openInWorld. Lawson On 1/20/12 11:52 AM, Igor Stasenko wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
I created a new video how to for installing NativeBoost OpenGL on Pharo 1.4 Smalltalk on the Mac: http://www.youtube.com/watch?v=RAvlIVG4biM Igor, your code is very nice. I think there's a lot of potential here for NativeBoost and OpenGL that might attract new classes of programmers to smalltalk. I'd be happy to help create demos and videos of what can be done. Lawson On 1/20/12 11:52 AM, Igor Stasenko wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
In order to load project, take a fresh Pharo 1.4 image, load
ConfigurationOfNBOpenGL package using MC from
MCHttpRepository location: 'http://www.squeaksource.com/NBOpenGL' user: 'sig' password: ''
or by
Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load
and then issue:
ConfigurationOfNBOpenGL project lastVersion load.
Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here:
https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS...
If everything goes well, you should be able to run a demo by doing:
GLTTRenderingDemo new openInWorld.
P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon.
did you notice that you can save the image in the middle of the animation and it will continue on restart :) On Jan 22, 2012, at 4:23 AM, Lawson English wrote:
I created a new video how to for installing NativeBoost OpenGL on Pharo 1.4 Smalltalk on the Mac: http://www.youtube.com/watch?v=RAvlIVG4biM
Igor, your code is very nice. I think there's a lot of potential here for NativeBoost and OpenGL that might attract new classes of programmers to smalltalk. I'd be happy to help create demos and videos of what can be done.
Lawson
On 1/20/12 11:52 AM, Igor Stasenko wrote:
Today i'm happy to announce that i can run my 2 years-old demo which i did when created NBOpenGL bindings first on Windows, working without ANY changes in code on Mac.
The main hurdle with adding MacOsx support was that it is largely unknown platform to me , and there are 3 different ways to get there, namely CGL, Carbon and Cocoa. Fortunately CGL approach worked well, despite its a bit limited (you cannot create a windowed context, only fullscreen or offscreen one). But since i am using FBO's , it doesn't really matters. Of course it may make difference for people who want to use GL in different setup.
In order to load project, take a fresh Pharo 1.4 image, load
ConfigurationOfNBOpenGL package using MC from
MCHttpRepository location: 'http://www.squeaksource.com/NBOpenGL' user: 'sig' password: ''
or by
Gofer it squeaksource: 'NBOpenGL'; package: 'ConfigurationOfNBOpenGL'; load
and then issue:
ConfigurationOfNBOpenGL project lastVersion load.
Remember, that you have to use CogVM with NativeBoost plugin, which you can download from here:
https://ci.lille.inria.fr/pharo/view/NativeBoost/job/NB-Cog-Mac-Carbon/lastS...
If everything goes well, you should be able to run a demo by doing:
GLTTRenderingDemo new openInWorld.
P.S. @ Windows users: due to refactorings which i did, a windows-specific support code is currently broken. So please use older versions of packages (prior to this month). I will fix them very soon.
participants (4)
-
Igor Stasenko -
Lawson English -
Mariano Martinez Peck -
Stéphane Ducasse