Remove SDL_GL/Metal/Vulkan_GetDrawableSize().

SDL_GetWindowSizeInPixels supersedes those functions.
This commit is contained in:
Sasha Szpakowski
2023-01-28 22:43:03 -04:00
committed by Sam Lantinga
parent 0d0a34f79f
commit 90795291e4
34 changed files with 32 additions and 250 deletions

View File

@@ -86,22 +86,6 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
*/
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
/**
* Get the size of a window's underlying drawable in pixels (for use with
* setting viewport, scissor & etc).
*
* \param window SDL_Window from which the drawable size should be queried
* \param w Pointer to variable for storing the width in pixels, may be NULL
* \param h Pointer to variable for storing the height in pixels, may be NULL
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowSize
* \sa SDL_CreateWindow
*/
extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
int *h);
/* @} *//* Metal support functions */
/* Ends C function definitions when using C++ */

View File

@@ -385,12 +385,10 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rec
* **WARNING**: This reports the DPI that the hardware reports, and it is not
* always reliable! It is almost always better to use SDL_GetWindowSize() to
* find the window size, which might be in logical points instead of pixels,
* and then SDL_GetWindowSizeInPixels(), SDL_GL_GetDrawableSize(),
* SDL_Vulkan_GetDrawableSize(), SDL_Metal_GetDrawableSize(), or
* SDL_GetRendererOutputSize(), and compare the two values to get an actual
* scaling value between the two. We will be rethinking how high-dpi details
* should be managed in SDL3 to make things more consistent, reliable, and
* clear.
* and then SDL_GetWindowSizeInPixels() or SDL_GetRendererOutputSize(), and
* compare the two values to get an actual scaling value between the two. We
* will be rethinking how high-dpi details should be managed in SDL3 to make
* things more consistent, reliable, and clear.
*
* \param displayIndex the index of the display from which DPI information
* should be queried
@@ -905,8 +903,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h)
*
* The window size in screen coordinates may differ from the size in pixels if
* the window is on a high density display (one with an OS scaling factor).
* Use SDL_GetWindowSizeInPixels(), SDL_GL_GetDrawableSize(),
* SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to get the
* Use SDL_GetWindowSizeInPixels() or SDL_GetRendererOutputSize() to get the
* real client area size in pixels.
*
* \param window the window to query the width and height from
@@ -916,8 +913,6 @@ extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h)
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowSizeInPixels
* \sa SDL_GL_GetDrawableSize
* \sa SDL_Vulkan_GetDrawableSize
* \sa SDL_GetRendererOutputSize
* \sa SDL_SetWindowSize
*/
@@ -1895,23 +1890,6 @@ extern DECLSPEC void SDLCALL SDL_EGL_SetEGLAttributeCallbacks(SDL_EGLAttribArray
SDL_EGLIntArrayCallback surfaceAttribCallback,
SDL_EGLIntArrayCallback contextAttribCallback);
/**
* Get the size of a window's underlying drawable in pixels.
*
* This returns info useful for calling glViewport().
*
* \param window the window from which the drawable size should be queried
* \param w a pointer to variable for storing the width in pixels, may be NULL
* \param h a pointer to variable for storing the height in pixels, may be
* NULL
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreateWindow
* \sa SDL_GetWindowSize
*/
extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h);
/**
* Set the swap interval for the current OpenGL context.
*

View File

@@ -179,33 +179,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(unsigned int *
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_Vulkan_GetInstanceExtensions
* \sa SDL_Vulkan_GetDrawableSize
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
VkSurfaceKHR* surface);
/**
* Get the size of the window's underlying drawable dimensions in pixels.
*
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
* drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
* platform with high-DPI support (Apple calls this "Retina"), and not
* disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
*
* \param window an SDL_Window for which the size is to be queried
* \param w Pointer to the variable to write the width to or NULL
* \param h Pointer to the variable to write the height to or NULL
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowSize
* \sa SDL_CreateWindow
* \sa SDL_Vulkan_CreateSurface
*/
extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
int *w, int *h);
/* @} *//* Vulkan support functions */
/* Ends C function definitions when using C++ */