Comments (9)
Even when calling SDL_GetGamepadInstanceID
after the controller is opened would for example output 1
, but when consuming the remove event I get 0x8BCBD361
from which
from sdl.
For SDL 2.0 this was intentional design. For SDL 3.0 we've rethought that, and it's an instanceID everywhere.
from sdl.
For SDL 2.0 this was intentional design. For SDL 3.0 we've rethought that, and it's an instanceID everywhere.
Well this doesn't appear to be the case.
SDL_EVENT_JOYSTICK_ADDED
gives me 0x01
, whilst removed gives me 0x8BCBD361
from sdl.
For SDL 2.0 this was intentional design. For SDL 3.0 we've rethought that, and it's an instanceID everywhere.
Could you let me know what I'm doing wrong here? Instance id appears to still be index on added
from sdl.
From debugging my application, this is what it currently looks like:
SDL_JoystickID[] joysticks = SDL_GetJoysticks();
for (SDL_JoystickID jid : joysticks) {
LOGGER.info("Controller discovered: {}", jid.intValue()); // Controller discovered: 1
}
SDL_Event event = new SDL_Event();
while (SDL_PollEvent(event)) {
switch (event.type) {
case SDL_EVENT_JOYSTICK_REMOVED -> {
SDL_JoystickID jid = event.jdevice.which;
LOGGER.info("Controller removed: {}", jid.intValue()); // Controller removed: -1818745232
}
}
}
This very clearly shows the problem here
from sdl.
The ID I'm seeing is 3, which is correct. What operating system and controller are you using?
from sdl.
Windows 11 with a Dualsense Controller. No additional software
from sdl.
Yeah, the ID is still 3 here when using a DualSense controller, both over USB and Bluetooth. I'm not sure what's happening here, other than maybe the memory layout doesn't match between C and whatever language you're using?
from sdl.
It was indeed a misaligned struct, sorry for bothering you with this.
from sdl.
Related Issues (20)
- Nintendo Sega Genesis Controller is Supported - but what about the 6 button Megadrive version HOT 1
- bad RWread error checking in testime.c HOT 3
- Autotools support HOT 4
- On XWayland, full screen request is ignored without error HOT 2
- Policy on tolerance of invalid parameters: programming error or API guarantee? HOT 2
- Improvements to and fixes of wikiheaders.pl and sdlwiki SDL API documentation generation. HOT 25
- Different SDL.h header file on releases Windows and MacOS .framework? HOT 1
- SDL_RenderPolygon's limit to the range 0 to 1 texture coordinates seems impractical and I don't get why it exists HOT 7
- Leaving Relative Mouse Mode with Esc in Emscripten causes state mismatch
- Android SDL2 2.30.[0|1] regression for ...IsTextInput... functions HOT 5
- Permission dialog which ruins controller input is displayed on Android when plugging in a USB controller HOT 17
- SDL_RaiseWindow doesn't work on X11 KWin with "Focus Stealing Prevention Level" set to Low
- cmake file can't be used without a C++ compiler HOT 5
- PSP joystick polling happens not frequently enough HOT 6
- Commit ed463b4 doesn't respect `SDL_LEAN_AND_MEAN`
- SDL_LEAN_AND_MEAN CI build? HOT 2
- SDL2, wayland backend: Wayland scaling makes cursor smaller but it should be bigger HOT 11
- [SDL3] Fullscreen causes rendering issues (MacOS)
- [Windows:MSVC] building error with static SDL bug reappeared HOT 2
- *dst_px in SDL_PremultiplyAlpha() is inaccessible when setting cursor under wayland - causing "Bus error" HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl.