On Thu, Dec 28, 2017 at 4:39 PM, Hilaire <[email protected]> wrote:

> What is the reason using Cairo over SDSL? Is not SDL just enought?


My understanding is that SDL provides the surface to draw on as part of the
window, but not a 2D vector graphic engine on top. You've got only draw
Line/Rect/pixel functions in SDL. To render a svg/png/jpeg that you want
for games on the SDL surface, the normal way is to use a third party
library such as Cairo.

For 3D I believe people use SDL combined with open GL or direct3D instead
of Cairo but I don't know the details.

For events (keyboard, mouse, joypad) I use SDL event management and it
works differently on each OS. I wrote in the readMe the different set-ups
to make it work on each OS. On Windows and Linux I can use the latest
Pharo. On Mac I use old Pharo 5 images.

I guess it's possible to use SDL for audio, but it seems there is no code
relative to audio in the SDL binding and in OSWindow in Pharo. That's why I
did not go that way. I tried multiple things but I successfully run audio
code in Pharo only with the openAL binding and .wav file (and even in this
case, I had to install external librairies in Mac OS...).

Whichever if Cairo stays around or not does not really matter, normally one
uses Cairo through Athens or Sparta, abstraction layers on top of 2D
graphic engines. I've worked with other 2D engines and the API are always
almost the same, so I have no doubt that if Cairo support is dropped we can
re-bind Athens/Sparta with another 2D engine (such as engines used by web
browsers).


>
> Hilaire
>
>
> Le 25/12/2017 à 19:32, Clément Bera a écrit :
>
>>
>> https://github.com/clementbera/wizard-battle-arena
>>
>> https://github.com/clementbera/SpiderInvasion
>>
>> Audio has always been a problem to me. I successfully run audio files
>> with the open AL binding, but I failed to do so cross-platform. Already
>> key-bindings coherent cross platform is difficult.
>>
>>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


-- 
Clément Béra
Pharo consortium engineer
https://clementbera.wordpress.com/
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq

Reply via email to