I tried implementing the using read-point to set the color-key of an image, and it didn't work for some reason. Here is the code I used:
(print (sdl:set-color-key (print (sdl:read-point (print (sdl:point :x (car color-key) :y (cadr color-key))) :surface display)) :surface display :rle-accel t)) I used the prints just to see what the return values of various parts of the expression were. Here was the output: #(0 0) #<LISPBUILDER-SDL:COLOR-A #x19FF14E9> #<FOREIGN-ADDRESS #x01014320> So sdl:read-point does seem to be returning a COLOR. But for some reason it doesn't seem to work with sdl:set-color-key. And one more question: is (0, 0) the top left or bottom left corner? (I think it is usually the top left for SDL... but I want to be sure.) Once again thanks for the help. On 10/9/07, Luke Crook <[EMAIL PROTECTED]> wrote: > > Elliott Slaughter <[EMAIL PROTECTED]> writes: > > > > > In(sdl-base::with-pixel (pixels (fp src-surface)) > > (multiple-value-bind (rbga r g b a) > > (sdl-base::read-pixel pixels x-index y-index) > > (push (sdl:color :r r :g g :b b :a a) > > list-of-pixels)))) > > > What is pixels? Also, isn't fp a foreign pointer? If so, do I need to > > provide it, or do I just provide a symbol to which > > a foreign pointer is bound? > > - src-surface, is the SURFACE object, e.g. returned by LOAD-IMAGE. > - (FP src-surface), returns the foreign pointer stored in the SURFACE > object > above. > - pixels, is any variable name that you come up with. WITH-PIXEL then > assigns > to this variable a structure that contains a bunch of low-level > information > about the surface; e.g. the foreign pointer to the raw pixel data, the > number > of bytes per pixel, the pixel format, the pitch. > > 'pixels' is there because read-pixel/write-pixel must have a target > surface as > it is possible to lock more than one surface at a time for access. > > > So to take advantage of the update to the source, I would need to > > install lispbuilder-sdl from SVN, right? I managed to copy the SVN files > > from the server using... > > I would just replace your version of lispbuilder-sdl/base/pixels.lisp with > the > one from SVN, then delete all the *.fasl or *.fsl files, and reload. > Should > work fine. > > >Do I need to compile anything? (I am currently using lispbuilder-sdl > binaries.) > > No, no need to recompile. This is done automatically when the files are > loaded > into the Lisp image. > > - Luke > > _______________________________________________ > application-builder mailing list > application-builder@lispniks.com > http://www.lispniks.com/mailman/listinfo/application-builder > -- Elliott Slaughter "Any road followed precisely to its end leads precisely nowhere." - Frank Herbert
_______________________________________________ application-builder mailing list application-builder@lispniks.com http://www.lispniks.com/mailman/listinfo/application-builder