diff --git a/units/sdl2.pas b/units/sdl2.pas index 39d367d0..01bbe255 100644 --- a/units/sdl2.pas +++ b/units/sdl2.pas @@ -141,7 +141,7 @@ interface {$I sdlaudio.inc} // 2.26.3 {$I sdlblendmode.inc} // 2.0.14 {$I sdlsurface.inc} // 2.0.14 -{$I sdlvideo.inc} // 2.24.0 +{$I sdlvideo.inc} // 2.28.0 {$I sdlshape.inc} // 2.24.0 {$I sdlhints.inc} // 2.26.0 {$I sdlloadso.inc} // 2.24.1 diff --git a/units/sdlvideo.inc b/units/sdlvideo.inc index 9dd63d4c..dabce877 100644 --- a/units/sdlvideo.inc +++ b/units/sdlvideo.inc @@ -739,6 +739,27 @@ procedure SDL_GetWindowSize(window: PSDL_Window; w: pcint; h: pcint); cdecl; function SDL_GetWindowBordersSize(window: PSDL_Window; top, left, bottom, right: pcint): cint; cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBordersSize' {$ENDIF} {$ENDIF}; + {** + * Get the size of a window 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 the window from which the drawable size should be queried + * \param w a pointer to variable for storing the width in pixels, may be NIL + * \param h a pointer to variable for storing the height in pixels, may be + * NIL + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_CreateWindow + * \sa SDL_GetWindowSize + *} +procedure SDL_GetWindowSizeInPixels(window: PSDL_Window; w, h: pcuint); cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSizeInPixels' {$ENDIF} {$ENDIF}; + {** * Set the minimum size of a window's client area. * @@ -914,6 +935,19 @@ procedure SDL_RestoreWindow(window: PSDL_Window); cdecl; function SDL_SetWindowFullscreen(window: PSDL_Window; flags: TSDL_WindowFlags): cint; cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF}; + {** + * Return whether the window has a surface associated with it. + * + * \returns SDL_TRUE if there is a surface associated with the window, or + * SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + *} +function SDL_HasWindowSurface(window: PSDL_Window): TSDL_Bool; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HasWindowSurface' {$ENDIF} {$ENDIF}; + {** * Get the SDL surface associated with the window. * @@ -955,6 +989,21 @@ function SDL_UpdateWindowSurface(window: PSDL_Window): cint; cdecl; function SDL_UpdateWindowSurfaceRects(window: PSDL_Window; rects: PSDL_Rect; numrects: cint): cint; cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurfaceRects' {$ENDIF} {$ENDIF}; + {** + * Destroy the surface associated with the window. + * + * \param window the window to update + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + * \sa SDL_HasWindowSurface + *} +function SDL_DestroyWindowSurface(window: PSDL_Window): cint; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindowSurface' {$ENDIF} {$ENDIF}; + {** * Set a window's input grab mode. *