@@ -180,13 +180,11 @@ pub enum FlashOperation {
180
180
until_focused = C.SDL_FLASH_UNTIL_FOCUSED // Flash the window until it gets focus
181
181
}
182
182
183
+ // typedef void *SDL_GLContext;
184
+ // type C.SDL_GLContext = voidptr // <- We can't do this in V 0.2.4 54b0a2a
183
185
// GLContext is an opaque handle to an OpenGL context.
184
-
185
- // typedef void *SDL_GLContext; // ??
186
- [typedef ]
187
- struct C.SDL_GLContext {}
188
-
189
- pub type GLContext = C.SDL_GLContext
186
+ // GLContext is C.SDL_GLContext
187
+ pub type GLContext = voidptr
190
188
191
189
// GLattr is OpenGL configuration attributes
192
190
// GLattr is C.SDL_GLattr
@@ -406,7 +404,7 @@ fn C.SDL_GetDisplayBounds(display_index int, rect &C.SDL_Rect) int
406
404
// SDL_GetError() for more information.
407
405
//
408
406
// See also: SDL_GetNumVideoDisplays
409
- pub fn get_display_bounds (display_index int , rect & C.SDL_Rect ) int {
407
+ pub fn get_display_bounds (display_index int , rect & Rect ) int {
410
408
return C.SDL_GetDisplayBounds (display_index, rect)
411
409
}
412
410
@@ -439,7 +437,7 @@ fn C.SDL_GetDisplayUsableBounds(display_index int, rect &C.SDL_Rect) int
439
437
//
440
438
// See also: SDL_GetDisplayBounds
441
439
// See also: SDL_GetNumVideoDisplays
442
- pub fn get_display_usable_bounds (display_index int , rect & C.SDL_Rect ) int {
440
+ pub fn get_display_usable_bounds (display_index int , rect & Rect ) int {
443
441
return C.SDL_GetDisplayUsableBounds (display_index, rect)
444
442
}
445
443
@@ -523,7 +521,7 @@ fn C.SDL_GetDisplayMode(display_index int, mode_index int, mode &C.SDL_DisplayMo
523
521
// SDL_GetError() for more information.
524
522
//
525
523
// See also: SDL_GetNumDisplayModes
526
- pub fn get_display_mode (display_index int , mode_index int , mode & C.SDL_DisplayMode ) int {
524
+ pub fn get_display_mode (display_index int , mode_index int , mode & DisplayMode ) int {
527
525
return C.SDL_GetDisplayMode (display_index, mode_index, mode)
528
526
}
529
527
@@ -545,7 +543,7 @@ fn C.SDL_GetDesktopDisplayMode(display_index int, mode &C.SDL_DisplayMode) int
545
543
// See also: SDL_GetCurrentDisplayMode
546
544
// See also: SDL_GetDisplayMode
547
545
// See also: SDL_SetWindowDisplayMode
548
- pub fn get_desktop_display_mode (display_index int , mode & C.SDL_DisplayMode ) int {
546
+ pub fn get_desktop_display_mode (display_index int , mode & DisplayMode ) int {
549
547
return C.SDL_GetDesktopDisplayMode (display_index, mode)
550
548
}
551
549
@@ -568,7 +566,7 @@ fn C.SDL_GetCurrentDisplayMode(display_index int, mode &C.SDL_DisplayMode) int
568
566
// See also: SDL_GetDisplayMode
569
567
// See also: SDL_GetNumVideoDisplays
570
568
// See also: SDL_SetWindowDisplayMode
571
- pub fn get_current_display_mode (display_index int , mode & C.SDL_DisplayMode ) int {
569
+ pub fn get_current_display_mode (display_index int , mode & DisplayMode ) int {
572
570
return C.SDL_GetCurrentDisplayMode (display_index, mode)
573
571
}
574
572
@@ -593,7 +591,7 @@ fn C.SDL_GetClosestDisplayMode(display_index int, const_mode &C.SDL_DisplayMode,
593
591
//
594
592
// See also: SDL_GetDisplayMode
595
593
// See also: SDL_GetNumDisplayModes
596
- pub fn get_closest_display_mode (display_index int , const_mode & C.SDL_DisplayMode , closest & C.SDL_DisplayMode ) & C.SDL_DisplayMode {
594
+ pub fn get_closest_display_mode (display_index int , const_mode & DisplayMode , closest & DisplayMode ) & DisplayMode {
597
595
return C.SDL_GetClosestDisplayMode (display_index, const_mode, closest)
598
596
}
599
597
@@ -629,7 +627,7 @@ fn C.SDL_SetWindowDisplayMode(window &C.SDL_Window, const_mode &C.SDL_DisplayMod
629
627
//
630
628
// See also: SDL_GetWindowDisplayMode
631
629
// See also: SDL_SetWindowFullscreen
632
- pub fn set_window_display_mode (window & Window, const_mode & C.SDL_DisplayMode ) int {
630
+ pub fn set_window_display_mode (window & Window, const_mode & DisplayMode ) int {
633
631
return C.SDL_SetWindowDisplayMode (window, const_mode)
634
632
}
635
633
@@ -645,7 +643,7 @@ fn C.SDL_GetWindowDisplayMode(window &C.SDL_Window, mode &C.SDL_DisplayMode) int
645
643
//
646
644
// See also: SDL_SetWindowDisplayMode
647
645
// See also: SDL_SetWindowFullscreen
648
- pub fn get_window_display_mode (window & Window, mode & C.SDL_DisplayMode ) int {
646
+ pub fn get_window_display_mode (window & Window, mode & DisplayMode ) int {
649
647
return C.SDL_GetWindowDisplayMode (window, mode)
650
648
}
651
649
@@ -837,7 +835,7 @@ fn C.SDL_SetWindowIcon(window &C.SDL_Window, icon &C.SDL_Surface)
837
835
//
838
836
// `window` the window to change
839
837
// `icon` an SDL_Surface structure containing the icon for the window
840
- pub fn set_window_icon (window & Window, icon & C.SDL_Surface ) {
838
+ pub fn set_window_icon (window & Window, icon & Surface ) {
841
839
C.SDL_SetWindowIcon (window, icon)
842
840
}
843
841
@@ -1749,7 +1747,7 @@ pub fn gl_unload_library() {
1749
1747
C.SDL_GL_UnloadLibrary ()
1750
1748
}
1751
1749
1752
- fn C.SDL_GL_ExtensionSupported (extension & C. char) bool
1750
+ fn C.SDL_GL_ExtensionSupported (extension & char) bool
1753
1751
1754
1752
// gl_extension_supported checks if an OpenGL extension is supported for the current context.
1755
1753
//
@@ -1768,7 +1766,7 @@ fn C.SDL_GL_ExtensionSupported(extension &C.char) bool
1768
1766
// returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise.
1769
1767
//
1770
1768
// NOTE This function is available since SDL 2.0.0.
1771
- pub fn gl_extension_supported (extension & C. char) bool {
1769
+ pub fn gl_extension_supported (extension & char) bool {
1772
1770
return C.SDL_GL_ExtensionSupported (extension)
1773
1771
}
1774
1772
@@ -1800,8 +1798,8 @@ fn C.SDL_GL_SetAttribute(attr C.SDL_GLattr, value int) int
1800
1798
//
1801
1799
// See also: SDL_GL_GetAttribute
1802
1800
// See also: SDL_GL_ResetAttributes
1803
- pub fn gl_set_attribute (attr C.SDL_GLattr , value int ) int {
1804
- return C.SDL_GL_SetAttribute (attr, value)
1801
+ pub fn gl_set_attribute (attr GLattr , value int ) int {
1802
+ return C.SDL_GL_SetAttribute (C. SDL_GLattr ( int ( attr)) , value)
1805
1803
}
1806
1804
1807
1805
fn C.SDL_GL_GetAttribute (attr C.SDL_GLattr, value & int ) int
@@ -1815,8 +1813,8 @@ fn C.SDL_GL_GetAttribute(attr C.SDL_GLattr, value &int) int
1815
1813
//
1816
1814
// See also: SDL_GL_ResetAttributes
1817
1815
// See also: SDL_GL_SetAttribute
1818
- pub fn gl_get_attribute (attr C.SDL_GLattr , value & int ) int {
1819
- return C.SDL_GL_GetAttribute (attr, value)
1816
+ pub fn gl_get_attribute (attr GLattr , value & int ) int {
1817
+ return C.SDL_GL_GetAttribute (C. SDL_GLattr ( int ( attr)) , value)
1820
1818
}
1821
1819
1822
1820
fn C.SDL_GL_CreateContext (window & C.SDL_Window) C.SDL_GLContext
@@ -1837,8 +1835,8 @@ fn C.SDL_GL_CreateContext(window &C.SDL_Window) C.SDL_GLContext
1837
1835
//
1838
1836
// See also: SDL_GL_DeleteContext
1839
1837
// See also: SDL_GL_MakeCurrent
1840
- pub fn gl_create_context (window & Window) C.SDL_GLContext {
1841
- return C.SDL_GL_CreateContext (window)
1838
+ pub fn gl_create_context (window & Window) GLContext {
1839
+ return GLContext ( voidptr ( C.SDL_GL_CreateContext (window)) )
1842
1840
}
1843
1841
1844
1842
fn C.SDL_GL_MakeCurrent (window & C.SDL_Window, context C.SDL_GLContext) int
@@ -1853,8 +1851,8 @@ fn C.SDL_GL_MakeCurrent(window &C.SDL_Window, context C.SDL_GLContext) int
1853
1851
// SDL_GetError() for more information.
1854
1852
//
1855
1853
// See also: SDL_GL_CreateContext
1856
- pub fn gl_make_current (window & Window, context C.SDL_GLContext ) int {
1857
- return C.SDL_GL_MakeCurrent (window, context)
1854
+ pub fn gl_make_current (window & Window, context GLContext ) int {
1855
+ return C.SDL_GL_MakeCurrent (window, voidptr ( context) )
1858
1856
}
1859
1857
1860
1858
fn C.SDL_GL_GetCurrentWindow () & C.SDL_Window
@@ -1879,8 +1877,8 @@ fn C.SDL_GL_GetCurrentContext() C.SDL_GLContext
1879
1877
// NOTE This function is available since SDL 2.0.0.
1880
1878
//
1881
1879
// See also: SDL_GL_MakeCurrent
1882
- pub fn gl_get_current_context () C.SDL_GLContext {
1883
- return C.SDL_GL_GetCurrentContext ()
1880
+ pub fn gl_get_current_context () GLContext {
1881
+ return GLContext ( voidptr ( C.SDL_GL_GetCurrentContext ()) )
1884
1882
}
1885
1883
1886
1884
fn C.SDL_GL_GetDrawableSize (window & C.SDL_Window, w & int , h & int )
@@ -1985,6 +1983,6 @@ fn C.SDL_GL_DeleteContext(context C.SDL_GLContext)
1985
1983
// `context` the OpenGL context to be deleted
1986
1984
//
1987
1985
// See also: SDL_GL_CreateContext
1988
- pub fn gl_delete_context (context C.SDL_GLContext ) {
1989
- C.SDL_GL_DeleteContext (context)
1986
+ pub fn gl_delete_context (context GLContext ) {
1987
+ C.SDL_GL_DeleteContext (voidptr ( context) )
1990
1988
}
0 commit comments