[Pharo-dev] Transparent colors with NBOpenGL?

Ronie Salgado roniesalg at gmail.com
Thu Dec 26 01:52:21 EST 2013


libSDL and libSDL2 are low-level multi-media libraries designed for games.
Those libraries are best suited for basic pixel blitting, some lines and
rect in a cross platform way. Both libraries allows you to use a custom
software rendering or create a window in a cross-platform way. As for
Cairo, that's a full featured vector graphics library, practically designed
for SVG rendering. So, those two libraries cannot be compared, but I think
that Cairo can be used to render into a texture and then use SDL to display
it on screen. Actually, I don't have any experience with Cairo.

As for the VM, I was looking at his Unix platform module, suspecting that
the tearing and flickering was caused by using just XLib for blitting the
main pharo window after Milton told that those issues aren't seen in
Windows. If we add to the mix some always buggy AMD drivers, it seems that
the solution goes by rewriting the display to uses OpenGL for blitting the
main window, with VSync enabled, or using a separate native window for
OpenGL graphics.

By the way, what I found most strange about display VM code is that there's
support for creating an OpenGL context already in place, with an
accompanying -glxdebug flag, for verbose output. When I tried that option,
I didn't get any output, so I could assume that these is not used for fast
blitting under Linux.

As for SDL2, it provides all the required facilities for a VM display
module, without having to deal with X11 or platform specifics. Window
creation, multiple OpenGL context creation, clipboard handling, input
support, multi-threading, sound support, drag and drop. That version of SDL
had a strong contribution by Valve, they needed something to start pushing
heavily Linux, even the latest versions of Steam uses it.

Anyway, I am planning to discuss this matter with Igor, during my stay at

Ronie Salgado

2013/12/26 Alexandre Bergel <alexandre.bergel at me.com>

> Ronie,
> You mention libSDL. Do you know how it compares with Cairo? They look
> similar, but I could not find a detailed comparison
> Alexandre
> Le 26-12-2013 à 0:12, Ronie Salgado <roniesalg at gmail.com> a écrit :
> Stef
> That sounds very interesting. I dream of a virtual world environment such
> as Second Life, highly dynamic and completely open source.
> But currently I would like to do a simple video game, with toon like
> graphic, using bullet for physics. I think that making an actual game
> development pipeline would be very interesting.
> I would not create a full level editor, modeling software because it takes
> too much time, and there is Blender which is open source and very complete.
> Some tasks required are as follow:
> - An easy way to make bindings for C++ libraries. For this I am going to
> start extending SWIG(http://www.swig.org/) so it can generate bindings
> for Pharo NativeBoost.
> - Bindings for the Bullet physics engine(
> http://bulletphysics.org/wordpress/). With the extensions for swig, this
> is trivial.
> - An importer for COLLADA. COLLADA is a XML based asset exchange format,
> with a wide support in different 3d model editors, such as Blender.
> - For Linux, a new VM display module is required. The current that uses
> just X11 suffers of severe tearing and flickering. I would like to make a
> display module for the VM that uses SDL2, which is a cross platform library
> that supports hardware accelerated graphics, or cross platform creation of
> an OpenGL context.
> - I think that garbage collection would require some determinism/time
> constraint or write some guidelines to avoid triggering the gargbage
> collector. When I'm testing the particles, I can see some noticeable pause,
> that I attribute to the garbage collector.
> Greetings,
> Ronie Salgado
> 2013/12/25 Stéphane Ducasse <stephane.ducasse at inria.fr>
>> Ronie
>> I was talking about 3D with Igor (because Igor came to Smalltalk because
>> he wanted to use it as a game engine and built rendering
>> engine in Pascal long long time ago :).
>> So I was brainstorming to see what you could do.
>> the last time alex show roassal 3D we were thinking that it would be good
>> to build a kickstarter show case on something
>> sexy (maybe bridging a physical model to 3D)….
>> Now what would like to build with NBOpenGL? What are your dreams and how
>> could we slice them into tasks that could be reached in a limited amount
>> of time.
>> Stef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131226/261f6464/attachment-0002.html>

More information about the Pharo-dev mailing list