[1.3.0] Updated SDL_* support, new backend
BindBC-SDL 1.3.0
The newest update to BindBC-SDL includes a lot of internal changes, and updates every SDL_* library's support to the latest version.
Once SDL3 comes out, I plan to evaluate whether older versions of SDL still need to be supported. This will be highly dependant on the nature of SDL3's API changes. It might be better for me to make a "BindBC-SDL3".
Breaking changes
A great deal of care has gone into keeping the number of user-side breaking changes as low as possible for this release. However, there are a few notable breaking changes:
sdl[*]Support
variables (sdlSupport
,sdlImageSupport
,sdlTTFSupport
, etc.) andSDL[*]Support
enums now useSDL_version
instead of numeric values. For now,noLibrary
andbadLibrary
are still part of theSDL[*]Support
enum, but I have tentative plans to separate them into abindbc.loader.LibError
enum in BindBC-SDL 2.0.loadedSDL[*]Version
now return the compile-time-linked version of the SDL_* library (the same asSDL[_*]_VERSION
&sdl[*]Support
), rather than an approximation of the dynamically-linked version of the SDL_* library. To see the dynamically-linked version, please useSDL_GetVersion
,IMG_Linked_Version
,Mix_Linked_Version
,SDLNet_Linked_Version
orTTF_Linked_Version
for the respective SDL_* libraries instead.- Version identifiers
BindSDL_Image
,BindSDL_Mixer
,BindSDL_Net
andBindSDL_TTF
no longer work. As far as I know they were only ever intended for internal use, but I've seen some people using them (rather than the deprecated variants without theBind
prefix) in the wild. SDL_[SomeEnumType].[someEnumTypeMember]
will no longer work because all enum types are now type aliases. Use just[someEnumTypeMember]
instead.- SDL_net functions use always use
TCPsocket
andUDPsocket
, instead of sometimes replacing them withvoid*
. - Dynamic function bindings no longer expose function pointers (except for bindings to variadic functions, but this may change in the future). For example,
auto x = SDL_Init;
will now callSDL_Init
and will maketypeof(x)
beint
instead ofint function(uint)
. If you relied on getting references this way in your code, please use use the address-of operator (&
) instead. (e.g.auto x = &SDL_Init;
) This also means that if your code manually set the function pointers (i.e.SDL_Init = &myFn;
) then it will no longer work. - Dynamic bindings' type aliases (e.g.
pSDL_Init
) no longer exist. - All internal SDL binding files are now in
sdl.*
instead ofbindbc.sdl.bind.*
. This should not affect users who were using the library as-intended, and it is still strongly discouraged for you to directly importsdl.*
instead of importingbindbc.sdl
. - Fixed the signature of
SDL_IntersectFRectAndLine
by changing theint
positions tofloat
s. - Fixed the signature of
SDL_HintCallback
by adding the missingconst(char)*
parameter at the end. SDL_CompilerBarrier
,SDL_MemoryBarrierRelease
andSDL_MemoryBarrierAcquire
are no longer aliases tocore.atomic.atomicFence!()
.
Other changes
- Support for SDL 2.26.X and 2.24.X.
- Support for SDL_image 2.6.X.
- Support for SDL_net 2.2.X.
- Support for SDL_ttf 2.20.X.
- Added many previously missing functions to
sdl.stdinc
. - Added deprecation warnings to functions officially deprecated by libsdl.org.
- Deprecated templates that were based on
#define
s. You can now use the CTFE-able function-equivalents instead. - Deprecated versionless
SDL_*
library version identifiers. (e.g.SDL_Mixer
,SDL_TTF
, etc.) Please use library version identifiers with versions instead. (e.g.SDL_Mixer_200
,SDL_TTF_2012
, etc.) Support for the old library version identifiers will be removed in BindBC-SDL version 2.0. - Deprecated
SDL[*]Support.sdl[version]
enum members (e.g.SDLImageSupport.sdlImage205
) in favour ofSDL[*]Support.v[version]
. (e.g.SDLImageSupport.v2_0_5
) The old members will be removed in BindBC-SDL version 2.0. - Added a deprecation warning to
expandEnum
, which I plan to move into another library. Possibly BindBC-Loader. - Added non-American English aliases for most relevant symbols. (e.g.
SDL_SetRenderDrawColor
→SDL_SetRenderDrawColour
, etc.) - New readme!