Next: Drawn Object Appearance Up: Programmer's Reference for the Previous: Defining Lights

Drawing Objects

Various objects can be drawn into a window, with several parameters affecting how they will appear. The relevant functions are described here.


public  void  G_clear_window(
    Gwindow    window )

Clears the specified window to the background colour.


public  void  G_clear_viewport(
    Gwindow      window,
    Colour       colour )

Clears the specified viewport to the background colour.


public  void  G_update_window( Gwindow   window )

This function must be called after each scene is finished drawing, to make the images visible by flushing display buffers and swapping buffers (if in double buffer mode).


public  void  G_set_bitplanes(
    Gwindow          window,
    Bitplane_types   bitplanes )

Sets the current bitplanes destination, either NORMAL_PLANES or OVERLAY_PLANES, for drawing graphics objects.


public  void  G_draw_polygons(
    Gwindow         window,
    polygons_struct *polygons )
public  void  G_draw_quadmesh(
    Gwindow         window,
    quadmesh_struct *quadmesh )
public  void  G_draw_lines(
    Gwindow         window,
    lines_struct    *lines )
public  void  G_draw_text(
    Gwindow         window,
    text_struct     *text )
public  void  G_draw_marker(
    Gwindow         window,
    marker_struct   *marker )

Draws the specified object in the specified window, using the current 2D or 3D view.


public  void  G_draw_pixels(
    Gwindow         window,
    pixels_struct   *pixels )

Draws the specified rectangular block of pixels into the window. If the window is in colour map mode, the pixels must be of type COLOUR_INDEX_8BIT_PIXEL or COLOUR_INDEX_16BIT_PIXEL. Otherwise the pixels must be of type RGB_PIXEL.


public  void  G_read_pixels(
    Gwindow         window,
    int             x_min,
    int             x_max,
    int             y_min,
    int             y_max,
    Colour          pixels[] )

Reads the colours of the pixels in the front buffer, from the specified pixel range. The array pixels must have enough space for (x_max- x_min+ 1) * (y_max- y_min+ 1) Colours.


public  Real  G_get_text_length(
    char         str[],
    Font_types   text_font,
    Real         size )

Returns the length of the given string in terms of the number of pixels that would be used to display it in the given font size.


public  Real  G_get_text_height(
    Font_types   text_font,
    Real         size )

Returns the height of the given font in pixels.



Next: Drawn Object Appearance Up: Programmer's Reference for the Previous: Defining Lights


david@pet.mni.mcgill.ca
Fri Feb 17 15:39:43 EST 1995