Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
43 user(s) are online (34 user(s) are browsing Forums)

Members: 1
Guests: 42

samo79, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: SDL2

Subject: Re: SDL2
by kas1e on 2019/1/4 15:51:14

@Capehill
Quote:

Comp Pro has only 2 axes.


But why choicen for amigaos4 are rightx and righty, and not leftx and rightx ? ptitSeb add amigaos4 ifdefs to the code, so to use rightx/righty, but the choice to use Right axis and Left is a bit strange, he would assume default to be left.

That how current code looks like:
https://github.com/ptitSeb/hydracastle ... b/master/src/sdl2/input.c

You can see there:

Quote:

#ifdef __amigaos4__
#define STICK_X SDL_CONTROLLER_AXIS_RIGHTX
#define STICK_Y SDL_CONTROLLER_AXIS_RIGHTY
#else
#define STICK_X SDL_CONTROLLER_AXIS_LEFTX
#define STICK_Y SDL_CONTROLLER_AXIS_LEFTY
#endif


But that quite suck to have such ifdefs imho (i mean, it always will need amigaos4 adaptation then).

As for mapping before, it was used for Joystick interface buttons, not for Gamecontroller one. Anyway, it was bad and he add some default value, not that xbox360 mapping (that will be used in Gamecontroller mode anyway).


Quote:


Joystick API is not difficult either. In my opinion Hydra makes some wrong assumptions on available axes. I think (didn't test yet) SDL offers a way to query axis and in case of failure, it should return NULL. My own joystick code is not better, I have hard-coded axes 0 and 1, worked for me.

Customer is the king, if possible, provide configuration options.


quote ptitSeb's answer:

Quote:

Now, for Gamecontroller, the idea behind this API is to propose a Plug'n Play way to use a joystick: you plug it in, and because the Layout and mapping is standardized (look at XB360, XBOne, PS3 or PS4 controlleurs: they all offerts similar basic functions on a similar layout: left and right stick, left dpad, 4 fae buttons, 4 triggers, 1 back and 1 start buttons basically). So, for Gamecontroller, the point is to not have any config screen, it just work, with a fixed layout.

For joystick, a config screen would be needed. But as I don't like programming GUI, I don't think I'll do that (plus, it's a long and tedious work to program that GUI for joystick option for just 20 sec of use).


I can add, that it is good to have code which you just copy+paste from one game to another, and it "just works", without needs to write gui options again and again for every new game, which in end will be so boring, that no joystick support will be in favor of time.



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project