nodebox / nodebox-opengl

Free, cross-platform library for generating 2D animations with Python programming code.
http://www.cityinabottle.org/nodebox/
BSD 3-Clause "New" or "Revised" License
168 stars 29 forks source link

rect was pretty slow #2

Closed jsundram closed 11 years ago

jsundram commented 11 years ago

Using GL_POLYGON was a lot slower than glRectf for 2 reasons:

  1. GL_POLYGON isn't purpose-built for rectangles
  2. There's a lot fewer function calls just using glRectf.

Similarly, I believe that line should use GL_LINES and triangle() should use GL_TRIANGLES, although these changes wouldn't get the benefit of 2).

I didn't make those changes because I haven't had time to test them yet.

fdb commented 11 years ago

Looks good. Thanks for the change!