Author Topic: Slow Class Programming  (Read 1851 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Slow Class Programming
« on: May 03, 2013, 06:49:21 AM »
Deleted
« Last Edit: April 25, 2015, 04:58:30 AM by Peter »

Charles Pegge

  • Guest
Re: Slow Class Programming
« Reply #1 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.

Charles Pegge

  • Guest
Re: Slow Class Programming
« Reply #2 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

Charles Pegge

  • Guest
Re: Slow Class Programming
« Reply #3 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