[squeak-dev] Re:NativeBoost and NBOpenGL on Mac?

Bert Freudenberg bert at freudenbergs.de
Wed Jan 11 18:18:45 UTC 2012

On 11.01.2012, at 18:34, Lawson English wrote:

> [cross-posting this reply because it certainly seems relevant to both Pharo and Squeak]
> This seems to me to be roundabout, and will make sure that any Mac version of OpenGL will be far slower than any Windows version.
> What I'm not understanding is how the current OpenGL libs can render directly on the screen on a Mac, while the Igor's can't. The  Croquet OpenGL package appears to be grabbing something from the Baloon3D plugin, I think. Has anyone looked at how THAT tells OpenGL libs to render to the appropriate area on the system window?
> primCreateRenderer: flags x: x y: y w: w h: h
> <primitive: 'primitiveCreateRendererFlags' module:'B3DAcceleratorPlugin'>
>    ^nil
> L

This primitive encapsulates the platform-dependent part of creating an OpenGL rendering context. OpenGL itself is platform-independent, but creating a window is not. The plugin has code for Mac, Windows, and Unix.

So this creates a new borderless window that gets embedded in the "big" main window. It also creates an OpenGL context for that window and makes it current. After calling the primitive you can use any OpenGL commands to draw directly into it using the hardware renderer. I don't see a good reason why you would not want to use it.

- Bert -

> On 1/11/12 1:22 AM, Fernando Olivero wrote:
>> I've developed a CocoaUI app, which implements the example you copied.
>> A cocoa window, with a custom NSView, which renders an OpenGL surface.
>> The app also catches events, and notifies it via sockets.
>> My idea is to render within Pharo to a frame buffer object(offscreen
>> rendering), and communicate the redisplay to the cocoa app via sockets
>> (IPC).
>> So we can code all the UI in Smalltalk, using offscreen rendering as a
>> means to draw to  a native OS X window.
>> I will continue experimenting with this approach, to assess its
>> performance and usability. Wether IPC via sockets is fast enough,
>> amongst other technical challenges.
>> Yes, i noticed two that the OpenGL info in the Mac, returns 'APPLE
>> SOFTWARE RENDERER 2.1". Surely we can find a way to solve this
>> problem, i will look into Lawson's link.
>> Fernando
>> pd: Enjoy the vacations Igor, have a pint or two.
>> On Wed, Jan 11, 2012 at 1:21 AM, Igor Stasenko<siguctua at gmail.com>  wrote:
>>> On 10 January 2012 21:28, Stéphane Ducasse<stephane.ducasse at inria.fr>  wrote:
>>>> thanks
>>>> May be this page is interesting: http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_drawing/opengl_drawing.html#//apple_ref/doc/uid/TP40001987-CH404-SW8
>>>> Igor how is london :) ?
>>>> Crowded?
>>> like hell. :)
>>> Kiev is more or less same in this regard, so i already having immunity
>>> Yes, i will definitely get back to this issue, once i return from vacation.
>>> And now i should stop reading and replying mails and spend time on
>>> just resting :)
>>> --
>>> Best regards,
>>> Igor Stasenko.

More information about the Squeak-dev mailing list