How to use frameworks like SDL2, GTK+ with Pharo?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use frameworks like SDL2, GTK+ with Pharo?

Daniel Passaro
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?
Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

philippeback
SDL2 is built in.

GTK+ is another story.

Phil

On Tue, Jun 13, 2017 at 6:38 PM, Daniel Passaro <[hidden email]> wrote:
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?

Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

Daniel Passaro
Even if the image environment runs on SDL2, I want an SDL2 window I have free reign to draw on. I don't want to destroy the usability of the Pharo workspace when programming an application. If that is still too contentious, then I want SFML instead.

The story of GTK+ is what I'm interested in.

On Tue, Jun 13, 2017 at 12:48 PM, [hidden email] <[hidden email]> wrote:
SDL2 is built in.

GTK+ is another story.

Phil

On Tue, Jun 13, 2017 at 6:38 PM, Daniel Passaro <[hidden email]> wrote:
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?


Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

Ben Coman
In reply to this post by Daniel Passaro


On Wed, Jun 14, 2017 at 12:38 AM, Daniel Passaro <[hidden email]> wrote:
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?

I'm nto familiar with the interface from Pharo, but I believe the dark window opened in this video... 
is a native window via SDL2, outside of the standard Pharo window - if that is what you are lookign for.

Probably FFI is the easier path. Its how Pharo uses SDL2. There is an incomplete tutorial here...

btw, I just noticed the "UniffiedFFI chapter" link from that post has broke. I guess the doc has moved here...
but I can't find a PDF there.

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

kilon.alios
In reply to this post by Daniel Passaro


On Tue, Jun 13, 2017 at 7:39 PM Daniel Passaro <[hidden email]> wrote:
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?

If you know python, because python has wrappers for pretty much any library out there, i made a pharo library that allows for remote and local execution of python code from inside pharo. Its not perfect but it will give you access to pretty much any library out there because python is very popular. The library is called Atlas , its available from the Package/Catalog browser and requires that you have installed the library you want to use , python 3 and wrappers for  python for that library. Third one may be optional because some library come with python wrappers included. 

If you need any help , I am here. You can use also Atlas as the basis for supporting other languages all you need is a language that can dynamically execute code (usually dynamic languages like python) and support for sockets (sockets are supported in almost all languages). 

UFFI is the official way of interfacing with C libraries , but C is difficult to manage , very difficult to debug but gives top performance. If the library is made in C++ UFFI cannot access it immediately the library has to be compiled without name mangling. 
Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

philippeback
In reply to this post by Daniel Passaro
Image environment is not running on SDL2. SDL2 is a binding that is in image.

An SFML binding is cool to do, especially CSFML.


I want to do these in Bloc

But CSFML is cool to do too. 

And I also want a binding to https://github.com/cmatsuoka/libxmp


Phil

On Tue, Jun 13, 2017 at 6:55 PM, Daniel Passaro <[hidden email]> wrote:
Even if the image environment runs on SDL2, I want an SDL2 window I have free reign to draw on. I don't want to destroy the usability of the Pharo workspace when programming an application. If that is still too contentious, then I want SFML instead.

The story of GTK+ is what I'm interested in.

On Tue, Jun 13, 2017 at 12:48 PM, [hidden email] <[hidden email]> wrote:
SDL2 is built in.

GTK+ is another story.

Phil

On Tue, Jun 13, 2017 at 6:38 PM, Daniel Passaro <[hidden email]> wrote:
I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from Pharo? Should this be done through FFI or a VM plugin?  And in either case is there a guide to how to implement things using that technique?



Reply | Threaded
Open this post in threaded view
|

Re: How to use frameworks like SDL2, GTK+ with Pharo?

Stephane Ducasse-3
Hi daniel

You can open a SDL2 window now it may break because we do not use it regularly.
If you encounter problem let us know because this binding should be
one we will use in the future:
- we want to handle all the events + all the window via SDL2 so this
is central to us.

We are interested in what you can do with sfml. Now you can also have
a look at Bloc because this is
a core of a new library that got 5 years of maturation and now its
design is nice and stable.

Stef



On Tue, Jun 13, 2017 at 8:51 PM, [hidden email] <[hidden email]> wrote:

> Image environment is not running on SDL2. SDL2 is a binding that is in
> image.
>
> An SFML binding is cool to do, especially CSFML.
>
> https://www.sfml-dev.org/download/csfml/
>
> I want to do these in Bloc
> https://www.youtube.com/playlist?list=PLB_ibvUSN7mzUffhiay5g5GUHyJRO4DYr
>
> But CSFML is cool to do too.
>
> And I also want a binding to https://github.com/cmatsuoka/libxmp
>
>
> Phil
>
> On Tue, Jun 13, 2017 at 6:55 PM, Daniel Passaro <[hidden email]>
> wrote:
>>
>> Even if the image environment runs on SDL2, I want an SDL2 window I have
>> free reign to draw on. I don't want to destroy the usability of the Pharo
>> workspace when programming an application. If that is still too contentious,
>> then I want SFML instead.
>>
>> The story of GTK+ is what I'm interested in.
>>
>> On Tue, Jun 13, 2017 at 12:48 PM, [hidden email] <[hidden email]>
>> wrote:
>>>
>>> SDL2 is built in.
>>>
>>> GTK+ is another story.
>>>
>>> Phil
>>>
>>> On Tue, Jun 13, 2017 at 6:38 PM, Daniel Passaro <[hidden email]>
>>> wrote:
>>>>
>>>> I'm a Pharo newbie. How can I use libraries like SDL2 or GTK+ from
>>>> Pharo? Should this be done through FFI or a VM plugin?  And in either case
>>>> is there a guide to how to implement things using that technique?
>>>
>>>
>>
>