I've been teaching myself opengl recently, and I've hit a wall, which
is what to do with bottlenecks, or let alone, figure out what is
causing them.

I wrote a short program (based off of the pyglet "hene" port of the
nehe lesson1 base case) to illustrate what is vexing me, or atleast as
best as I can pin it down;


I have a function called "call", which is called from the on_draw
event of the window, and the function contains the following code:

def call(self):
        if not self.__compiled:
            glNewList(self.__dl, GL_COMPILE)


            r = 5
            ci = 0
            span = range(r*-4, (r*4)+1, 4)
            for x in span:
                for y in span:
                    draw_cube(x, 0, y, ci)
                    ci +=1
                    if ci > 1:
                        ci = 0
            glEndList()
            self.__compiled = True

        glCallList(self.__dl)


the "draw_cube" function just calls a glBegin(GL_QUADS), 24
glVertex3f's, and the glEnd()




When I run this program with just the basecode (eg, I have the call
function commented out),
the thing can do well over 60 fps (spikes over 100, sporadically).

When I have the function in the code, the code plummets to an average
of 20fps.


What do I need to do to be able to draw more than a handful of
polygons without dramatic slowdowns???



ps: my gpu is an intel 945gm;  not exactly a powerhouse, but the code
has been tested on other machines with similar results.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to