You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be misunderstanding something but AFAICT judging by the source, gl/as-gl-buffer-spec can accept not only :fixed-color (which works) but also :colors.
Given this line, it seems that :colors are supposed to be a collection of collections, so I guess RGB or RGBA vectors.
However, trying to do that fails due to how fill-vertex-buffer is implemented for vectors - it expects for each element of the vector to be something that implements IIntoBuffer, and numbers don't implement that.
I see that the comment above the common-attrib-buffer-specs function mentions that :colors isn't expected to work.
However, I was able to make it work (at least, in CLJS) with this:
(extend-protocol streams/IIntoBuffer
number
(into-float-buffer
[x dest _stride idx]
[(aset dest idx x)]
(unchecked-add-int idx 1)))
I might be misunderstanding something but AFAICT judging by the source,
gl/as-gl-buffer-spec
can accept not only:fixed-color
(which works) but also:colors
.Given this line, it seems that
:colors
are supposed to be a collection of collections, so I guess RGB or RGBA vectors.However, trying to do that fails due to how
fill-vertex-buffer
is implemented for vectors - it expects for each element of the vector to be something that implementsIIntoBuffer
, and numbers don't implement that.I see that the comment above the
common-attrib-buffer-specs
function mentions that:colors
isn't expected to work.However, I was able to make it work (at least, in CLJS) with this:
This is a complete working example:
The text was updated successfully, but these errors were encountered: