These are chat archives for fourthbit/spheres

28th
Sep 2015
ovenpasta
@ovenpasta
Sep 28 2015 09:42
great, actually there is no way to allocate a C struct from gambit? and get a pointer to it?
About SDL2, I'll check the sld file
Álvaro Castro-Castilla
@alvatar
Sep 28 2015 10:34
Yes there is a way to allocate structs, SDL examples do that.
You can check the spheres-project repository, I think it contains this code although it needs update for compiling since the newest changes in spheres last months.
It would be great if you document all this stuff you find out about spheres! I really can't do everything alone :)
I would suggest editing spheres-guides project. They need some update. I can then update the spheres site and keep the info there linked so it is in sync
I bet there are many things in spheres that are unnoticed because I didn't find the time to document them
Overall spheres is a thin layer over gambit, but provides simplicity without any loss in control. That's its main difference with lambdanative
Álvaro Castro-Castilla
@alvatar
Sep 28 2015 10:39
And it is designed to be compatible with other spheres if desired (r7rs)
ovenpasta
@ovenpasta
Sep 28 2015 11:55
found it, should be alloc-SDL_Rect
and also there should be *->SDL_Rect
ovenpasta
@ovenpasta
Sep 28 2015 12:52
added some very basic test for SDL2 :) I need to finish the sld exports stuff. there isn't any automatic way to do this? by example there are all the macro generated accessors to c-define-struct
also there was some missing constant from sdl2.scm related to mouse button events
ovenpasta
@ovenpasta
Sep 28 2015 14:16
I could help with documentation. should be nice to have some.
markdown can be nice, also texinfo maybe
a quick hack could be doxygen also
we only need to write the filter
ovenpasta
@ovenpasta
Sep 28 2015 14:37
also can be very nice to add some function to do this: (SDL_Rect-set! x: 0 y: 0 w: 10 h: 10) instead of calling SDL_Rect-*-set! 4 times
Maybe I'll try to write some macro in ffi module
Álvaro Castro-Castilla
@alvatar
Sep 28 2015 21:21
In the guides there is an explanation of the documentation system used for spheres. It is simple, but that way it prevents from growing too complicated.
Same thing with the macro for multiple fields. While one per field is flexible, although not optimal, it allows to prototype everything. Adding more default functions will also make the code fatter. I think the best solution is to leave that as a user optimization, so if you want you can either do it as a macro, as a procedure or in C with a binding.
ovenpasta
@ovenpasta
Sep 28 2015 21:45
does it make sense to bundle the sdl2 source code?
Álvaro Castro-Castilla
@alvatar
Sep 28 2015 22:13
I've done that in the past, but since different OSes use different methods to install it, I decided to just make clear the version/s it supports. The idea is to support one version well and not try to cover all cases. Going down that road leads to a lot of complexity that cannot be dealt by such a tiny community