Skip to content

Conversation

@damntourists
Copy link
Contributor

This PR adds all of the latest updates from https://github.com/raysan5/raylib which I've also confirmed as a fix for #521.

@damntourists damntourists changed the title Updating to latest release of raylib WIP Updating to latest release of raylib Dec 10, 2025
@damntourists
Copy link
Contributor Author

I added a sdl_shim.h which enables compiling with sdl2. Previously was failing with

In file included from rcore.c:545:
platforms/rcore_desktop_sdl.c: In function ‘PollInputEvents’:
platforms/rcore_desktop_sdl.c:1753:31: error: ‘SDL_Event’ has no member named ‘gbutton’; did you mean ‘button’?
 1753 |                 switch (event.gbutton.button)
      |                               ^~~~~~~
      |                               button
platforms/rcore_desktop_sdl.c:1781:60: error: ‘SDL_Event’ has no member named ‘gbutton’; did you mean ‘button’?
 1781 |                         if (platform.gamepadId[i] == event.gbutton.which)
      |                                                            ^~~~~~~
      |                                                            button
platforms/rcore_desktop_sdl.c:1794:31: error: ‘SDL_Event’ has no member named ‘gbutton’; did you mean ‘button’?
 1794 |                 switch (event.gbutton.button)
      |                               ^~~~~~~
      |                               button
platforms/rcore_desktop_sdl.c:1822:60: error: ‘SDL_Event’ has no member named ‘gbutton’; did you mean ‘button’?
 1822 |                         if (platform.gamepadId[i] == event.gbutton.which)
      |                                                            ^~~~~~~
      |                                                            button
platforms/rcore_desktop_sdl.c: In function ‘InitPlatform’:
platforms/rcore_desktop_sdl.c:2058:33: warning: initialization of ‘SDL_JoystickID *’ {aka ‘int *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 2058 |     SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); // array of joystick IDs, they do not start from 0
      |                                 ^~~~~~~~~~~~~~~~
      ```

@damntourists damntourists changed the title WIP Updating to latest release of raylib Updating to latest release of raylib Dec 11, 2025
@gen2brain
Copy link
Owner

It has always been able to compile for SDL2 and, recently, for SDL3. But rcore_desktop_sdl.c changed, that happens on every update, everything changes. See the history, etc. Does raylib use that shim.h? If not, then the issue is elsewhere, and we should not hack it or add unnecessary files.

@damntourists
Copy link
Contributor Author

It seems the issue was possibly introduced upstream in https://github.com/raysan5/raylib/pull/5176/files since this is using SDL3 specific code. In order to get SDL2 to work with it, the shim was created.

@damntourists
Copy link
Contributor Author

I've created raysan5/raylib#5403 for some guidance.

@damntourists
Copy link
Contributor Author

@gen2brain, I've made some updates to this PR. The issue that I was attempting to fix with the shim has been corrected upstream in raylib which I've updated in raylib-go. All jobs in the package's workflow passed in my latest commit @ https://github.com/damntourists/raylib-go/actions/runs/20114236373. Could you take a look and let me know if there's anything I've missed?

@gen2brain
Copy link
Owner

Nice. Please check #472; a few things must always be changed manually. Also, I think I saw in some raylib commits that something changed for the Android main entry point, but I'm not sure; I do not have time to check now.

@damntourists
Copy link
Contributor Author

Okay, I've gone through and added the ALIGN def/undef block to jar_mx.h, the !noaudio build tag to raudio.c and updated the entry point for rcore_android.c. Whenever you get a moment, could you check on your end if there's anything I've missed? The unittests are still passing on my fork.

@gen2brain
Copy link
Owner

Nice, thanks for working on this. I am merging it; it looks good. It is always good to do this, and it is much easier later on a new release. Users still get the latest tagged release; they do not have to use main/master.

@gen2brain gen2brain merged commit 040fd2b into gen2brain:master Dec 28, 2025
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants