The AROS Archives(anonymous IP: 54.167.95.51,115) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu


 Categories

   o Audio (57)
   o Datatype (13)
   o Demo (26)
   o Development (197)
   o Document (18)
   o Driver (18)
   o Emulation (55)
   o Game (339)
   o Graphics (126)
   o Library (18)
   o Network (43)
   o Office (9)
   o Utility (172)
   o Video (18)

Total files: 1109

Full index file
Recent index file

Hosted by
aros-exec.org
 Readme for:  Development » Library » libhjw-aros.lha

Libhjw-aros

Description: HunoJoyWrapper is a Wrapper Library for joysticks
Download: libhjw-aros.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 2Mb
Version: 1.0.0
Date: 24 Mar 12
Author: HunoPPC
Submitter: HunoPPC
Email: nouvel hugues/free fr
Homepage: http://clubevolution4.com/HunoPortSDL/
Requirements: AROS SDL, SDL_image
Category: development/library
License: Freeware
Distribute: yes
FileID: 1091
 
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 42  (Current version)
42  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

[Show comments] [Show snapshots] [Show videos] [Show content] [Replace file] 
HunoJoyWrapper Library version 1.0.0

Joystick/Joypad library 

Prerequisite:

Installing static libraries ==> libSDL_image.a and libSDL.a and their include
files

Concept idea of this library:

* Easy integration of joystick/joypad support in any application or SDL game
without needing to be an expert in programmation

* Easy preferences system with button swapping assignations, directional axis
swappings, Joypads/Joystick automatic count detection, information about
joysticks/joypads names

* Drivers internal owners of some joysticks

* Complete support of any joystick/joypad


Simple setting :

To incorporate this library in your code, first you have to:

* Copy the library from the archive in lib/libHJW.a to your SDK in the
"newlib/lib" directory

* Copy the includes directory of the library (named "libHJW") to the
newlib/include directory of your SDK

* To link the library, you just have to add this line in your code:
#include "libHJW/HunoJoyWrapper.h"

In order to compile:
	-lHWJ -lSDL_image


This library is "freeware" but is in no way OpenSource.

Rules regarding the integration of this library in any engine are as follow :

* You have to join the "Freeware_licenseLibHJW.txt" file in your program's
directory
* You have to activate the logo at startup of your program or game (see below
regarding the integration of the logo).
* You have to add the executable "Testing-JoysticksHWJlib.exe" in your
directory.
* You have to add a link to the archive in your readme as well as a link to my
site (http://www.clubevolution4.com/HunoPortSDL/)
* Source code and makefile of the modified part integrating joystick/joypad
support must be included in the archive in order to help potential developpers
thanks to your examples
* You have to send me a mail with the name of your application or game in which
you have added the library, it will allow me to update my list of
applications/games supporting "libHWJ"


How to initialise the library:

In order to initialise, you have to declare in main:
	extern SDL_Event event;


In order to initalize the LOGO:

//Initialize the wrapper and the logo (about the logo, you have to declare the
surface of the screen, usually "screen" but this inot compulsory, developpers
like to change). Important: the logo doesn't have any OpenGL rendering, you must
use it in 2D, thanks.
	InitHunoJoyWrapper();
	InitLogoHJW (Display); 

Call an axial direction function:

//Declare in the events for the 1st player:
  Uint8* joyHJW;
  joyHJW = GetJoyStateHJW();

//In order to declare a button or an axis for the 1st player for example:
	joyHJW[JOY_HJW_DOWN]/ / ===> example of integration in a code: (keys
[SDLK_DOWN] | | joyHJW [JOY_HJW_DOWN]) / / ===> The first statement is the
original one (so the keyboard event) then the second integration of the first
joystick <===

// All possibilities:
	JOY_HJW_UP
	JOY_HJW_DOWN
	JOY_HJW_LEFT
	JOY_HJW_RIGHT
	JOY_HJW_B0
	JOY_HJW_B1
	JOY_HJW_B2
	JOY_HJW_B3
	JOY_HJW_B4
	JOY_HJW_B5
	JOY_HJW_B6
	JOY_HJW_B7
	JOY_HJW_B8
	JOY_HJW_B9
	JOY_HJW_B10
	JOY_HJW_B11
	JOY_HJW_B12
	JOY_HJW_B13
	JOY_HJW_B14
	JOY_HJW_B15
	JOY_HJW_B16
	JOY_HJW_B17
	JOY_HJW_B18
	JOY_HJW_B19

//Declare in the events for the 2nd player:
  Uint8* joyHJW2;
  joyHJW2 = GetJoyState2HJW();


//In order to declare a button or an axis for the 2nd player for example:
	joyHJW2[JOY2_HJW_DOWN]/ / ===> example of integration in a code: (keys2
[SDLK_DOWN] | | joyHJW2 [JOY2_HJW_DOWN]) / / ===> The first statement is the
original one (so the keyboard event) then the second integration of the second
joystick <===

// All possibilities:
	JOY2_HJW_UP
	JOY2_HJW_DOWN
	JOY2_HJW_LEFT
	JOY2_HJW_RIGHT
	JOY2_HJW_B0
	JOY2_HJW_B1
	JOY2_HJW_B2
	JOY2_HJW_B3
	JOY2_HJW_B4
	JOY2_HJW_B5
	JOY2_HJW_B6
	JOY2_HJW_B7
	JOY2_HJW_B8
	JOY2_HJW_B9
	JOY2_HJW_B10
	JOY2_HJW_B11
	JOY2_HJW_B12
	JOY2_HJW_B13
	JOY2_HJW_B14
	JOY2_HJW_B15
	JOY2_HJW_B16
	JOY2_HJW_B17
	JOY2_HJW_B18
	JOY2_HJW_B19

// At the end of the main, free the library
	ShutdownHunoJoyWrapper ();
 

Keyboard shortcuts for the Joystick Test GUI
=> ESCAPE to quit
=> F5 to reload the config file after modifications

List of drivers currently supported natively:

Driver USB Joystick Adaptator HAMA Single adaptator Playstation
Driver Twin USB Joystick APM Adaptator Playstation
Driver ThrustMaster Dual Analog 3.2
Driver WingMan Precision USB
Driver Joystick FreeBox USB
Driver Joystick Cyborg V.1
Driver MadCatz Call of Duty GamePad
Driver Logitech(R) Precision(TM) Gamepad
Driver Saitek P220 Gamepad
Driver Saitek P990 Dual Analog Pad
Driver Teckmo mobility 2 IN 1 Gamepad
Driver TechMobility Mega World Gamepad
Driver Speedlink Strike2 GreenAsia Inc Gamepad

=============>Generic driver for a minimum operating a joystick having no
driver<==============

Generic Driver for HunoJoyWrapper


----IMPORTANT----
In order for me to add new drivers into the library, please send me : both
infosJoystick.dat and InfosJoystick2.dat files (they are created at program's
launch and are deleted at program's close).
You also have to configure your Joystick/JoyPad with the configuration GUI  (to
map the buttons at the right place) and then send me the file HunoJoyWrapper.cfg
You can send me the 3 file at the following address : nouvel.hugues (AT) free.fr
Thank you.














Copyright (c) 2005 The AROS Archives All Rights Reserved
Contact us at: archives@aros-exec.org