Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this support SDL2 game controller mapping? #18

Open
parkerlreed opened this issue Jul 12, 2020 · 4 comments
Open

Does this support SDL2 game controller mapping? #18

parkerlreed opened this issue Jul 12, 2020 · 4 comments

Comments

@parkerlreed
Copy link

I'm trying to use a controller in TFE but it doesn't get recognized when setting inputs.

I then thought it may be using the SDL2 game controller mapping and passed that as an environment variable but got nothing.

[parker@alarm Serious-Engine]$ SDL_GAMECONTROLLERCONFIG="060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b9,guide:b11,start:b10,leftstick:b12,rightstick:b13,leftshoulder:b5,rightshoulder:b6,dpup:b14,dpdown:b15,dpleft:b16,dpright:b17,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b7,righttrigger:b8," ./Bin/ssam-tfe 
STUBBED: load window icon in /home/parker/build/Serious-Engine/Sources/SeriousSam/MainWindow.cpp, line 168.
STUBBED: Need SDL invisible window or something in /home/parker/build/Serious-Engine/Sources/SeriousSam/MainWindow.cpp, line 327.
STUBBED: !!! FIXME: get the code back in from Ryan's original port. in /home/parker/build/Serious-Engine/Sources/Engine/Base/Stream.cpp, line 921.
STUBBED: Report actual SDL device name? in /home/parker/build/Serious-Engine/Sources/Engine/Sound/SoundLibrary.cpp, line 269.
STUBBED: co-opt the existing T-buffer support for multisampling? in /home/parker/build/Serious-Engine/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp, line 113.
STUBBED: this can't possibly be right, yeah? in /home/parker/build/Serious-Engine/Sources/Engine/Base/SDL/SDLEvents.cpp, line 147.
STUBBED: SDL2 can handle these events in /home/parker/build/Serious-Engine/Sources/SeriousSam/SeriousSam.cpp, line 1027.

Is there something weird that needs to be done for a controller to work?

@ptitSeb
Copy link
Owner

ptitSeb commented Jul 12, 2020

I have no idea, I never tried to use controler with on SeriousSam.
I'll look at the code later, see if cntroler is even coded (I'm unsure).

@parkerlreed
Copy link
Author

Yeah cursory glance there's no mention of "controller" in the codebase (according to github search)

@parkerlreed
Copy link
Author

Oh GitHub search sucks... Big surprise.

The support seems to be there. I'll keep poking seeing if I can get it to see the controller

[parker@stealth Serious-Engine]$ grep -ri controlleradd .
./Sources/External/SDL2/SDL_gamecontroller.h: *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
./Sources/External/SDL2/SDL_gamecontroller.h:extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw, int freerw );
./Sources/External/SDL2/SDL_gamecontroller.h:#define SDL_GameControllerAddMappingsFromFile(file)   SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
./Sources/External/SDL2/SDL_gamecontroller.h:extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
./Sources/External/SDL2/SDL_hints.h: *  You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()

@ptitSeb
Copy link
Owner

ptitSeb commented Jul 13, 2020

Mmm, no, that's just the SDL2 include header here. It's not any part of SeriousEngine code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants