Ou, ok. Thought that suggestion was pointed at me.
I released the current source. Added new functions and changed the _begin() spline functions to use stacks and vectors. The speed seems identical, but the memory usage could be down. Also now it allows nesting. I added anti-aliasing function, which makes the splines look a lot better. Thou I have a decision on how to implement it. What I did for now is make curves totally independent from the rest of the system. So you can change color, alpha, aa, drawing mode etc. totally independent from other functions. And I am not sure if that is the best idea. For example, I could have aa code like this:void draw_set_antialiasing(bool enable, int qual) { if (enable==1){ glEnable(GL_LINE_SMOOTH); glHint(GL_LINE_SMOOTH_HINT, qual); }else{ glDisable(GL_LINE_SMOOTH); } } But that will enable aa for every primitive (circles etc.). I ended up doing this:pr_curve_aa = enable; pr_curve_aa_qual = qual; With having this in every drawing function (which of course can slow down the function): if (pr_curve_aa==1){ glEnable(GL_LINE_SMOOTH); glHint(GL_LINE_SMOOTH_HINT, pr_curve_aa_qual); }else{ glDisable(GL_LINE_SMOOTH); } Of course it is needed only once per function call, and compared to all the trig going on just to draw thous splines and curves, I think this doesn't impact the speed at all. It just seems wrong.. And testing speed is extremely hard because FPS jumps like crazy. I think that number is updated several times too much. Maybe it should be updated once per second or once per half a second. Maybe its normal like this, but I never seen it jump like that in GM.
|