@@ -365,37 +365,42 @@ func GetNumDisplayModes(displayIndex int) (int, error) {
365
365
366
366
// GetDisplayBounds returns the desktop area represented by a display, with the primary display located at 0,0.
367
367
// (https://wiki.libsdl.org/SDL_GetDisplayBounds)
368
- func GetDisplayBounds (displayIndex int , rect * Rect ) error {
369
- return errorFromInt (int (
370
- C .SDL_GetDisplayBounds (C .int (displayIndex ), rect .cptr ())))
368
+ func GetDisplayBounds (displayIndex int ) (rect Rect , err error ) {
369
+ err = errorFromInt (int (
370
+ C .SDL_GetDisplayBounds (C .int (displayIndex ), (& rect ).cptr ())))
371
+ return
371
372
}
372
373
373
374
// GetDisplayUsableBounds returns the usable desktop area represented by a display, with the primary display located at 0,0.
374
375
// (https://wiki.libsdl.org/SDL_GetDisplayUsableBounds)
375
- func GetDisplayUsableBounds (displayIndex int , rect * Rect ) error {
376
- return errorFromInt (int (
376
+ func GetDisplayUsableBounds (displayIndex int ) ( rect Rect , err error ) {
377
+ err = errorFromInt (int (
377
378
C .SDL_GetDisplayUsableBounds (C .int (displayIndex ), rect .cptr ())))
379
+ return
378
380
}
379
381
380
382
// GetDisplayMode retruns information about a specific display mode.
381
383
// (https://wiki.libsdl.org/SDL_GetDisplayMode)
382
- func GetDisplayMode (displayIndex int , modeIndex int , mode * DisplayMode ) error {
383
- return errorFromInt (int (
384
- C .SDL_GetDisplayMode (C .int (displayIndex ), C .int (modeIndex ), mode .cptr ())))
384
+ func GetDisplayMode (displayIndex int , modeIndex int ) (mode DisplayMode , err error ) {
385
+ err = errorFromInt (int (
386
+ C .SDL_GetDisplayMode (C .int (displayIndex ), C .int (modeIndex ), (& mode ).cptr ())))
387
+ return
385
388
}
386
389
387
390
// GetDesktopDisplayMode returns information about the desktop display mode.
388
391
// (https://wiki.libsdl.org/SDL_GetDesktopDisplayMode)
389
- func GetDesktopDisplayMode (displayIndex int , mode * DisplayMode ) error {
390
- return errorFromInt (int (
391
- C .SDL_GetDesktopDisplayMode (C .int (displayIndex ), mode .cptr ())))
392
+ func GetDesktopDisplayMode (displayIndex int ) (mode DisplayMode , err error ) {
393
+ err = errorFromInt (int (
394
+ C .SDL_GetDesktopDisplayMode (C .int (displayIndex ), (& mode ).cptr ())))
395
+ return
392
396
}
393
397
394
398
// GetCurrentDisplayMode returns information about the current display mode.
395
399
// (https://wiki.libsdl.org/SDL_GetCurrentDisplayMode)
396
- func GetCurrentDisplayMode (displayIndex int , mode * DisplayMode ) error {
397
- return errorFromInt (int (
398
- C .SDL_GetCurrentDisplayMode (C .int (displayIndex ), mode .cptr ())))
400
+ func GetCurrentDisplayMode (displayIndex int ) (mode DisplayMode , err error ) {
401
+ err = errorFromInt (int (
402
+ C .SDL_GetCurrentDisplayMode (C .int (displayIndex ), (& mode ).cptr ())))
403
+ return
399
404
}
400
405
401
406
// GetClosestDisplayMode returns the closest match to the requested display mode.
@@ -432,9 +437,10 @@ func (window *Window) SetDisplayMode(mode *DisplayMode) error {
432
437
433
438
// GetDisplayMode fills in information about the display mode to use when the window is visible at fullscreen.
434
439
// (https://wiki.libsdl.org/SDL_GetWindowDisplayMode)
435
- func (window * Window ) GetDisplayMode (mode * DisplayMode ) error {
436
- return errorFromInt (int (
437
- C .SDL_GetWindowDisplayMode (window .cptr (), mode .cptr ())))
440
+ func (window * Window ) GetDisplayMode () (mode DisplayMode , err error ) {
441
+ err = errorFromInt (int (
442
+ C .SDL_GetWindowDisplayMode (window .cptr (), (& mode ).cptr ())))
443
+ return
438
444
}
439
445
440
446
// GetPixelFormat returns the pixel format associated with the window.
0 commit comments