Wiki Page Content

Differences between revisions 14 and 15
Revision 14 as of 2016-05-14 22:06:03
Size: 923
Comment: Changed wording of description.
Revision 15 as of 2019-05-09 16:22:25
Size: 998
Editor: gerstrong
Comment:
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
You can add your code example here     // For now we consider primary display only
    int numDispModes = SDL_GetNumDisplayModes(0);

    ...

SDL_GetNumDisplayModes

Use this function to get the number of available display modes.

Syntax

int SDL_GetNumDisplayModes(int displayIndex)

Function Parameters

displayIndex

the index of the display to query

Return Value

Returns a number >= 1 on success or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

    // For now we consider primary display only
    int numDispModes = SDL_GetNumDisplayModes(0);

    ...

Remarks

The displayIndex needs to be in the range from 0 to SDL_GetNumVideoDisplays() - 1.

This allows you to support multiple screens.

Version

This function is available since SDL 2.0.0.


CategoryAPI, CategoryVideo

None: SDL_GetNumDisplayModes (last edited 2019-05-09 16:22:25 by gerstrong)

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