Renamed driverdata to internal

This was done to SDL_DisplayMode for consistency with SDL_Surface and gives it a type so we don't have to do casts in SDL code.

I considered switching to an ID and hashing the driver data, etc. but all of that involved a lot of internal code churn and this solution gives us flexibility in how we handle this in the future.

After consideration, I made this renaming global across the project, for consistency.

Fixes https://github.com/libsdl-org/SDL/issues/10198
This commit is contained in:
Sam Lantinga
2024-07-16 11:09:18 -07:00
parent fe183872ee
commit 9ca1792848
138 changed files with 1454 additions and 1456 deletions

View File

@@ -165,7 +165,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
#ifdef SDL_PLATFORM_VISIONOS
displayLink.preferredFramesPerSecond = 90 / animationInterval; //TODO: Get frame max frame rate on visionOS
#elif defined(__IPHONE_10_3)
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata;
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal;
if ([displayLink respondsToSelector:@selector(preferredFramesPerSecond)] && data != nil && data.uiwindow != nil && [data.uiwindow.screen respondsToSelector:@selector(maximumFramesPerSecond)]) {
displayLink.preferredFramesPerSecond = data.uiwindow.screen.maximumFramesPerSecond / animationInterval;
@@ -511,7 +511,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
- (void)updateKeyboard
{
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *) window->driverdata;
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *) window->internal;
CGAffineTransform t = self.view.transform;
CGPoint offset = CGPointMake(0.0, 0.0);
@@ -581,12 +581,12 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window *window)
{
if (!window || !window->driverdata) {
if (!window || !window->internal) {
SDL_SetError("Invalid window");
return nil;
}
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata;
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal;
return data.viewcontroller;
}