Updated SDL_syswm.h for SDL 3.0

* The header is no longer dependent on SDL build configuration
* The structures are versioned separately from the rest of SDL
* SDL_GetWindowWMInfo() now returns a standard result code and is passed the version expected by the application
* Updated WhatsNew.txt and docs/README-migration.md with the first API changes in SDL 3.0
This commit is contained in:
Sam Lantinga
2022-11-23 13:33:48 -08:00
parent 53ca1f7702
commit b0840eb32e
57 changed files with 349 additions and 1411 deletions

View File

@@ -16,7 +16,7 @@
int
syswm_getWindowWMInfo(void *arg)
{
SDL_bool result;
int result;
SDL_Window *window;
SDL_SysWMinfo info;
@@ -27,13 +27,10 @@ syswm_getWindowWMInfo(void *arg)
return TEST_ABORTED;
}
/* Initialize info structure with SDL version info */
SDL_VERSION(&info.version);
/* Make call */
result = SDL_GetWindowWMInfo(window, &info);
result = SDL_GetWindowWMInfo(window, &info, SDL_SYSWM_CURRENT_VERSION);
SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
SDLTest_Log((result == 0) ? "Got window information" : "Couldn't get window information");
SDL_DestroyWindow(window);
SDLTest_AssertPass("Call to SDL_DestroyWindow()");

View File

@@ -15,9 +15,6 @@
*/
#include "SDL.h"
/* This header includes all the necessary system headers for native windows */
#include "SDL_syswm.h"
typedef struct
{
const char *tag;
@@ -36,10 +33,6 @@ extern NativeWindowFactory X11WindowFactory;
#endif
#ifdef SDL_VIDEO_DRIVER_COCOA
/* Actually, we don't really do this, since it involves adding Objective C
support to the build system, which is a little tricky. You can uncomment
it manually though and link testnativecocoa.m into the test application.
*/
#define TEST_NATIVE_COCOA
extern NativeWindowFactory CocoaWindowFactory;
#endif

View File

@@ -14,6 +14,8 @@
#ifdef TEST_NATIVE_WINDOWS
#include <windows.h>
static void *CreateWindowNative(int w, int h);
static void DestroyWindowNative(void *window);

View File

@@ -14,6 +14,8 @@
#ifdef TEST_NATIVE_X11
#include <X11/Xlib.h>
static void *CreateWindowX11(int w, int h);
static void DestroyWindowX11(void *window);