GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  INSTALL_JOYSTICK (3)

NAME

install_joystick - Initialises the joystick. Allegro game programming library.

CONTENTS

Synopsis
Description
See Also

SYNOPSIS

#include <allegro.h>

int install_joystick(int type);

DESCRIPTION

Installs Allegro’s joystick handler, and calibrates the centre position values. The type parameter should usually be JOY_TYPE_AUTODETECT, or see the platform specific documentation for a list of the available drivers. You must call this routine before using any other joystick functions, and you should make sure that all joysticks are in the middle position at the time. Example:

   textout_centre_ex(screen, font,
                     "Center the joystick and press a key",
                     SCREEN_W/2, SCREEN_H/2, red_color, -1);
   readkey();
   if (install_joystick(JOY_TYPE_AUTODETECT) != 0)
      abort_on_error("Error initialising joystick!");

RETURN VALUE

Returns zero on success. As soon as you have installed the joystick module, you will be able to read the button state and digital (on/off toggle) direction information, which may be enough for some games. If you want to get full analogue input, though, you need to use the calibrate_joystick() functions to measure the exact range of the inputs: see below.

SEE ALSO

remove_joystick(3), num_joysticks(3), load_joystick_data(3), calibrate_joystick(3), calibrate_joystick_name(3), poll_joystick(3), exjoy(3)
Search for    or go to Top of page |  Section 3 |  Main Index


Allegro INSTALL_JOYSTICK (3) version 4.4.2

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.