SDL_CreateWindowFrom() now takes a set of properties that describe the native window and options.

This commit is contained in:
Sam Lantinga
2023-11-12 21:37:00 -08:00
parent 6afae6681b
commit 1c4723ac66
27 changed files with 94 additions and 169 deletions

View File

@@ -24,7 +24,6 @@ static const char *HintsEnum[] = {
SDL_HINT_VIDEO_ALLOW_SCREENSAVER,
SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES,
SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS,
SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT,
SDL_HINT_VIDEO_WIN_D3DCOMPILER,
SDL_HINT_VIDEO_X11_XRANDR,
SDL_HINT_XINPUT_ENABLED,
@@ -47,7 +46,6 @@ static const char *HintsVerbose[] = {
"SDL_VIDEO_ALLOW_SCREENSAVER",
"SDL_VIDEO_MAC_FULLSCREEN_SPACES",
"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS",
"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT",
"SDL_VIDEO_WIN_D3DCOMPILER",
"SDL_VIDEO_X11_XRANDR",
"SDL_XINPUT_ENABLED"

View File

@@ -100,6 +100,7 @@ int main(int argc, char *argv[])
{
int i, done;
const char *driver;
SDL_PropertiesID props;
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Texture *sprite;
@@ -146,7 +147,10 @@ int main(int argc, char *argv[])
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create native window\n");
quit(3);
}
window = SDL_CreateWindowFrom(native_window);
props = SDL_CreateProperties();
SDL_SetProperty(props, "data", native_window);
window = SDL_CreateWindowFrom(props);
SDL_DestroyProperties(props);
if (!window) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create SDL window: %s\n", SDL_GetError());
quit(4);