spIntro.3p 3.02 KB
.TH spIntro 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
sp, spIntro \- Introduction to Sprite Manipulation Functions
.SH SYNOPSIS
.nf
\f3
.Op c
#include <sp.h>
.sp .8v
void spInit( Gfx \(**glistp );
void spFinish( Gfx \(**glistp );
void spMove( Sprite \(**sp, s32 xpos, s32 ypos );
void spScale( Sprite \(**sp, f32 xscale, f32 yscale );
void spFlip( Sprite \(**sp, u32 fliph, u32 flipv );
void spSetZ( Sprite \(**sp, s32 z );
void spColor( Sprite \(**sp, u8 red, u8 green, u8 blue, u8 alpha );
void spSetAttribute( Sprite \(**sp, u32 attributes );
void spClearAttribute( Sprite \(**sp, u32 attributes );
void spScissor( u32 xmin, u32 xmax, u32 ymin, u32 ymax );
Gfx \(**spDraw( Sprite \(**sp );
.sp .8v
.Op
\f1
.fi
.SH DESCRIPTION
.B sp.h
contains data structure type definitions, symbolic attribute names,
and function prototypes.  The data structures used by the sprite library
are described in detail in the Sprites chapter of the Developers Guide.
Attributes are listed and described in the
.B spSetAttribute
and 
.B spClearAttribute
man pages and where appropriate in other pages.
.PP
.B spInit
is called at the beginning of sprite drawing. Some GBI display 
list commands are added to the specified
.I glistp
to get the RCP into the correct mode for sprite rendering.
This sets default texturing modes.
.PP
.B spFinish
is called at the end of sprite drawing. Some GBI display list 
commands are added to the specified 
.I glistp
to get the RCP to complete all 
pending drawing operations and reset the RCP to its regular state.  It also 
tacks on a 
.B gEndDisplayList().
.PP
.B spMove
sets the screen position of the upper left-hand corner of the sprite.
.PP
.B spScale
sets the resizing amount for this sprite. Scales may be less than 1.0 to 
produce a smaller image, or greater than one to create an expanded image.
.PP
.B spFlip
controls the orientation of the sprite. Details to be worked out.
(NOT CURRENTLY USED!!!)
.PP
.B spSetZ
sets the zbuffer depth of the sprite.  This may cause the sprite to be obscured 
by previously drawn sprites that were drawn with a smaller value of Z.
(NOT CURRENTLY USED!!!)
.PP
.B spColor
sets the color of the sprite.  Based on how the sprite is to be drawn, this could 
be either the PRIMITIVE_COLOR or the FILL_COLOR.
.PP
.B spSetAttribute
sets the indicated attributes.
.I attributes
can be the bit-wise OR of many attributes.
.PP
.B spClearAttribute
clears the indicated attributes.
.I attributes
can be the bit-wise OR of many attributes.
.PP
.B spScissor
bounds the region in which sprites will be drawn.  Tiles of sprites which lie
entirely outside this region are not added to the output display list.  Tiles
which cross the boundry are appropriately clipped.
.PP
.B spDraw
constructs a display list starting at 
.I sp->next_dl
that will draw the sprite into the frame buffer in the indicated way.
This display list is terminated with an 
.B gEndDispalyList()
entry and the
.I sp->next_dl
entry is updated to point to one entry past this.
The pointer to the start of this display list is returned.
.SH "SEE ALSO"
.IR mksprite (1P)