Wiki Page Content

Differences between revisions 2 and 3
Revision 2 as of 2009-11-24 21:58:56
Size: 1305
Editor: SheenaSmith
Comment: add categories
Revision 3 as of 2009-12-04 07:15:28
Size: 1390
Editor: SheenaSmith
Comment: content changed
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
||'''mode'''||the desired display mode||
||'''closest'''||a pointer to a display mode to be filled in with the closest match of the available display modes||
||'''mode'''||a pointer to an [[SDL_DisplayMode]] structure containing the desired mode information||
||'''closest'''||a pointer to an [[SDL_DisplayMode]] structure to be filled in with the closest match of the available display modes||
Line 28: Line 28:
The available display modes are scanned, and '''closest''' is filled in with the closest mode matching the requested mode and returned. The mode format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned. The available display modes are scanned, and '''closest''' is filled in with the closest mode matching the requested mode and returned. The '''mode''' format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned.

SDL_GetClosestDisplayMode

Use this function to get the closest match to the requested display mode.

Syntax

SDL_DisplayMode* SDL_GetClosestDisplayMode(const SDL_DisplayMode* mode,
                                           SDL_DisplayMode*       closest)

Function Parameters

mode

a pointer to an SDL_DisplayMode structure containing the desired mode information

closest

a pointer to an SDL_DisplayMode structure to be filled in with the closest match of the available display modes

Return Value

The passed in value closest, or NULL if no matching video mode was available.

Code Examples

You can add your code example here

Remarks

The available display modes are scanned, and closest is filled in with the closest mode matching the requested mode and returned. The mode format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned.


CategoryAPI, CategoryVideo

None: SDL_GetClosestDisplayMode (last edited 2014-01-19 14:02:00 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit