raptor85,
@raptor85@mastodon.gamedev.place avatar

@stungeye how this works is in the SDL headers there's this, which makes your "main" function actually compile as SDL_main, and lets the SDL library itself handle main, calling your function after it's done it's setup. This is partially for callbacks, but also allows SDL to set up OS specific things in the background without you having to do it yourself for each OS you support. See below for how it works and a link to the windows code that actually executes.

https://github.com/libsdl-org/SDL/blob/SDL2/src/main/windows/SDL_windows_main.c

  • All
  • Subscribed
  • Moderated
  • Favorites
  • gamedev
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • cubers
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • JUstTest
  • everett
  • tacticalgear
  • modclub
  • anitta
  • cisconetworking
  • tester
  • ngwrru68w68
  • GTA5RPClips
  • normalnudes
  • megavids
  • Leos
  • provamag3
  • lostlight
  • All magazines