Results 1 to 5 of 5

Thread: Problem finding a good 2D graphics library for animations (tried cairomm)

  1. #1
    Join Date
    Feb 2009
    Location
    Szeged, Hungary
    Beans
    13
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Problem finding a good 2D graphics library for animations (tried cairomm)

    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

  2. #2

    Re: Problem finding a good 2D graphics library for animations (tried cairomm)

    If you just want to draw graphcs to a window you could try Quad-Ren (see sig, resolution independent, object oriented, WIP) or SDL (software based(slow), resolution dependent without external libs). Otherwise look into OpenGL.
    Last edited by hessiess; April 6th, 2009 at 10:44 PM.
    im dyslexic, please don't comment on my spelling
    blender 3d artist, visit my portfolio
    Quad-Ren, Open source, resolution independent 2D graphics engine
    Screen space is a precious resource, don't waste it

  3. #3
    Join Date
    Feb 2009
    Location
    Somewhere in Quebec
    Beans
    50
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Problem finding a good 2D graphics library for animations (tried cairomm)

    For drawing graphics, I suggest Simple Directmedia Layer. The API is very low-level but works fine.

    Another alternative would be to use Macromedia Flash. Flash uses it's own Actionscript language and allows to make Vector drawing. It's not compilable, it needs Macromedia Flash installed, but it's very intuitive.

    Best Regards!
    "Sometimes love isn't about how much someone suits you, but how much you're willing to change to suit them"
    99% of bugs in Linux are right between the keyboard and the chair you're currently sitting in!

  4. #4
    Join Date
    Jun 2006
    Beans
    596
    Distro
    Kubuntu

    Re: Problem finding a good 2D graphics library for animations (tried cairomm)


  5. #5
    Join Date
    Feb 2009
    Location
    Szeged, Hungary
    Beans
    13
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem finding a good 2D graphics library for animations (tried cairomm)

    Thank you for your answers!

    I will take my time and choose the best. I already took a look at those which you've mentioned. KGLengine seems to be really sympathic but it's qt based, isn't it? And I somehow I don't wanna mix qt and gtk stuff.

    By the way how do for example animations in cairo-dock run so smooth? I couldn't find any tutorials about it. And I changed my opinion, I would accept pure cairo in c as well because it has so many features and clean code. (If I found a good tutorial I would definitely stick to cairo.)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •