[Openmcl-devel] opengl macptr advice please
Arthur Cater
arthur.cater at ucd.ie
Wed Mar 15 12:04:01 PDT 2017
Hello,
I’ve gathered my Mac’s Open GL does not support glLineWidth > 1, but I don’t
understand what I need to do to use #_glGetFloatv to find out from gl info such as this.
I’d like to learn.
On finding I needed a MACPTR (rather than a raw lisp vector) I tried
(gui::execute-in-gui #'(lambda nil
(let ((v (make-array 2 :initial-element 0.0 :element-type 'single-float)))
(with-macptrs (v2 v) (#_glGetFloatv #$GL_ALIASED_LINE_WIDTH_RANGE v2))
v)))
but that gives a kernel error (10) through AltConsole.
I also tried
(gui::execute-in-gui #'(lambda nil
(let ((v (make-array 2 :initial-element 0.0 :element-type 'single-float)))
(ccl::%stack-block ((v2 8))
(#_glGetFloatv #$GL_ALIASED_LINE_WIDTH_RANGE v2)
(ccl::%copy-ptr-to-ivector v2 0 v 0 8))
v)))
which gave #(0.0, 0.0) — i.e. no change to v, where I’d hope for #(1.0, 1.0)
And I tried
(gui::execute-in-gui #'(lambda nil
(let ((v (make-array 2 :initial-element 130.0 :element-type 'single-float)))
(ccl::%stack-block ((v2 8))
(ccl::%copy-ivector-to-ptr v 0 v2 0 8)
(#_glGetFloatv #$GL_ALIASED_LINE_WIDTH_RANGE v2)
(ccl::%get-single-float v2 4)))))
which gave 130.0 (showing I think that the stack-allocated array is unchanged)
Google is my friend, but just laughs at my pathetic attempts to find out how to do this.
It may be clear by now that I don’t know much about macptrs and ivectors, I would
appreciate help.
Arthur
More information about the Openmcl-devel
mailing list