Drawing images. - Motif

This is a discussion on Drawing images. - Motif ; Hi, Does anybody know if it possible for a motif program to load in a small png image and display it over a background scene. The image should then animate across the background (like a missile in a game for ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Drawing images.

  1. Drawing images.

    Hi,

    Does anybody know if it possible for a motif program to load in a
    small png image and display it over a background scene. The image
    should then animate across the background (like a missile in a game
    for example) , but the background must never change. The point here
    is that I do not want the program to have to re-paint the whole scene
    whenever the screen is refreshed - so I guess I would need to have
    access to video memory.

    Does anybody know how I would accomplish this? I am new to motif
    programming by the way.

    Any help appreciated.

    Sally

  2. Re: Drawing images.

    Sally wrote:

    > Does anybody know if it possible for a motif program to load in a
    > small png image and display it over a background scene. The image
    > should then animate across the background (like a missile in a game
    > for example) , but the background must never change. The point here
    > is that I do not want the program to have to re-paint the whole scene
    > whenever the screen is refreshed - so I guess I would need to have
    > access to video memory.
    >
    > Does anybody know how I would accomplish this? I am new to motif
    > programming by the way.


    Yes, it is most definitely possible (I've done it, as have many others). But
    if you're new to Motif (and Xlib, I assume), it's not the most trivial of
    tasks to start with. And the preferred solution would depend on several
    things:

    o Are you familiar with any other graphics toolkit (OpenGL, GDK, SDL, ...)?
    (Motif doesn't have any graphics drawing functions, you must use the
    underlying Xlib functionality, or an external toolkit.)

    o Are you writing this program from scratch, or does e.g. the "background
    scene" already exist in the code? (Limits your choices substantially.)

    o What is the "background scene"? A single colour, another image, or something
    that contains a lot of graphics that also changes? (Important for use of
    double-buffering, etc.)

    o Is the image a simple rectangle, without transparent pixels? (Makes it a lot
    simpler to copy it onto the background.)

    o Do you plan to add other graphical features to this program at a later
    stage? (While the exact problem you specify might fairly easily be solved with
    Xlib, a lot of more complex problems aren't.)

    --
    Per Espen Hagen, Principal Scientist
    Norwegian Defence Research Establishment, Maritime Systems Division

+ Reply to Thread