Squeak SDL (was: Re: Games with Squeak)

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

Squeak SDL (was: Re: Games with Squeak)

Mikael Kindborg-2
Hi Diego,

On 11/6/06, Diego Fernandez <[hidden email]> wrote:

>
> I've created a project in SqueakSource, with public Read&Write
> permissions, so we can share our "experiments" there:
>
> MCHttpRepository
>         location: 'http://www.squeaksource.com/GameDevTools'
>         user: ''
>         password: ''
>
> There you can get the pre-pre-pre-alpha version of the SDL bindings.
> They doesn't do anything useful yet, only Init, SetVideoMode and
> LoadBMP.
> I'm doing this in my spare time, so the advances are really slow, so
> if you want to help we can learn more about FFI, SDL Surfaces et. al.
> together :)

I have experimented a little with your SDL bindings and you have made
a very good foundation. I will learn FFI and help add more functions.
Did a very small example which I uploaded to the repository, it opens
a window and displays a BMP-file (stole code from the tests). I tried
to position the bitmap with a SDLRect but got a coercion error I did
not understand. Will be away over the weekend, will look at this more
next week hopefully, this is great fun!

I am a bit concerned about how event input should be handled. Since
SDL now runs in its own window, SDL events have to be handled.
wxSqueak has a special virtual machine as I understand it, would be
good if this could be avoided with SDL. From my point of view, a good
solution would be to make SDL render inside a Squeak window, and use
standard Squeak input handling. Like how OpenGL is used in Croquet
(guess it works this way). Browsed the SDL-docs quickly but did not
find any functions for making SDL render into an application supplied
window, but even if this is not supported, it should not be that hard
to add. What are your thoughts about this Diego?

With the surface plugin it should be possible to render graphics from
Squeak onto SDL surfaces, the example Andreas put on SVN should be a
good starting point:

http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins/ExampleSurfacePlugin/

I look forward to do some C programming! Has been 10 years now since I
did something serious in C.

Best, Micke

Reply | Threaded
Open this post in threaded view
|

Re: Squeak SDL (was: Re: Games with Squeak)

Mikael Kindborg-2
On 11/9/06, Mikael Kindborg <[hidden email]> wrote:

>
> I am a bit concerned about how event input should be handled. Since
> SDL now runs in its own window, SDL events have to be handled.
> wxSqueak has a special virtual machine as I understand it, would be
> good if this could be avoided with SDL. From my point of view, a good
> solution would be to make SDL render inside a Squeak window, and use
> standard Squeak input handling. Like how OpenGL is used in Croquet
> (guess it works this way). Browsed the SDL-docs quickly but did not
> find any functions for making SDL render into an application supplied
> window, but even if this is not supported, it should not be that hard
> to add. What are your thoughts about this Diego?
>

Thought a bit more about this, and it should be possible to use e.g.
SDL_PollEvent to read SDL events from Squeak. Then no need to modfy
the VM.

Still, rendering to a Squeak window would be nice. Problem I guess is
that SDL abstracts away the window system, so this might take some
work to do, and possibly be platform dependent.

Best, Micke