Skip to content

Commit e4b90dc

Browse files
committed
Add the SDL_GetWindowSizeInPixels function
1 parent 40389bb commit e4b90dc

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

units/sdl2.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ interface
141141
{$I sdlaudio.inc} // 2.26.3
142142
{$I sdlblendmode.inc} // 2.0.14
143143
{$I sdlsurface.inc} // 2.0.14
144-
{$I sdlvideo.inc} // 2.24.0
144+
{$I sdlvideo.inc} // 2.26.0
145145
{$I sdlshape.inc} // 2.24.0
146146
{$I sdlhints.inc} // 2.26.0
147147
{$I sdlloadso.inc} // 2.24.1

units/sdlvideo.inc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,27 @@ procedure SDL_GetWindowSize(window: PSDL_Window; w: pcint; h: pcint); cdecl;
739739
function SDL_GetWindowBordersSize(window: PSDL_Window; top, left, bottom, right: pcint): cint; cdecl;
740740
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBordersSize' {$ENDIF} {$ENDIF};
741741

742+
{**
743+
* Get the size of a window in pixels.
744+
*
745+
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
746+
* drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
747+
* platform with high-DPI support (Apple calls this "Retina"), and not
748+
* disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
749+
*
750+
* \param window the window from which the drawable size should be queried
751+
* \param w a pointer to variable for storing the width in pixels, may be NIL
752+
* \param h a pointer to variable for storing the height in pixels, may be
753+
* NIL
754+
*
755+
* \since This function is available since SDL 2.26.0.
756+
*
757+
* \sa SDL_CreateWindow
758+
* \sa SDL_GetWindowSize
759+
*}
760+
procedure SDL_GetWindowSizeInPixels(window: PSDL_Window; w, h: pcuint); cdecl;
761+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSizeInPixels' {$ENDIF} {$ENDIF};
762+
742763
{**
743764
* Set the minimum size of a window's client area.
744765
*

0 commit comments

Comments
 (0)