Hello,
I have two small questions:
- I pushed a patch that implements a trivial WITH-PUSHED-MATRIX macro. Would WITH-MATRIX be a better name though?
- Shouldn't the arguments to gl:clear have the "-bit" end stripped out? Since we're hiding the fact that they are bitmasks anyway...
On 07.02.2006, at 02:25, Luís Oliveira wrote:
- I pushed a patch that implements a trivial WITH-PUSHED-MATRIX
macro. Would WITH-MATRIX be a better name though?
No, I think WITH-PUSHED-MATRIX is fine as is.
- Shouldn't the arguments to gl:clear have the "-bit" end stripped
out? Since we're hiding the fact that they are bitmasks anyway...
I have also thought about that one, but decided against it because I didn't want to deviate too much from the specification. Introducing semi-arbitrary naming changes looked like too much of a headache to me: if we strip off the -bit, should we also strip off the -hint in HINT-TARGET? Should the redundant light-model- or pixel-map- prefix go? If not, why snip off -bit? If yes, it needs to be written down somewhere.
It's hard to stay consistent and obvious to the user. Personally, I wouldn't like to have to look into the documentation to see how some names get translated from the spec/C-side to Lisp. YMMV.
On 2006-feb-08, at 11:54, Oliver Markovic wrote:
It's hard to stay consistent and obvious to the user. Personally, I wouldn't like to have to look into the documentation to see how some names get translated from the spec/C-side to Lisp. YMMV.
Yes, of course. I completely agree with you. What about having the enum provide both :color-buffer and :color-buffer-bit?
BTW, more minor style stuff. I think maybe we should have both with- primitives and with-primitive as synonyms. While (with- primitives :lines ...) makes total sense, (with- primitives :polygon ...) looks very weird to me.
Sorry for the long delay in answering; I was on vacation over the past few days.
On 08.02.2006, at 17:51, Luís Oliveira wrote:
Yes, of course. I completely agree with you. What about having the enum provide both :color-buffer and :color-buffer-bit?
I think this would be a good compromise.
BTW, more minor style stuff. I think maybe we should have both with-primitives and with-primitive as synonyms. While (with- primitives :lines ...) makes total sense, (with-primitives :polygon ...) looks very weird to me.
This is true, and it makes me doubt that WITH-PRIMITIVE(S) is such a good name after all. It's always called "glBegin/glEnd" in OpenGL literature, but WITH-BEGIN-END-BLOCK sounds weird to me.
Hi all,
Oliver Markovic wrote: [..]
On 08.02.2006, at 17:51, Luís Oliveira wrote:
BTW, more minor style stuff. I think maybe we should have both with-primitives and with-primitive as synonyms. While (with-primitives :lines ...) makes total sense, (with-primitives :polygon ...) looks very weird to me.
This is true, and it makes me doubt that WITH-PRIMITIVE(S) is such a good name after all. It's always called "glBegin/glEnd" in OpenGL literature, but WITH-BEGIN-END-BLOCK sounds weird to me.
It's always the same trade off: try to create a closer to lisp API vs. not getting to far away from the original one so the new API is easy to understand.
The guys at pyopengl did a mirror of OpenGL. I don't know what should you do in lisp-gl, but for my graphical library I decided to diverge from the SDL lib. I'm sure someone will do an exact translation from SDL*.h with SWIG (or even manually)
My idea is a library that can be used the following way:
(init :init-video)
(with-open-window (s "Hi, my window name is this" '(640 480) :doublebuf) (loop for i from 1 to 480 do (draw-point s i i (random (expt 2 24)))) (update s) (event-loop SDL_WaitEvent event (SDL_QUIT (quit))))
I'm not interested in mimicking how the API works in C. If someone plans to work in lisp in a C way he can do it with the SWIG generated file.
Some time in the future, when the low level SDL-cffi lisp file is stable I will base my library on top of it.
Regards, rogersm.
On 20.02.2006, at 23:04, Roger Sen Montero wrote:
It's always the same trade off: try to create a closer to lisp API vs. not getting to far away from the original one so the new API is easy to understand.
The goal is having an OpenGL binding in Lisp, which doesn't require people to think about C-ish things like having to pass pointers to arrays in order to get the current color.
The guys at pyopengl did a mirror of OpenGL. I don't know what should you do in lisp-gl, but for my graphical library I decided to diverge from the SDL lib.
We don't really diverge and try to keep the mapping between the C and Lisp names obvious. The macro in question is pure sugar and doesn't have a C equivalent.
(defun draw-foo () (gl:with-primitives :quads (gl:color 1 0 0) (gl:vertex -1 -1 ) ... (gl:vertex 1 1)))
instead of
(defun draw-foo () (gl:begin :quads) (gl:color 1 0 0) (gl:vertex -1 -1) ... (gl:vertex 1 1) (gl:end))
cl-opengl-devel@common-lisp.net