dennis90
April 6th, 2009, 09:38 PM
Hi!
I am working on a simple 'solar system' simulator program in C++. It uses gtkmm for drawing the UI and I tried to use cairomm for drawing the celestial bodies and animate them but I found that this way it is laggy as hell.
Unfortunately I didn't found much documentation for this library and that's why I am asking for your help.
First I tried creating a separated thread that calculates forces and redraws the objects but the app crashed when the thread tried to draw on the context. (Why?) Then I connected the drawing function to Glib::signal_idle(). That way redrawing was OK but it was laggy.
Now I don't really know what to do. To tell the truth I really like cairomm and I would like to use object oriented APIs now. So I ask if you know a solution either by finding an other library or giving me some hints on correcting this code.
Thanks
I am working on a simple 'solar system' simulator program in C++. It uses gtkmm for drawing the UI and I tried to use cairomm for drawing the celestial bodies and animate them but I found that this way it is laggy as hell.
Unfortunately I didn't found much documentation for this library and that's why I am asking for your help.
First I tried creating a separated thread that calculates forces and redraws the objects but the app crashed when the thread tried to draw on the context. (Why?) Then I connected the drawing function to Glib::signal_idle(). That way redrawing was OK but it was laggy.
Now I don't really know what to do. To tell the truth I really like cairomm and I would like to use object oriented APIs now. So I ask if you know a solution either by finding an other library or giving me some hints on correcting this code.
Thanks