hi all,

i tried to add (draw-line), since this function has been requested by some of us for a long time.
example:

(define (render)
        (draw-line (vector 0 0 0) (vector 2 1 0)))
(every-frame (render))

the changes are committed to git.

since it's a bit different from other immediate mode primitives, i am curious if it's implemented properly. it has two parameters for the two endpoints, so it cannot work as other static primitives do in Engine.cpp, because if we change the endpoint of one line it would change it for all lines if it was a static primitive. instead i'm creating a new RibbonPrimitive on each (draw-line) call and set a flag in the immediate mode primitive list that this primitive should be destroyed after each frame is drawn.

the other issue is that immediate mode primitives use the current state not the primitive state. since the RibbonPrimitive is solid by default i had to push a new state and set it directly to hint-wire.

does this sound the right way to do this? or does it awfully break the concept of immediate mode primitives? comments are welcome.

best,
gabor

Reply via email to