SDL2 and fork

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

Re: SDL2 and fork

EstebanLM

On 20 Apr 2015, at 22:47, Nicolai Hess <[hidden email]> wrote:



2015-04-20 16:56 GMT+02:00 Alexandre Bergel <[hidden email]>:
I see the point, but SDL seems to be pretty stable isn’t it? 
Only two versions are reported on their website (1.2 and 2.0). Maybe it would be better to directly talk to SDL. Just wondering...

Alexandre

If you use SDL directly -> you will have to create your own event loop (and other stuff)
If you use the OSWindow layer -> you will get a nice API that is already integrated with the main window / main window eventloop.

+1





Reply | Threaded
Open this post in threaded view
|

Re: SDL2 and fork

EstebanLM
In reply to this post by Nicolai Hess

On 20 Apr 2015, at 23:30, Nicolai Hess <[hidden email]> wrote:


2015-04-20 14:20 GMT+02:00 Esteban Lorenzano <[hidden email]>:
Hi, 

I just committed my prototype/experiment for windows with OSWindow, SDL2 and Athens. 
to check them: 

Gofer it 
smalltalkhubUser: 'Pharo' project: 'OSWindow';
package: 'OSWindow-Core';
package: 'OSWindow-SDL2';
package: 'OSWindow-SDL2-Canvases';
load.

and check the examples at: 

OSSDLAthensWindow
OSSDLMorphWindow

Great!

Although the VM crashes sometimes (after closing the SDL-Window)
well… I said is still a prototype :P


And I know found out why the window is partly out of the screen (on Windows7, don't think this happens on linux/mac):
If you open a SDL window with 

SDL createWindow: title x: 0 y: 0 ....
The window opens at 0@0 but this is the upper left corner of the window rectangle *without* window decoration. 

If you open the window with
SDL createWindow: title x: SDL_WINDOWPOS_UNDEFINED ....
-> the full window is visible
Yeah, I’m not a windows user and this kind of stupid errors will arise time to time.. But I will try to fix them as they come :)

cheers, 
Esteban




nicolai




 

cheers, 
Esteban

On 20 Apr 2015, at 13:55, Nicolai Hess <[hidden email]> wrote:



2015-04-20 13:13 GMT+02:00  <[hidden email]>:
Hello,
 
We don’t lose all keystroke events, but they are replaced by keydown events.

Yes, KeyDown/KeyUp are working and instead of a keystroke event another keydown is sent.
This is strange, I don't know exactly how the SDL event processing can influence the main window events.
Maybe this has something to do how we look for new events in the SDL2DisplayPlugin.
For me the call to SDL_PumpEvents looks unnecessary, maybe this is the cause?


nicolai

 
 
Merwan
 
 
De : Nicolai Hess
Envoyé : ‎lundi‎ ‎20‎ ‎avril‎ ‎2015 ‎09‎:‎36
À : Any question about pharo is welcome; Esteban Lorenzano
 


2015-04-20 8:38 GMT+02:00 Matthieu Lacaton <[hidden email]>:
Hello, 

Thanks for your answers ! I have multiple remarks here : 

1) I know that SDL2 should not be used "as is" in Pharo and I should use OSWindow instead, that's why I won't use SDL2 directly anymore.

On windows there is currently an issue if you use OSWindow instead of directly use SDL.
If you create a window with OSWindow, (like in the SDL2Example>>osWindow) you will loose all "keystroke" events in the main pharo window.
I don't know yet why this happens.

nicolai

Reply | Threaded
Open this post in threaded view
|

Re: SDL2 and fork

EstebanLM
In reply to this post by Sean P. DeNigris

> On 21 Apr 2015, at 02:12, Sean P. DeNigris <[hidden email]> wrote:
>
> Sean P. DeNigris wrote
>> VM latest
>
> That's odd... I opened the image with the latest VM and still got "Error:
> Failed to find SDL2 library" even though I can see libSDL2-2.0.0.dylib in
> the Plugins folder

it should be ok… at least is ok in my mac with stable vm (stable vm is from march 25 so it will be no difference between stable and latest right now).
maybe something to do with launcher?

cheers,
Esteban

>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/SDL2-and-fork-tp4818623p4820733.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: SDL2 and fork

Sean P. DeNigris
Administrator
#40609 + latest VM + 40 sources
- works on OS X 10.9.5
- can't find SDL2 library on OS X 10.8.5
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: SDL2 and fork

Sean P. DeNigris
Administrator
In reply to this post by EstebanLM
EstebanLM wrote
stable vm is from march 25 so it will be no difference between stable and latest right now
In http://files.pharo.org/vm/pharo/mac/ :

Stable:
1. stable.zip 9/2014
2. stable-20150325.zip 3/2015
3. stable-20150403.zip 4/15
4. Pharo-VM-mac-stable.zip one day earlier than #1

Latest: luckly things are a bit more straightforward here. Only Pharo-VM-mac-latest.zip and latest.zip, both with 4/9/2015, but not matching any of the dates from stable.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: SDL2 and fork

EstebanLM

> On 21 Apr 2015, at 13:22, Sean P. DeNigris <[hidden email]> wrote:
>
> EstebanLM wrote
>> stable vm is from march 25 so it will be no difference between stable and
>> latest right now
>
> In http://files.pharo.org/vm/pharo/mac/ :
>
> Stable:
> 1. stable.zip 9/2014
> 2. stable-20150325.zip 3/2015
> 3. stable-20150403.zip 4/15
> 4. Pharo-VM-mac-stable.zip one day earlier than #1

you are taking wrong folders :)
check at

/get-files/50
/get-files/40

that points to the “blessed” ones.
also… “stable” does not has sense anymore, they are there for backward compatibility. Now we use “stable-YYYYMMDD” format meaning we declared it stable that day… and then we point consolidated versions (/get-files/etc.) to the appropriate one.

Esteban

>
> Latest: luckly things are a bit more straightforward here. Only
> Pharo-VM-mac-latest.zip and latest.zip, both with 4/9/2015, but not matching
> any of the dates from stable.
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/SDL2-and-fork-tp4818623p4820798.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


12