ruby-sdl2 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/video.c CHANGED
@@ -352,13 +352,14 @@ static VALUE SDL2_s_video_init(VALUE self, VALUE driver_name)
352
352
  *
353
353
  *
354
354
  * @!method destroy?
355
- * Return true if the window is already destroyed.
355
+ * @return [Boolean] true if the window is already destroyed.
356
356
  */
357
357
 
358
358
  /*
359
359
  * @overload create(title, x, y, w, h, flags)
360
360
  * Create a window with the specified position (x,y), dimensions (w,h) and flags.
361
361
  *
362
+ * @param [String] title title of the created window
362
363
  * @param [Integer] x the x position of the left-top of the window
363
364
  * @param [Integer] y the y position of the left-top of the window
364
365
  * @param [Integer] w the width of the window
@@ -426,7 +427,10 @@ VALUE find_window_by_id(Uint32 id)
426
427
  */
427
428
  static VALUE Window_destroy(VALUE self)
428
429
  {
429
- Window_destroy_internal(Get_Window(self));
430
+ Window* w = Get_Window(self);
431
+ Window_destroy_internal(w);
432
+ SDL_DestroyWindow(w->window);
433
+ w->window = NULL;
430
434
  return Qnil;
431
435
  }
432
436
 
@@ -479,7 +483,7 @@ static VALUE Window_window_id(VALUE self)
479
483
  /*
480
484
  * Get information about the window.
481
485
  *
482
- * @return [SDL2::Window::Mode]
486
+ * @return [SDL2::Display::Mode]
483
487
  */
484
488
  static VALUE Window_display_mode(VALUE self)
485
489
  {
@@ -516,7 +520,7 @@ static VALUE Window_brightness(VALUE self)
516
520
  *
517
521
  * @param brightness [Float] the brightness, 0.0 means complete dark and 1.0 means
518
522
  * normal brightness.
519
- * @return [brightness]
523
+ * @return [void]
520
524
  *
521
525
  * @see #brightness
522
526
  */
@@ -570,7 +574,7 @@ static VALUE Window_gamma_ramp(VALUE self)
570
574
  * Set the window icon.
571
575
  *
572
576
  * @param icon [SDL2::Surface] the icon for the window
573
- * @return [icon]
577
+ * @return [void]
574
578
  */
575
579
  static VALUE Window_set_icon(VALUE self, VALUE icon)
576
580
  {
@@ -593,7 +597,7 @@ static VALUE Window_input_is_grabbed_p(VALUE self)
593
597
  * Set the window's input grab mode.
594
598
  *
595
599
  * @param grabbed [Boolean] true to grub input, and false to release input
596
- * @return [grabbed]
600
+ * @return [void]
597
601
  *
598
602
  * @see #input_is_grabbed?
599
603
  */
@@ -622,7 +626,7 @@ static VALUE Window_set_int_int(void (*func)(SDL_Window*, int, int), VALUE windo
622
626
  /*
623
627
  * Get the maximum size of the window's client area.
624
628
  *
625
- * @return [Integer,Integer] maximum width and maximum height.
629
+ * @return [Array(Integer,Integer)] maximum width and maximum height.
626
630
  *
627
631
  * @see #maximum_size=
628
632
  */
@@ -635,10 +639,10 @@ static VALUE Window_maximum_size(VALUE self)
635
639
  * @overload maximum_size=(size)
636
640
  * Set the maximum size of the window's client area.
637
641
  *
638
- * @param size [[Integer, Integer]] maximum width and maximum height,
642
+ * @param size [Array(Integer, Integer)] maximum width and maximum height,
639
643
  * the both must be positive.
640
644
  *
641
- * @return [size]
645
+ * @return [void]
642
646
  *
643
647
  * @see #maximum_size
644
648
  */
@@ -650,7 +654,7 @@ static VALUE Window_set_maximum_size(VALUE self, VALUE max_size)
650
654
  /*
651
655
  * Get the minimum size of the window's client area.
652
656
  *
653
- * @return [Integer,Integer] minimum width and minimum height.
657
+ * @return [Array(Integer,Integer)] minimum width and minimum height.
654
658
  *
655
659
  * @see #minimum_size=
656
660
  */
@@ -663,10 +667,10 @@ static VALUE Window_minimum_size(VALUE self)
663
667
  * @overload minimum_size=(size)
664
668
  * Set the minimum size of the window's client area.
665
669
  *
666
- * @param size [[Integer, Integer]] minimum width and minimum height,
670
+ * @param size [Array(Integer, Integer)] minimum width and minimum height,
667
671
  * the both must be positive.
668
672
  *
669
- * @return [size]
673
+ * @return [void]
670
674
  *
671
675
  * @see #minimum_size
672
676
  */
@@ -678,7 +682,7 @@ static VALUE Window_set_minimum_size(VALUE self, VALUE min_size)
678
682
  /*
679
683
  * Get the position of the window.
680
684
  *
681
- * @return [Integer,Integer] the x position and the y position
685
+ * @return [Array(Integer,Integer)] the x position and the y position
682
686
  *
683
687
  * @see #position=
684
688
  */
@@ -691,11 +695,11 @@ static VALUE Window_position(VALUE self)
691
695
  * @overload position=(xy)
692
696
  * Set the position of the window
693
697
  *
694
- * @param xy [[Integer, Integer]] the x position and the y position,
698
+ * @param xy [Array(Integer, Integer)] the x position and the y position,
695
699
  * {SDL2::Window::POS_CENTERED} and {SDL2::Window::POS_UNDEFINED}
696
700
  * are available.
697
701
  *
698
- * @return [size]
702
+ * @return [void]
699
703
  *
700
704
  * @see #position
701
705
  */
@@ -707,7 +711,7 @@ static VALUE Window_set_position(VALUE self, VALUE xy)
707
711
  /*
708
712
  * Get the size of the window.
709
713
  *
710
- * @return [[Integer, Integer]] the width and the height
714
+ * @return [Array(Integer, Integer)] the width and the height
711
715
  *
712
716
  * @see size=
713
717
  */
@@ -720,9 +724,9 @@ static VALUE Window_size(VALUE self)
720
724
  * @overload size=(size)
721
725
  * Set the size of the window.
722
726
  *
723
- * @param wh [[Integer, Integer]] new width and new height
727
+ * @param size [Array(Integer, Integer)] new width and new height
724
728
  *
725
- * @return [size]
729
+ * @return [void]
726
730
  *
727
731
  * @see #size
728
732
  */
@@ -762,7 +766,7 @@ static VALUE Window_bordered(VALUE self)
762
766
  * @param bordered [Boolean] true for bordered window, anad false for
763
767
  * borderless window
764
768
  *
765
- * @return [bordered]
769
+ * @return [void]
766
770
  *
767
771
  * @see #bordered
768
772
  */
@@ -777,7 +781,7 @@ static VALUE Window_set_bordered(VALUE self, VALUE bordered)
777
781
  * Set the title of the window.
778
782
  *
779
783
  * @param title [String] the title
780
- * @return [title]
784
+ * @return [void]
781
785
  *
782
786
  * @see #title
783
787
  */
@@ -882,7 +886,7 @@ static VALUE Window_fullscreen_mode(VALUE self)
882
886
  * @param flag [Integer] 0 for window mode, {SDL2::Window::Flags::FULLSCREEN} for
883
887
  * fullscreen mode, and {SDL2::Flags::Window::FULLSCREEN_DESKTOP} for fullscreen
884
888
  * at the current desktop resolution.
885
- * @return [flag]
889
+ * @return [void]
886
890
  *
887
891
  * @see #fullscreen_mode
888
892
  */
@@ -896,7 +900,7 @@ static VALUE Window_set_fullscreen_mode(VALUE self, VALUE flags)
896
900
  /*
897
901
  * Get the size of the drawable region.
898
902
  *
899
- * @return [[Integer, Integer]] the width and height of the region
903
+ * @return [Array(Integer, Integer)] the width and height of the region
900
904
  */
901
905
  static VALUE Window_gl_drawable_size(VALUE self)
902
906
  {
@@ -974,7 +978,7 @@ static VALUE Window_debug_info(VALUE self)
974
978
  *
975
979
  * @!attribute [r] name
976
980
  * The name of the display
977
- * @return [Stirng]
981
+ * @return [String]
978
982
  *
979
983
  */
980
984
 
@@ -1348,7 +1352,7 @@ static VALUE Renderer_clear(VALUE self)
1348
1352
 
1349
1353
  /*
1350
1354
  * Get the color used for drawing operations
1351
- * @return [[Integer,Integer,Integer,Integer]]
1355
+ * @return [Array(Integer,Integer,Integer,Integer)]
1352
1356
  * red, green, blue, and alpha components of the drawing color
1353
1357
  * (all components are more than or equal to 0 and less than and equal to 255)
1354
1358
  *
@@ -1376,12 +1380,10 @@ static VALUE Renderer_draw_color(VALUE self)
1376
1380
  * * {#fill_rect}
1377
1381
  * * {#clear}
1378
1382
  *
1379
- * @param [[Integer, Integer, Integer]] color
1380
- * red, green, and blue components used for drawing
1381
- * @param [[Integer, Integer, Integer, Integer]] color
1382
- * red, green, blue, and alpha components used for drawing
1383
+ * @param [Array<Integer>] color
1384
+ * red, green, blue, and optionally alpha components used for drawing
1383
1385
  *
1384
- * @return [color]
1386
+ * @return [Array<Integer>]
1385
1387
  *
1386
1388
  * @see #draw_color
1387
1389
  */
@@ -1526,7 +1528,8 @@ static VALUE Renderer_clip_rect(VALUE self)
1526
1528
  *
1527
1529
  * Set the clip rectangle for the current target.
1528
1530
  *
1529
- * @return [rect]
1531
+ * @param rect [SDL2::Rect]
1532
+ * @return [void]
1530
1533
  * @see #clip_rect
1531
1534
  */
1532
1535
  static VALUE Renderer_set_clip_rect(VALUE self, VALUE rect)
@@ -1550,7 +1553,7 @@ static VALUE Render_clip_enabled_p(VALUE self)
1550
1553
  /*
1551
1554
  * Get device indepndent resolution for rendering.
1552
1555
  *
1553
- * @return [[Integer, Integer]] the logical width and height
1556
+ * @return [Array(Integer, Integer)] the logical width and height
1554
1557
  * @see #logical_size=
1555
1558
  */
1556
1559
  static VALUE Renderer_logical_size(VALUE self)
@@ -1565,8 +1568,8 @@ static VALUE Renderer_logical_size(VALUE self)
1565
1568
  *
1566
1569
  * Set a device indepndent resolution for rendering.
1567
1570
  *
1568
- * @param w_and_h [[Integer, Integer]] the width and height of the logical resolution
1569
- * @return [w_and_h]
1571
+ * @param w_and_h [Array(Integer, Integer)] the width and height of the logical resolution
1572
+ * @return [void]
1570
1573
  * @see #logical_size
1571
1574
  */
1572
1575
  static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
@@ -1580,7 +1583,7 @@ static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
1580
1583
  /*
1581
1584
  * Get the drawing scale for the current target.
1582
1585
  *
1583
- * @return [[Integer, Integer]] horizontal and vertical scale factor
1586
+ * @return [Array(Integer, Integer)] horizontal and vertical scale factor
1584
1587
  * @see #scale=
1585
1588
  */
1586
1589
  static VALUE Renderer_scale(VALUE self)
@@ -1602,8 +1605,8 @@ static VALUE Renderer_scale(VALUE self)
1602
1605
  * it will be handled using the appropriate
1603
1606
  * quality hints. For best results use integer scaling factors.
1604
1607
  *
1605
- * @param scaleX_and_scaleY [[Float, Float]] the horizontal and vertical scaling factors
1606
- * @return [scaleX_and_scaleY]
1608
+ * @param scaleX_and_scaleY [Array(Float, Float)] the horizontal and vertical scaling factors
1609
+ * @return [void]
1607
1610
  * @see #scale
1608
1611
  */
1609
1612
  static VALUE Renderer_set_scale(VALUE self, VALUE xy)
@@ -1633,7 +1636,7 @@ static VALUE Renderer_viewport(VALUE self)
1633
1636
  * Set the drawing area for rendering on the current target.
1634
1637
  *
1635
1638
  * @param area [SDL2::Rect,nil] the drawing area, or nil to set the viewport to the entire target
1636
- * @return [area]
1639
+ * @return [void]
1637
1640
  * @see #viewport
1638
1641
  */
1639
1642
  static VALUE Renderer_set_viewport(VALUE self, VALUE rect)
@@ -1655,7 +1658,7 @@ static VALUE Renderer_support_render_target_p(VALUE self)
1655
1658
  /*
1656
1659
  * Get the output size of a rendering context.
1657
1660
  *
1658
- * @return [[Integer, Integer]] the width and the height
1661
+ * @return [Array(Integer, Integer)] the width and the height
1659
1662
  */
1660
1663
  static VALUE Renderer_output_size(VALUE self)
1661
1664
  {
@@ -1678,7 +1681,7 @@ static VALUE Renderer_output_size(VALUE self)
1678
1681
  * @param [SDL2::Texture,nil] target the targeted texture, or nil
1679
1682
  * for the default render target(i.e. screen)
1680
1683
  *
1681
- * @return [target]
1684
+ * @return [void]
1682
1685
  *
1683
1686
  * @see #render_target
1684
1687
  */
@@ -1788,6 +1791,8 @@ static VALUE Renderer_debug_info(VALUE self)
1788
1791
  /*
1789
1792
  * Destroy the texture and deallocate memory.
1790
1793
  *
1794
+ * @return [void]
1795
+ *
1791
1796
  * @see #destroy?
1792
1797
  */
1793
1798
  static VALUE Texture_destroy(VALUE self)
@@ -1815,7 +1820,7 @@ static VALUE Texture_blend_mode(VALUE self)
1815
1820
  * Set the blending model of the texture.
1816
1821
  *
1817
1822
  * @param mode [Integer] blending mode
1818
- * @return [mode]
1823
+ * @return [void]
1819
1824
  *
1820
1825
  * @see #blend_mode
1821
1826
  */
@@ -1845,7 +1850,7 @@ static VALUE Texture_alpha_mod(VALUE self)
1845
1850
  *
1846
1851
  * @param alpha [Integer] the alpha value multiplied into copy operation,
1847
1852
  * from 0 to 255
1848
- * @return [alpha]
1853
+ * @return [void]
1849
1854
  *
1850
1855
  * @see #alpha_mod
1851
1856
  */
@@ -1858,7 +1863,7 @@ static VALUE Texture_set_alpha_mod(VALUE self, VALUE alpha)
1858
1863
  /*
1859
1864
  * Get an additional color value used in render copy operations.
1860
1865
  *
1861
- * @return [[Integer, Integer, Integer]] the current red, green, and blue
1866
+ * @return [Array(Integer, Integer, Integer)] the current red, green, and blue
1862
1867
  * color value.
1863
1868
  */
1864
1869
  static VALUE Texture_color_mod(VALUE self)
@@ -1872,9 +1877,9 @@ static VALUE Texture_color_mod(VALUE self)
1872
1877
  * @overload color_mod=(rgb)
1873
1878
  * Set an additional color value used in render copy operations.
1874
1879
  *
1875
- * @param rgb [[Integer, Integer, Integer]] the red, green, and blue
1880
+ * @param rgb [Array(Integer, Integer, Integer)] the red, green, and blue
1876
1881
  * color value multiplied into copy operations.
1877
- * @return [rgb]
1882
+ * @return [void]
1878
1883
  */
1879
1884
  static VALUE Texture_set_color_mod(VALUE self, VALUE rgb)
1880
1885
  {
@@ -2030,7 +2035,7 @@ static VALUE Surface_s_save_bmp(VALUE self, VALUE src, VALUE fname)
2030
2035
  }
2031
2036
 
2032
2037
  /*
2033
- * @overload from_string(string, width, heigth, depth, pitch=nil, rmask=nil, gmask=nil, bmask=nil, amask=nil)
2038
+ * @overload from_string(string, width, height, depth, pitch=nil, rmask=nil, gmask=nil, bmask=nil, amask=nil)
2034
2039
  *
2035
2040
  * Create a RGB surface from pixel data as String object.
2036
2041
  *
@@ -2126,7 +2131,7 @@ static VALUE Surface_blend_mode(VALUE self)
2126
2131
  * Set the blending mode of the surface used for blit operations.
2127
2132
  *
2128
2133
  * @param mode [Integer] the blending mode
2129
- * @return [mode]
2134
+ * @return [void]
2130
2135
  * @see #blend_mode
2131
2136
  */
2132
2137
  static VALUE Surface_set_blend_mode(VALUE self, VALUE mode)
@@ -2253,7 +2258,7 @@ static VALUE Surface_bytes_per_pixel(VALUE self)
2253
2258
  *
2254
2259
  * @param x [Integer] the x coordinate
2255
2260
  * @param y [Integer] the y coordinate
2256
- * @return [[Integer, Integer, Integer, Integer]]
2261
+ * @return [Array(Integer, Integer, Integer, Integer)]
2257
2262
  * the red, green, blue, and alpha component of the specified pixel.
2258
2263
  *
2259
2264
  */
@@ -2313,7 +2318,7 @@ static VALUE Surface_unset_color_key(VALUE self)
2313
2318
  * the color key, pixel value (see {#pixel}) or pixel color (array of
2314
2319
  * three or four integer elements).
2315
2320
  *
2316
- * @return [key]
2321
+ * @return [Integer, Array<Integer>] value
2317
2322
  *
2318
2323
  * @see #color_key
2319
2324
  * @see #unset_color_key
@@ -2474,8 +2479,13 @@ static VALUE Surface_s_new(int argc, VALUE* argv, VALUE self)
2474
2479
  * Height of the rectangle
2475
2480
  * @return [Integer]
2476
2481
  *
2477
- * @!method self.[](*args)
2482
+ * @!method self.[](x, y, w, h)
2478
2483
  * Alias of new. See {#initialize}.
2484
+ *
2485
+ * @param x [Integer] X coordiante of the left-top point of the rectangle
2486
+ * @param y [Integer] Y coordiante of the left-top point of the rectangle
2487
+ * @param w [Integer] Width of the rectangle
2488
+ * @param h [Integer] Height of the rectangle
2479
2489
  * @return [SDL2::Rect]
2480
2490
  */
2481
2491
  static VALUE Rect_s_allocate(VALUE klass)
@@ -2746,6 +2756,8 @@ static VALUE PixelFormat_fourcc_p(VALUE self)
2746
2756
  * @overload ==(other)
2747
2757
  * Return true if two pixel format is the same format.
2748
2758
  *
2759
+ * @param other [SDL2::PixelFormat] other PixelFormat object
2760
+ *
2749
2761
  * @return [Boolean]
2750
2762
  */
2751
2763
  static VALUE PixelFormat_eq(VALUE self, VALUE other)
@@ -2871,45 +2883,45 @@ void rubysdl2_init_video(void)
2871
2883
  #endif
2872
2884
  rb_define_method(cWindow, "gl_swap", Window_gl_swap, 0);
2873
2885
 
2874
- /* Indicate that you don't care what the window position is */
2886
+ /* @return [Integer] Indicate that you don't care what the window position is */
2875
2887
  rb_define_const(cWindow, "POS_CENTERED", INT2NUM(SDL_WINDOWPOS_CENTERED));
2876
- /* Indicate that the window position should be centered */
2888
+ /* @return [Integer] Indicate that the window position should be centered */
2877
2889
  rb_define_const(cWindow, "POS_UNDEFINED", INT2NUM(SDL_WINDOWPOS_UNDEFINED));
2878
2890
 
2879
2891
  mWindowFlags = rb_define_module_under(cWindow, "Flags");
2880
2892
  /* */
2881
- /* fullscreen window */
2893
+ /* @return [Integer] fullscreen window */
2882
2894
  rb_define_const(mWindowFlags, "FULLSCREEN", UINT2NUM(SDL_WINDOW_FULLSCREEN));
2883
- /* fullscreen window at the current desktop resolution */
2895
+ /* @return [Integer] fullscreen window at the current desktop resolution */
2884
2896
  rb_define_const(mWindowFlags, "FULLSCREEN_DESKTOP", UINT2NUM(SDL_WINDOW_FULLSCREEN_DESKTOP));
2885
- /* window usable with OpenGL context */
2897
+ /* @return [Integer] window usable with OpenGL context */
2886
2898
  rb_define_const(mWindowFlags, "OPENGL", UINT2NUM(SDL_WINDOW_OPENGL));
2887
- /* window is visible */
2899
+ /* @return [Integer] window is visible */
2888
2900
  rb_define_const(mWindowFlags, "SHOWN", UINT2NUM(SDL_WINDOW_SHOWN));
2889
- /* window is not visible */
2901
+ /* @return [Integer] window is not visible */
2890
2902
  rb_define_const(mWindowFlags, "HIDDEN", UINT2NUM(SDL_WINDOW_HIDDEN));
2891
- /* no window decoration */
2903
+ /* @return [Integer] no window decoration */
2892
2904
  rb_define_const(mWindowFlags, "BORDERLESS", UINT2NUM(SDL_WINDOW_BORDERLESS));
2893
- /* window is resizable */
2905
+ /* @return [Integer] window is resizable */
2894
2906
  rb_define_const(mWindowFlags, "RESIZABLE", UINT2NUM(SDL_WINDOW_RESIZABLE));
2895
- /* window is minimized */
2907
+ /* @return [Integer] window is minimized */
2896
2908
  rb_define_const(mWindowFlags, "MINIMIZED", UINT2NUM(SDL_WINDOW_MINIMIZED));
2897
- /* window is maximized */
2909
+ /* @return [Integer] window is maximized */
2898
2910
  rb_define_const(mWindowFlags, "MAXIMIZED", UINT2NUM(SDL_WINDOW_MAXIMIZED));
2899
- /* window has grabbed input focus */
2911
+ /* @return [Integer] window has grabbed input focus */
2900
2912
  rb_define_const(mWindowFlags, "INPUT_GRABBED", UINT2NUM(SDL_WINDOW_INPUT_GRABBED));
2901
- /* window has input focus */
2913
+ /* @return [Integer] window has input focus */
2902
2914
  rb_define_const(mWindowFlags, "INPUT_FOCUS", UINT2NUM(SDL_WINDOW_INPUT_FOCUS));
2903
- /* window has mouse focus */
2915
+ /* @return [Integer] window has mouse focus */
2904
2916
  rb_define_const(mWindowFlags, "MOUSE_FOCUS", UINT2NUM(SDL_WINDOW_MOUSE_FOCUS));
2905
- /* window is not created by SDL */
2917
+ /* @return [Integer] window is not created by SDL */
2906
2918
  rb_define_const(mWindowFlags, "FOREIGN", UINT2NUM(SDL_WINDOW_FOREIGN));
2907
- #ifdef SDL_WINDOW_ALLOW_HIGHDPI
2908
- /* window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
2919
+ #ifdef HAVE_CONST_SDL_WINDOW_ALLOW_HIGHDPI
2920
+ /* @return [Integer] window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
2909
2921
  rb_define_const(mWindowFlags, "ALLOW_HIGHDPI", UINT2NUM(SDL_WINDOW_ALLOW_HIGHDPI));
2910
2922
  #endif
2911
- #ifdef SDL_WINDOW_MOSUE_CAPTURE
2912
- /* window has mouse caputred (>= SDL 2.0.4) */
2923
+ #ifdef HAVE_CONST_SDL_WINDOW_MOUSE_CAPTURE
2924
+ /* @return [Integer] window has mouse caputred (>= SDL 2.0.4) */
2913
2925
  rb_define_const(mWindowFlags, "MOUSE_CAPTURE", UINT2NUM(SDL_WINDOW_MOUSE_CAPTURE));
2914
2926
  #endif
2915
2927
 
@@ -2979,33 +2991,33 @@ void rubysdl2_init_video(void)
2979
2991
  mRendererFlags = rb_define_module_under(cRenderer, "Flags");
2980
2992
 
2981
2993
  /* */
2982
- /* the renderer is a software fallback */
2994
+ /* @return [Integer] the renderer is a software fallback */
2983
2995
  rb_define_const(mRendererFlags, "SOFTWARE", UINT2NUM(SDL_RENDERER_SOFTWARE));
2984
- /* the renderer uses hardware acceleration */
2996
+ /* @return [Integer] the renderer uses hardware acceleration */
2985
2997
  rb_define_const(mRendererFlags, "ACCELERATED", UINT2NUM(SDL_RENDERER_ACCELERATED));
2986
- #ifdef SDL_RENDERER_PRESENTVSYNC
2987
- /* present is synchronized with the refresh rate */
2998
+ #ifdef HAVE_CONST_SDL_RENDERER_PRESENTVSYNC
2999
+ /* @return [Integer] present is synchronized with the refresh rate */
2988
3000
  rb_define_const(mRendererFlags, "PRESENTVSYNC", UINT2NUM(SDL_RENDERER_PRESENTVSYNC));
2989
3001
  #endif
2990
- /* the renderer supports rendering to texture */
3002
+ /* @return [Integer] the renderer supports rendering to texture */
2991
3003
  rb_define_const(mRendererFlags, "TARGETTEXTURE", UINT2NUM(SDL_RENDERER_TARGETTEXTURE));
2992
3004
  /* */
2993
- /* Do not flip, used in {Renderer#copy_ex} */
3005
+ /* @return [Integer] Do not flip, used in {Renderer#copy_ex} */
2994
3006
  rb_define_const(cRenderer, "FLIP_NONE", INT2FIX(SDL_FLIP_NONE));
2995
- /* Flip horizontally, used in {Renderer#copy_ex} */
3007
+ /* @return [Integer] Flip horizontally, used in {Renderer#copy_ex} */
2996
3008
  rb_define_const(cRenderer, "FLIP_HORIZONTAL", INT2FIX(SDL_FLIP_HORIZONTAL));
2997
- /* Flip vertically, used in {Renderer#copy_ex} */
3009
+ /* @return [Integer] Flip vertically, used in {Renderer#copy_ex} */
2998
3010
  rb_define_const(cRenderer, "FLIP_VERTICAL", INT2FIX(SDL_FLIP_VERTICAL));
2999
3011
 
3000
3012
  mBlendMode = rb_define_module_under(mSDL2, "BlendMode");
3001
3013
  /* */
3002
- /* no blending (dstRGBA = srcRGBA) */
3014
+ /* @return [Integer] no blending (dstRGBA = srcRGBA) */
3003
3015
  rb_define_const(mBlendMode, "NONE", INT2FIX(SDL_BLENDMODE_NONE));
3004
- /* alpha blending (dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA), dstA = srcA + (dstA * (1-srcA)))*/
3016
+ /* @return [Integer] alpha blending (dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA), dstA = srcA + (dstA * (1-srcA)))*/
3005
3017
  rb_define_const(mBlendMode, "BLEND", INT2FIX(SDL_BLENDMODE_BLEND));
3006
- /* additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
3018
+ /* @return [Integer] additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
3007
3019
  rb_define_const(mBlendMode, "ADD", INT2FIX(SDL_BLENDMODE_ADD));
3008
- /* color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
3020
+ /* @return [Integer] color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
3009
3021
  rb_define_const(mBlendMode, "MOD", INT2FIX(SDL_BLENDMODE_MOD));
3010
3022
 
3011
3023
  cTexture = rb_define_class_under(mSDL2, "Texture", rb_cObject);
@@ -3026,11 +3038,11 @@ void rubysdl2_init_video(void)
3026
3038
  rb_define_method(cTexture, "inspect", Texture_inspect, 0);
3027
3039
  rb_define_method(cTexture, "debug_info", Texture_debug_info, 0);
3028
3040
  /* */
3029
- /* texture access pattern - changes rarely, not lockable */
3041
+ /* @return [Integer] texture access pattern code - changes rarely, not lockable */
3030
3042
  rb_define_const(cTexture, "ACCESS_STATIC", INT2NUM(SDL_TEXTUREACCESS_STATIC));
3031
- /* texture access pattern - changes frequently, lockable */
3043
+ /* @return [Integer] texture access pattern code - changes frequently, lockable */
3032
3044
  rb_define_const(cTexture, "ACCESS_STREAMING", INT2NUM(SDL_TEXTUREACCESS_STREAMING));
3033
- /* texture access pattern - can be used as a render target */
3045
+ /* @return [Integer] texture access pattern code - can be used as a render target */
3034
3046
  rb_define_const(cTexture, "ACCESS_TARGET", INT2NUM(SDL_TEXTUREACCESS_TARGET));
3035
3047
 
3036
3048
 
@@ -3055,7 +3067,7 @@ void rubysdl2_init_video(void)
3055
3067
  rb_define_method(cSurface, "pixel_color", Surface_pixel_color, 2);
3056
3068
  rb_define_method(cSurface, "color_key", Surface_color_key, 0);
3057
3069
  rb_define_method(cSurface, "color_key=", Surface_set_color_key, 1);
3058
- rb_define_method(cSurface, "unset_color_key", Surface_set_color_key, 0);
3070
+ rb_define_method(cSurface, "unset_color_key", Surface_unset_color_key, 0);
3059
3071
  rb_define_method(cSurface, "pixels", Surface_pixels, 0);
3060
3072
  rb_define_method(cSurface, "pitch", Surface_pitch, 0);
3061
3073
  rb_define_method(cSurface, "bits_per_pixel", Surface_bits_per_pixel, 0);
@@ -3114,278 +3126,319 @@ void rubysdl2_init_video(void)
3114
3126
 
3115
3127
  mPixelType = rb_define_module_under(cPixelFormat, "Type");
3116
3128
  /* */
3129
+ /* @return [Integer] */
3117
3130
  rb_define_const(mPixelType, "UNKNOWN", UINT2NUM(SDL_PIXELTYPE_UNKNOWN));
3131
+ /* @return [Integer] */
3118
3132
  rb_define_const(mPixelType, "INDEX1", UINT2NUM(SDL_PIXELTYPE_INDEX1));
3133
+ /* @return [Integer] */
3119
3134
  rb_define_const(mPixelType, "INDEX4", UINT2NUM(SDL_PIXELTYPE_INDEX4));
3135
+ /* @return [Integer] */
3120
3136
  rb_define_const(mPixelType, "INDEX8", UINT2NUM(SDL_PIXELTYPE_INDEX8));
3137
+ /* @return [Integer] */
3121
3138
  rb_define_const(mPixelType, "PACKED8", UINT2NUM(SDL_PIXELTYPE_PACKED8));
3139
+ /* @return [Integer] */
3122
3140
  rb_define_const(mPixelType, "PACKED16", UINT2NUM(SDL_PIXELTYPE_PACKED16));
3141
+ /* @return [Integer] */
3123
3142
  rb_define_const(mPixelType, "PACKED32", UINT2NUM(SDL_PIXELTYPE_PACKED32));
3143
+ /* @return [Integer] */
3124
3144
  rb_define_const(mPixelType, "ARRAYU8", UINT2NUM(SDL_PIXELTYPE_ARRAYU8));
3145
+ /* @return [Integer] */
3125
3146
  rb_define_const(mPixelType, "ARRAYU16", UINT2NUM(SDL_PIXELTYPE_ARRAYU16));
3147
+ /* @return [Integer] */
3126
3148
  rb_define_const(mPixelType, "ARRAYU32", UINT2NUM(SDL_PIXELTYPE_ARRAYU32));
3149
+ /* @return [Integer] */
3127
3150
  rb_define_const(mPixelType, "ARRAYF16", UINT2NUM(SDL_PIXELTYPE_ARRAYF16));
3151
+ /* @return [Integer] */
3128
3152
  rb_define_const(mPixelType, "ARRAYF32", UINT2NUM(SDL_PIXELTYPE_ARRAYF32));
3129
3153
 
3130
3154
  mBitmapOrder = rb_define_module_under(cPixelFormat, "BitmapOrder");
3155
+ /* @return [Integer] */
3131
3156
  rb_define_const(mBitmapOrder, "NONE", UINT2NUM(SDL_BITMAPORDER_NONE));
3157
+ /* @return [Integer] */
3132
3158
  rb_define_const(mBitmapOrder, "O_1234", UINT2NUM(SDL_BITMAPORDER_1234));
3159
+ /* @return [Integer] */
3133
3160
  rb_define_const(mBitmapOrder, "O_4321", UINT2NUM(SDL_BITMAPORDER_4321));
3134
3161
 
3135
3162
  mPackedOrder = rb_define_module_under(cPixelFormat, "PackedOrder");
3136
- /* */
3163
+ /*
3164
+ */
3165
+ /* @return [Integer] */
3137
3166
  rb_define_const(mPackedOrder, "NONE", UINT2NUM(SDL_PACKEDORDER_NONE));
3167
+ /* @return [Integer] */
3138
3168
  rb_define_const(mPackedOrder, "XRGB", UINT2NUM(SDL_PACKEDORDER_XRGB));
3169
+ /* @return [Integer] */
3139
3170
  rb_define_const(mPackedOrder, "RGBX", UINT2NUM(SDL_PACKEDORDER_RGBX));
3171
+ /* @return [Integer] */
3140
3172
  rb_define_const(mPackedOrder, "ARGB", UINT2NUM(SDL_PACKEDORDER_ARGB));
3173
+ /* @return [Integer] */
3141
3174
  rb_define_const(mPackedOrder, "RGBA", UINT2NUM(SDL_PACKEDORDER_RGBA));
3175
+ /* @return [Integer] */
3142
3176
  rb_define_const(mPackedOrder, "XBGR", UINT2NUM(SDL_PACKEDORDER_XBGR));
3177
+ /* @return [Integer] */
3143
3178
  rb_define_const(mPackedOrder, "BGRX", UINT2NUM(SDL_PACKEDORDER_BGRX));
3179
+ /* @return [Integer] */
3144
3180
  rb_define_const(mPackedOrder, "ABGR", UINT2NUM(SDL_PACKEDORDER_ABGR));
3181
+ /* @return [Integer] */
3145
3182
  rb_define_const(mPackedOrder, "BGRA", UINT2NUM(SDL_PACKEDORDER_BGRA));
3146
3183
 
3147
3184
  mArrayOrder = rb_define_module_under(cPixelFormat, "ArrayOrder");
3148
3185
  /* */
3186
+ /* @return [Integer] */
3149
3187
  rb_define_const(mArrayOrder, "NONE", UINT2NUM(SDL_ARRAYORDER_NONE));
3188
+ /* @return [Integer] */
3150
3189
  rb_define_const(mArrayOrder, "RGB", UINT2NUM(SDL_ARRAYORDER_RGB));
3190
+ /* @return [Integer] */
3151
3191
  rb_define_const(mArrayOrder, "RGBA", UINT2NUM(SDL_ARRAYORDER_RGBA));
3192
+ /* @return [Integer] */
3152
3193
  rb_define_const(mArrayOrder, "ARGB", UINT2NUM(SDL_ARRAYORDER_ARGB));
3194
+ /* @return [Integer] */
3153
3195
  rb_define_const(mArrayOrder, "BGR", UINT2NUM(SDL_ARRAYORDER_BGR));
3196
+ /* @return [Integer] */
3154
3197
  rb_define_const(mArrayOrder, "BGRA", UINT2NUM(SDL_ARRAYORDER_BGRA));
3198
+ /* @return [Integer] */
3155
3199
  rb_define_const(mArrayOrder, "ABGR", UINT2NUM(SDL_ARRAYORDER_ABGR));
3156
3200
 
3157
3201
  mPackedLayout = rb_define_module_under(cPixelFormat, "PackedLayout");
3158
3202
  /* */
3203
+ /* @return [Integer] */
3159
3204
  rb_define_const(mPackedLayout, "NONE", UINT2NUM(SDL_PACKEDLAYOUT_NONE));
3205
+ /* @return [Integer] */
3160
3206
  rb_define_const(mPackedLayout, "L_332", UINT2NUM(SDL_PACKEDLAYOUT_332));
3207
+ /* @return [Integer] */
3161
3208
  rb_define_const(mPackedLayout, "L_4444", UINT2NUM(SDL_PACKEDLAYOUT_4444));
3209
+ /* @return [Integer] */
3162
3210
  rb_define_const(mPackedLayout, "L_1555", UINT2NUM(SDL_PACKEDLAYOUT_1555));
3211
+ /* @return [Integer] */
3163
3212
  rb_define_const(mPackedLayout, "L_5551", UINT2NUM(SDL_PACKEDLAYOUT_5551));
3213
+ /* @return [Integer] */
3164
3214
  rb_define_const(mPackedLayout, "L_565", UINT2NUM(SDL_PACKEDLAYOUT_565));
3215
+ /* @return [Integer] */
3165
3216
  rb_define_const(mPackedLayout, "L_8888", UINT2NUM(SDL_PACKEDLAYOUT_8888));
3217
+ /* @return [Integer] */
3166
3218
  rb_define_const(mPackedLayout, "L_2101010", UINT2NUM(SDL_PACKEDLAYOUT_2101010));
3219
+ /* @return [Integer] */
3167
3220
  rb_define_const(mPackedLayout, "L_1010102", UINT2NUM(SDL_PACKEDLAYOUT_1010102));
3168
3221
 
3169
3222
  {
3170
3223
  VALUE formats = rb_ary_new();
3171
- /* -: Array of all available formats */
3224
+ /* -: @return [Array<SDL2::PixelFormat>] array of all available formats */
3172
3225
  rb_define_const(cPixelFormat, "FORMATS", formats);
3173
3226
  /*
3174
3227
  */
3175
3228
 
3176
3229
  do {
3177
3230
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_UNKNOWN);
3178
- /* -: PixelFormat: Unused - reserved by SDL */
3231
+ /* -: @return [SDL2::PixelFormat] Unused - reserved by SDL */
3179
3232
  rb_define_const(cPixelFormat, "UNKNOWN", format);
3180
3233
  rb_ary_push(formats, format);
3181
3234
  } while (0);
3182
3235
  do {
3183
3236
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_INDEX1LSB);
3184
-
3237
+ /* -: @return [SDL2::PixelFormat] */
3185
3238
  rb_define_const(cPixelFormat, "INDEX1LSB", format);
3186
3239
  rb_ary_push(formats, format);
3187
3240
  } while (0);
3188
3241
  do {
3189
3242
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_INDEX1MSB);
3190
-
3243
+ /* -: @return [SDL2::PixelFormat] */
3191
3244
  rb_define_const(cPixelFormat, "INDEX1MSB", format);
3192
3245
  rb_ary_push(formats, format);
3193
3246
  } while (0);
3194
3247
  do {
3195
3248
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_INDEX4LSB);
3196
-
3249
+ /* -: @return [SDL2::PixelFormat] */
3197
3250
  rb_define_const(cPixelFormat, "INDEX4LSB", format);
3198
3251
  rb_ary_push(formats, format);
3199
3252
  } while (0);
3200
3253
  do {
3201
3254
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_INDEX4MSB);
3202
-
3255
+ /* -: @return [SDL2::PixelFormat] */
3203
3256
  rb_define_const(cPixelFormat, "INDEX4MSB", format);
3204
3257
  rb_ary_push(formats, format);
3205
3258
  } while (0);
3206
3259
  do {
3207
3260
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_INDEX8);
3208
-
3261
+ /* -: @return [SDL2::PixelFormat] */
3209
3262
  rb_define_const(cPixelFormat, "INDEX8", format);
3210
3263
  rb_ary_push(formats, format);
3211
3264
  } while (0);
3212
3265
  do {
3213
3266
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB332);
3214
-
3267
+ /* -: @return [SDL2::PixelFormat] */
3215
3268
  rb_define_const(cPixelFormat, "RGB332", format);
3216
3269
  rb_ary_push(formats, format);
3217
3270
  } while (0);
3218
3271
  do {
3219
3272
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB444);
3220
-
3273
+ /* -: @return [SDL2::PixelFormat] */
3221
3274
  rb_define_const(cPixelFormat, "RGB444", format);
3222
3275
  rb_ary_push(formats, format);
3223
3276
  } while (0);
3224
3277
  do {
3225
3278
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB555);
3226
-
3279
+ /* -: @return [SDL2::PixelFormat] */
3227
3280
  rb_define_const(cPixelFormat, "RGB555", format);
3228
3281
  rb_ary_push(formats, format);
3229
3282
  } while (0);
3230
3283
  do {
3231
3284
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGR555);
3232
-
3285
+ /* -: @return [SDL2::PixelFormat] */
3233
3286
  rb_define_const(cPixelFormat, "BGR555", format);
3234
3287
  rb_ary_push(formats, format);
3235
3288
  } while (0);
3236
3289
  do {
3237
3290
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ARGB4444);
3238
-
3291
+ /* -: @return [SDL2::PixelFormat] */
3239
3292
  rb_define_const(cPixelFormat, "ARGB4444", format);
3240
3293
  rb_ary_push(formats, format);
3241
3294
  } while (0);
3242
3295
  do {
3243
3296
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGBA4444);
3244
-
3297
+ /* -: @return [SDL2::PixelFormat] */
3245
3298
  rb_define_const(cPixelFormat, "RGBA4444", format);
3246
3299
  rb_ary_push(formats, format);
3247
3300
  } while (0);
3248
3301
  do {
3249
3302
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ABGR4444);
3250
-
3303
+ /* -: @return [SDL2::PixelFormat] */
3251
3304
  rb_define_const(cPixelFormat, "ABGR4444", format);
3252
3305
  rb_ary_push(formats, format);
3253
3306
  } while (0);
3254
3307
  do {
3255
3308
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGRA4444);
3256
-
3309
+ /* -: @return [SDL2::PixelFormat] */
3257
3310
  rb_define_const(cPixelFormat, "BGRA4444", format);
3258
3311
  rb_ary_push(formats, format);
3259
3312
  } while (0);
3260
3313
  do {
3261
3314
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ARGB1555);
3262
-
3315
+ /* -: @return [SDL2::PixelFormat] */
3263
3316
  rb_define_const(cPixelFormat, "ARGB1555", format);
3264
3317
  rb_ary_push(formats, format);
3265
3318
  } while (0);
3266
3319
  do {
3267
3320
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGBA5551);
3268
-
3321
+ /* -: @return [SDL2::PixelFormat] */
3269
3322
  rb_define_const(cPixelFormat, "RGBA5551", format);
3270
3323
  rb_ary_push(formats, format);
3271
3324
  } while (0);
3272
3325
  do {
3273
3326
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ABGR1555);
3274
-
3327
+ /* -: @return [SDL2::PixelFormat] */
3275
3328
  rb_define_const(cPixelFormat, "ABGR1555", format);
3276
3329
  rb_ary_push(formats, format);
3277
3330
  } while (0);
3278
3331
  do {
3279
3332
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGRA5551);
3280
-
3333
+ /* -: @return [SDL2::PixelFormat] */
3281
3334
  rb_define_const(cPixelFormat, "BGRA5551", format);
3282
3335
  rb_ary_push(formats, format);
3283
3336
  } while (0);
3284
3337
  do {
3285
3338
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB565);
3286
-
3339
+ /* -: @return [SDL2::PixelFormat] */
3287
3340
  rb_define_const(cPixelFormat, "RGB565", format);
3288
3341
  rb_ary_push(formats, format);
3289
3342
  } while (0);
3290
3343
  do {
3291
3344
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGR565);
3292
-
3345
+ /* -: @return [SDL2::PixelFormat] */
3293
3346
  rb_define_const(cPixelFormat, "BGR565", format);
3294
3347
  rb_ary_push(formats, format);
3295
3348
  } while (0);
3296
3349
  do {
3297
3350
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB24);
3298
-
3351
+ /* -: @return [SDL2::PixelFormat] */
3299
3352
  rb_define_const(cPixelFormat, "RGB24", format);
3300
3353
  rb_ary_push(formats, format);
3301
3354
  } while (0);
3302
3355
  do {
3303
3356
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGR24);
3304
-
3357
+ /* -: @return [SDL2::PixelFormat] */
3305
3358
  rb_define_const(cPixelFormat, "BGR24", format);
3306
3359
  rb_ary_push(formats, format);
3307
3360
  } while (0);
3308
3361
  do {
3309
3362
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGB888);
3310
-
3363
+ /* -: @return [SDL2::PixelFormat] */
3311
3364
  rb_define_const(cPixelFormat, "RGB888", format);
3312
3365
  rb_ary_push(formats, format);
3313
3366
  } while (0);
3314
3367
  do {
3315
3368
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGBX8888);
3316
-
3369
+ /* -: @return [SDL2::PixelFormat] */
3317
3370
  rb_define_const(cPixelFormat, "RGBX8888", format);
3318
3371
  rb_ary_push(formats, format);
3319
3372
  } while (0);
3320
3373
  do {
3321
3374
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGR888);
3322
-
3375
+ /* -: @return [SDL2::PixelFormat] */
3323
3376
  rb_define_const(cPixelFormat, "BGR888", format);
3324
3377
  rb_ary_push(formats, format);
3325
3378
  } while (0);
3326
3379
  do {
3327
3380
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGRX8888);
3328
-
3381
+ /* -: @return [SDL2::PixelFormat] */
3329
3382
  rb_define_const(cPixelFormat, "BGRX8888", format);
3330
3383
  rb_ary_push(formats, format);
3331
3384
  } while (0);
3332
3385
  do {
3333
3386
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ARGB8888);
3334
-
3387
+ /* -: @return [SDL2::PixelFormat] */
3335
3388
  rb_define_const(cPixelFormat, "ARGB8888", format);
3336
3389
  rb_ary_push(formats, format);
3337
3390
  } while (0);
3338
3391
  do {
3339
3392
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_RGBA8888);
3340
-
3393
+ /* -: @return [SDL2::PixelFormat] */
3341
3394
  rb_define_const(cPixelFormat, "RGBA8888", format);
3342
3395
  rb_ary_push(formats, format);
3343
3396
  } while (0);
3344
3397
  do {
3345
3398
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ABGR8888);
3346
-
3399
+ /* -: @return [SDL2::PixelFormat] */
3347
3400
  rb_define_const(cPixelFormat, "ABGR8888", format);
3348
3401
  rb_ary_push(formats, format);
3349
3402
  } while (0);
3350
3403
  do {
3351
3404
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_BGRA8888);
3352
-
3405
+ /* -: @return [SDL2::PixelFormat] */
3353
3406
  rb_define_const(cPixelFormat, "BGRA8888", format);
3354
3407
  rb_ary_push(formats, format);
3355
3408
  } while (0);
3356
3409
  do {
3357
3410
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_ARGB2101010);
3358
-
3411
+ /* -: @return [SDL2::PixelFormat] */
3359
3412
  rb_define_const(cPixelFormat, "ARGB2101010", format);
3360
3413
  rb_ary_push(formats, format);
3361
3414
  } while (0);
3362
3415
  do {
3363
3416
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_YV12);
3364
-
3417
+ /* -: @return [SDL2::PixelFormat] */
3365
3418
  rb_define_const(cPixelFormat, "YV12", format);
3366
3419
  rb_ary_push(formats, format);
3367
3420
  } while (0);
3368
3421
  do {
3369
3422
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_IYUV);
3370
-
3423
+ /* -: @return [SDL2::PixelFormat] */
3371
3424
  rb_define_const(cPixelFormat, "IYUV", format);
3372
3425
  rb_ary_push(formats, format);
3373
3426
  } while (0);
3374
3427
  do {
3375
3428
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_YUY2);
3376
-
3429
+ /* -: @return [SDL2::PixelFormat] */
3377
3430
  rb_define_const(cPixelFormat, "YUY2", format);
3378
3431
  rb_ary_push(formats, format);
3379
3432
  } while (0);
3380
3433
  do {
3381
3434
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_UYVY);
3382
-
3435
+ /* -: @return [SDL2::PixelFormat] */
3383
3436
  rb_define_const(cPixelFormat, "UYVY", format);
3384
3437
  rb_ary_push(formats, format);
3385
3438
  } while (0);
3386
3439
  do {
3387
3440
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_YVYU);
3388
-
3441
+ /* -: @return [SDL2::PixelFormat] */
3389
3442
  rb_define_const(cPixelFormat, "YVYU", format);
3390
3443
  rb_ary_push(formats, format);
3391
3444
  } while (0);
@@ -3508,13 +3561,13 @@ void rubysdl2_init_image(void)
3508
3561
  rb_define_method(cRenderer, "load_texture", Renderer_load_texture, 1);
3509
3562
 
3510
3563
 
3511
- /* Initialize the JPEG loader */
3564
+ /* @return [Integer] Initialize the JPEG loader */
3512
3565
  rb_define_const(mIMG, "INIT_JPG", INT2NUM(IMG_INIT_JPG));
3513
- /* Initialize the PNG loader */
3566
+ /* @return [Integer] Initialize the PNG loader */
3514
3567
  rb_define_const(mIMG, "INIT_PNG", INT2NUM(IMG_INIT_PNG));
3515
- /* Initialize the TIF loader */
3568
+ /* @return [Integer] Initialize the TIF loader */
3516
3569
  rb_define_const(mIMG, "INIT_TIF", INT2NUM(IMG_INIT_TIF));
3517
- /* Initialize the WEBP loader */
3570
+ /* @return [Integer] Initialize the WEBP loader */
3518
3571
  rb_define_const(mIMG, "INIT_WEBP", INT2NUM(IMG_INIT_WEBP));
3519
3572
  }
3520
3573