Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 3 - InputSprocket / InputSprocket Reference
Data Structures


Need Structure

During initialization the game fills out a need structure for each input requirement. The need structure describes the type of data that will satisfy the input requirement and also gives information you can use in a user interface during configuration. The need structure is defined by the ISpNeed data type.

typedef struct ISpNeed {
   Str63          name;
   short          iconSuiteResourceId;
   ISpElementKind theKind;
   ISpElementLabel theLabel;
   UInt32         flags;
   UInt32         reserved1;
   UInt32         reserved2;
   UInt32         reserved3;
} ISpNeed;
Field Description
name
A human readable string that can be used during configuration to describe the input requirement to the user.
iconSuiteResourceId
A resource ID of an icon suite residing in the games resource fork. This is the same resource ID you would pass to the GetIconSuite function if you wanted to load the icon yourself. The icon is a picture representing the input requirement.
theKind
The kind of element that will produce the data the game requires. This can be a standard element kind--for example, kISpElementKind_Button--or an extended virtual kind. The only extended kind that exists currently is the movement kind, which consists of an x-y axis pair and a direction, where both are based on the same data and the game uses whichever is appropriate.
theLabel
A standard element label representing what you are going to use the data for.
flags
You should OR in kISpNeedFlag_NoMultiConfig if you would prefer that only one device bind to the need during autoconfiguration. Otherwise, several devices may agree to meet the same input requirement.
reserved1
Reserved. Always set this field to 0.
reserved2
Reserved. Always set this field to 0.
reserved3
Reserved. Always set this field to 0.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996