stephene@sjsoft.com wrote:
I am designing a graph drawing application using wxPython. Currently I am
using wxDC to draw on a wxPanel. Are there any advantages to using OpenGL
on a wxGLCanvas to doing simple 2d drawing?
There can be advantages, but they're fairly trivial if you've already finished the project with the other engine and it isn't actually causing a problem.
Basically, OpenGL can let you draw very large arrays of points/lines/boxes in hardware (as distinct from merely at the C level) from a single NumPy array with cheap transform/clipping operations. It also supports cheap alpha-compositing and a few other things not likely of that much interest for simpler graphs. It's text-handling support is comparatively primitive. If you don't actually know OpenGL already, it is a fairly involved learning curve compared to simply drawing with a wxDC, and it introduces a fairly significant dependency into your app.
So, if you're trying to visualise truly huge data-sets, it might be useful to go with raw OpenGL, but that's the only serious use-case I can come up with for using it directly for this kind of work (normally you'd try to find an intermediate library that handles all the graph-layout work and use that). Chaco (from SciPy), I believe, does a lot of the work of simple graphing for you already, using Tk, wxDC or OpenGL interchangeably, so it would likely be a good option.
Good luck,
Mike
ยทยทยท
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/