Re: [Pharo-users] SDL plugin ?

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

Re: [Pharo-users] SDL plugin ?

EstebanLM
actually, the SDL plugin is not being included because until now it was not necessary. 
There is a difference between the SDL2 dependent functions and the plugin. 
The plugin provides just two functions: 

/**
 * Called by the VM heartbeat if installed, to check for the presence of events.
 */
static void ioCheckForEvents() {
    if (inited) {
        SDL_PumpEvents();
    if (SDL_HasEvents(SDL_FIRSTEVENT, SDL_LASTEVENT)) {
    interpreterProxy->signalSemaphoreWithIndex(inputSemaphoreIndex);
    }
    }
}

void setSDL2InputSemaphoreIndex(int semaIndex) {
    inited = 1;
    inputSemaphoreIndex = semaIndex;
    setIoProcessEventsHandler(&ioCheckForEvents);
}

and they are used to replace the event handling the world uses… something that you cannot do at this moment because I did not integrate that chunk yet :)

So you should not need it… for now.

Esteban

ps: btw… this kind of questions are not for regular users but for pharo developers (because you are playing with something that is or will be part of pharo it self), so I’m redirecting this question there. 

On 06 May 2015, at 22:03, Merwan Ouddane <[hidden email]> wrote:

Hello Matthieu

The sdl plugin is just the SDL runtime binaries recompiled with the vm for eaach plateform, you can find the sources here: https://www.libsdl.org/release/SDL2-2.0.1.zip

The compiled plugin for windows can be found inside the last vm here: http://files.pharo.org/get-files/40/pharo-win-latest.zip

Cheers,
Merwan


On 06/05/2015 21:48, Matthieu Lacaton wrote:
Hello, I am currently playing with OSWindow and I am wondering what the "SDL plugin" is in the OSSDL2Driver ?
When I downloaded the latest linux VM + image I got a library called libSDL2DisplayPlugin but how can I get this plugin for windows ? Is it possible to get the source code too ?

Thanks,

Matthieu



Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] SDL plugin ?

EstebanLM
I can add them to the vm compilation. 
Adding it to the TODO… 

Esteban

ps: again, pharo-dev :)

On 06 May 2015, at 22:45, Matthieu Lacaton <[hidden email]> wrote:

Thanks for your answers, I understand now.
But even if the plugin is not needed it is handy to have because it allows you to use "OSSDL2Driver current" without being returned an OSNullWindowDriver because of the "hasPlugin" returning false.
Moreover the "eventLoopProcessWithPlugin" is actually much more efficient than the "eventLoopWithoutPlugin" because of the semaphore.

So basically, even if it is not necessary, having the plugin just allows me to code without hacking these methods :p

Thank you,

Matthieu

2015-05-06 22:32 GMT+02:00 Esteban Lorenzano <[hidden email]>:
actually, the SDL plugin is not being included because until now it was not necessary. 
There is a difference between the SDL2 dependent functions and the plugin. 
The plugin provides just two functions: 

/**
 * Called by the VM heartbeat if installed, to check for the presence of events.
 */
static void ioCheckForEvents() {
    if (inited) {
        SDL_PumpEvents();
    if (SDL_HasEvents(SDL_FIRSTEVENT, SDL_LASTEVENT)) {
    interpreterProxy->signalSemaphoreWithIndex(inputSemaphoreIndex);
    }
    }
}

void setSDL2InputSemaphoreIndex(int semaIndex) {
    inited = 1;
    inputSemaphoreIndex = semaIndex;
    setIoProcessEventsHandler(&ioCheckForEvents);
}

and they are used to replace the event handling the world uses… something that you cannot do at this moment because I did not integrate that chunk yet :)

So you should not need it… for now.

Esteban

ps: btw… this kind of questions are not for regular users but for pharo developers (because you are playing with something that is or will be part of pharo it self), so I’m redirecting this question there. 

On 06 May 2015, at 22:03, Merwan Ouddane <[hidden email]> wrote:

Hello Matthieu

The sdl plugin is just the SDL runtime binaries recompiled with the vm for eaach plateform, you can find the sources here: https://www.libsdl.org/release/SDL2-2.0.1.zip

The compiled plugin for windows can be found inside the last vm here: http://files.pharo.org/get-files/40/pharo-win-latest.zip

Cheers,
Merwan


On 06/05/2015 21:48, Matthieu Lacaton wrote:
Hello, I am currently playing with OSWindow and I am wondering what the "SDL plugin" is in the OSSDL2Driver ?
When I downloaded the latest linux VM + image I got a library called libSDL2DisplayPlugin but how can I get this plugin for windows ? Is it possible to get the source code too ?

Thanks,

Matthieu