TQ3ChannelGetMethod
You can define a function that QuickDraw 3D calls to get a channel of a controller.
typedef TQ3Status (*TQ3ChannelGetMethod) ( TQ3ControllerRef controllerRef, unsigned long channel, void *data, unsigned long *dataSize);
controllerRef
- A reference to a controller.
channel
- An index into the list of channels associated with the specified controller. This value is always greater than or equal to 0 and less than the channel count specified at the time
Q3Controller_New
was called.data
- On entry, a pointer to a buffer. You should put the current value of the specified controller channel into this buffer.
dataSize
- On exit, the number of bytes of data written to the specified buffer.
DESCRIPTION
YourTQ3ChannelGetMethod
function should return, in the buffer pointed to by thedata
parameter, the current value of the controller channel specified by thecontrollerRef
andchannel
parameters. Your function should also return, in thedataSize
parameter, the size of that data. QuickDraw 3D allocates memory for the data buffer before it calls your function and deallocates the memory after your function has returned. The maximum number of bytes that the data buffer can hold is defined by a constant:
#define kQ3ControllerSetChannelMaxDataSize 256SPECIAL CONSIDERATIONS
You need to define a channel-getting method only if you are writing a device driver for a controller. You can, however, callQ3Controller_GetChannel
at any time to invoke a controller's channel-getting method.RESULT CODES
Your channel-getting method should returnkQ3Success
if it is able to return the requested information andkQ3Failure
otherwise.SEE ALSO
See the description ofQ3Controller_GetChannel
on page 18-18 for information on getting a controller's channels.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help