Oxygen Basic

Programming => Example Code => Topic started by: Peter on May 03, 2013, 06:49:21 AM

Title: Slow Class Programming
Post by: Peter on May 03, 2013, 06:49:21 AM
Deleted
Title: Re: Slow Class Programming
Post by: Charles Pegge on May 03, 2013, 07:03:53 AM
Hi Peter, 500 circles is a lot, but the class logic is not the major overhead. I would recommend glCompileing the circle geometry.
Title: Re: Slow Class Programming
Post by: Charles Pegge on May 04, 2013, 01:02:00 AM
Hi Peter,

Retrofitting classes is quite easy. So no need to think about classes from the start. My Population examples are a little complex because they are dynamic.

Particles don't really need OOP, but things like knobs,sliders, buttons and switches, when used together in a control panel, make it a necessity.

Charles
Title: Re: Slow Class Programming
Post by: Charles Pegge on May 04, 2013, 07:35:59 PM
I have not timed them, but if you use compiled triangle fans this will give you the best performance. The CPU only has to supply the position and color and then glCallList circ. The GPU does everything else.

circ=glGenLists 1
glNewList circ, GL_COMPILE
... make the circle
glEndList
...
glCallList circ
...


end of prog:
glDeleteLists circ,1

Charles