Hi,

I'm trying to use lispbuilder with cl-opengl. Specifically, I'm trying to
convert a texture example from C++ into lisp [1].

I ran into a little trouble when the example got the pixels from the
surface:

surface->pixels

What I eventually got working in lisp is:

(sdl-base::with-pixels (pixels (sdl:fp surface))
  (sdl-base::pixel-data pixels))

Which seems to work ok. (But I'd still like confirmation that this is the
best way to do it. It seems like too much code to do something so simple.)


My second question is about how to free the texture after I'm done. I know
this isn't really an SDL thing, but I figured you dealt with this when you
created lisp wrappers around SDL surfaces.

My intuition would be to create a finalizer for the wrapper, and free the
texture then. But according to trivial-garbage [2], in some lisps it isn't
safe to use an object when the finalizer is called. (Or does CFFI do this
automatically for me?)


Thanks. Any advice would be appreciated.

[1] http://anomtech.uuuq.com/glTextures.php
[2] http://www.cliki.net/trivial-garbage

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
_______________________________________________
application-builder mailing list
application-builder@lispniks.com
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to