Painter

Hi everyone,
I would like to draw a sphere in the molecule render area of avogadro. I simply tried to test this command:

gl->painter()->drawSphere(center,13.0);

where gl is my GLWidget, but I received: GLPainter not active. Is there something I don’t understand? Thanks guys,

Marc

On Fri, Mar 1, 2013 at 1:31 PM, Marc-André Dubois ma.dubois@me.com wrote:

Hi everyone,
I would like to draw a sphere in the molecule render area
of avogadro. I simply tried to test this command:

gl->painter()->drawSphere(center,13.0);

where gl is my GLWidget, but I received: GLPainter not active. Is there
something I don’t understand? Thanks guys,

You must make these calls when the GL context is valid. The easiest
way is to write an Engine and do it in one of the virtual render calls
in the method. See the Van der Waals plugin for example. This ensures
the render call happens at the appropriate moment when the GL context
is current.

Marcus