Next step in SDL backend

Pupeno pupeno at pupeno.com
Wed Oct 20 22:36:52 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello people,
I'm looking for advice, specially concrete advice [1] on what to do next on 
developing the SDL backend.
What I've done so far:
1) I created a set of C functions that match almost one to one with SDL_gfx 
[2], only some minor difference that will get bigger when I reached 
parameters that can be passed as SmallInteger. But only that is going to be 
performed: checks, conversions, etc. This is composed of sdl.c and sdl.h
2) I created a set of pidgin functions in the file named sdl.slate. They match 
almost one to one with the C founctions I created. So far, they dispatched 
the first object as SDLTraits, this may not be right anymore.
3) I created a set of (real) Slate functions as ui/SDL/port.slate to be the 
real interface for the rest of the thing. This set of functions also match 
one to one with the ones in sdl.slate, BUT using more complex objects where 
necesary: like Color, Point, etc, etc [3].
Unfortunatly, what I've done doesn't scale too well. To draw a triangle you 
have to pass three set of coordinates and one color, it's too much. So, I 
need to improve. Mainly what I need to improve is on ui/SDL/port.slate. The 
rest is a nightmare, but that's the porpoise of it, to be a nightmare 
encapsulated by port.slate. I need to create a namespace to avoid 
conflictiong (with X11 backend for example). And some other things.
To acomplish this I'm reading x11.lisp from the old Slate 0.2.1 [4] but I'm 
not sure of some things:
So, I have SDL as a namsepace. What should I dispatch the first argument of 
the pidgin founctions ? SDLPortTraits (SDL Port traits) ? Then, should I in 
ui/SDL/port.slate create SDL Port or something like that ? 
In x11.lisp, almost at the begining I've found this:
(define-xtraits "Display")
(define-xtraits "Screen")
(define-xtraits "Drawable")
(define-xtraits "Window" "Drawable")
(define-xtraits "Pixmap" "Drawable")
(define-xtraits "Cursor")
(define-xtraits "Color")
(define-xtraits "Context")
Brian told me that that define prototypes called Display, Screen, etc, etc.
In SDL I have the concept of surface:
1) whenever I draw, I draw over a surface
2) when I initialize video, I get a surface that is of the size that I 
specified covering the whole window/screen (depending if you are in x11 or 
any other place).
3) at any time I can create another surface, afaik, of any size.
I tell you this so you have an idea of what I'm dealing with. Should Screen be 
the first-whole-screen surface ? and the other surfaces ? windows ?

I'm attaching to this mail, a file named sdl.tar.bz2, containg all the new 
files I've made for implementing SDL and a patch for the existing files.
- -- 
Pupeno: pupeno at pupeno.com - http://www.pupeno.com

[1] Seems I'm very new to Slate, or Smalltalk/Self/Lisp-derived languages. My 
experience is reduced to C++ and Qt/KDE.

[2] http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/

[3] That reduces the HUGE number of parameters the original functions has to 
something more manegable.

[4] As per Brian's advice.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBd0r3fW48a9PWGkURAmWTAJwNn+Z5cJEm94Q4o/C3J8l0c2Lx/wCfW/wY
nv51RyPRhe1EAnW5rAd7Wwg=
=UvMh
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdl.tar.bz2
Type: application/x-tbz
Size: 3436 bytes
Desc: not available
Url : /archives/slate/attachments/20041021/77df9799/sdl.tar.bin


More information about the Slate mailing list