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.m4 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
  */
@@ -867,7 +871,7 @@ static VALUE Window_fullscreen_mode(VALUE self)
867
871
  * @param flag [Integer] 0 for window mode, {SDL2::Window::Flags::FULLSCREEN} for
868
872
  * fullscreen mode, and {SDL2::Flags::Window::FULLSCREEN_DESKTOP} for fullscreen
869
873
  * at the current desktop resolution.
870
- * @return [flag]
874
+ * @return [void]
871
875
  *
872
876
  * @see #fullscreen_mode
873
877
  */
@@ -881,7 +885,7 @@ static VALUE Window_set_fullscreen_mode(VALUE self, VALUE flags)
881
885
  /*
882
886
  * Get the size of the drawable region.
883
887
  *
884
- * @return [[Integer, Integer]] the width and height of the region
888
+ * @return [Array(Integer, Integer)] the width and height of the region
885
889
  */
886
890
  static VALUE Window_gl_drawable_size(VALUE self)
887
891
  {
@@ -959,7 +963,7 @@ static VALUE Window_debug_info(VALUE self)
959
963
  *
960
964
  * @!attribute [r] name
961
965
  * The name of the display
962
- * @return [Stirng]
966
+ * @return [String]
963
967
  *
964
968
  */
965
969
 
@@ -1333,7 +1337,7 @@ static VALUE Renderer_clear(VALUE self)
1333
1337
 
1334
1338
  /*
1335
1339
  * Get the color used for drawing operations
1336
- * @return [[Integer,Integer,Integer,Integer]]
1340
+ * @return [Array(Integer,Integer,Integer,Integer)]
1337
1341
  * red, green, blue, and alpha components of the drawing color
1338
1342
  * (all components are more than or equal to 0 and less than and equal to 255)
1339
1343
  *
@@ -1361,12 +1365,10 @@ static VALUE Renderer_draw_color(VALUE self)
1361
1365
  * * {#fill_rect}
1362
1366
  * * {#clear}
1363
1367
  *
1364
- * @param [[Integer, Integer, Integer]] color
1365
- * red, green, and blue components used for drawing
1366
- * @param [[Integer, Integer, Integer, Integer]] color
1367
- * red, green, blue, and alpha components used for drawing
1368
+ * @param [Array<Integer>] color
1369
+ * red, green, blue, and optionally alpha components used for drawing
1368
1370
  *
1369
- * @return [color]
1371
+ * @return [Array<Integer>]
1370
1372
  *
1371
1373
  * @see #draw_color
1372
1374
  */
@@ -1511,7 +1513,8 @@ static VALUE Renderer_clip_rect(VALUE self)
1511
1513
  *
1512
1514
  * Set the clip rectangle for the current target.
1513
1515
  *
1514
- * @return [rect]
1516
+ * @param rect [SDL2::Rect]
1517
+ * @return [void]
1515
1518
  * @see #clip_rect
1516
1519
  */
1517
1520
  static VALUE Renderer_set_clip_rect(VALUE self, VALUE rect)
@@ -1535,7 +1538,7 @@ static VALUE Render_clip_enabled_p(VALUE self)
1535
1538
  /*
1536
1539
  * Get device indepndent resolution for rendering.
1537
1540
  *
1538
- * @return [[Integer, Integer]] the logical width and height
1541
+ * @return [Array(Integer, Integer)] the logical width and height
1539
1542
  * @see #logical_size=
1540
1543
  */
1541
1544
  static VALUE Renderer_logical_size(VALUE self)
@@ -1550,8 +1553,8 @@ static VALUE Renderer_logical_size(VALUE self)
1550
1553
  *
1551
1554
  * Set a device indepndent resolution for rendering.
1552
1555
  *
1553
- * @param w_and_h [[Integer, Integer]] the width and height of the logical resolution
1554
- * @return [w_and_h]
1556
+ * @param w_and_h [Array(Integer, Integer)] the width and height of the logical resolution
1557
+ * @return [void]
1555
1558
  * @see #logical_size
1556
1559
  */
1557
1560
  static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
@@ -1565,7 +1568,7 @@ static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
1565
1568
  /*
1566
1569
  * Get the drawing scale for the current target.
1567
1570
  *
1568
- * @return [[Integer, Integer]] horizontal and vertical scale factor
1571
+ * @return [Array(Integer, Integer)] horizontal and vertical scale factor
1569
1572
  * @see #scale=
1570
1573
  */
1571
1574
  static VALUE Renderer_scale(VALUE self)
@@ -1587,8 +1590,8 @@ static VALUE Renderer_scale(VALUE self)
1587
1590
  * it will be handled using the appropriate
1588
1591
  * quality hints. For best results use integer scaling factors.
1589
1592
  *
1590
- * @param scaleX_and_scaleY [[Float, Float]] the horizontal and vertical scaling factors
1591
- * @return [scaleX_and_scaleY]
1593
+ * @param scaleX_and_scaleY [Array(Float, Float)] the horizontal and vertical scaling factors
1594
+ * @return [void]
1592
1595
  * @see #scale
1593
1596
  */
1594
1597
  static VALUE Renderer_set_scale(VALUE self, VALUE xy)
@@ -1618,7 +1621,7 @@ static VALUE Renderer_viewport(VALUE self)
1618
1621
  * Set the drawing area for rendering on the current target.
1619
1622
  *
1620
1623
  * @param area [SDL2::Rect,nil] the drawing area, or nil to set the viewport to the entire target
1621
- * @return [area]
1624
+ * @return [void]
1622
1625
  * @see #viewport
1623
1626
  */
1624
1627
  static VALUE Renderer_set_viewport(VALUE self, VALUE rect)
@@ -1640,7 +1643,7 @@ static VALUE Renderer_support_render_target_p(VALUE self)
1640
1643
  /*
1641
1644
  * Get the output size of a rendering context.
1642
1645
  *
1643
- * @return [[Integer, Integer]] the width and the height
1646
+ * @return [Array(Integer, Integer)] the width and the height
1644
1647
  */
1645
1648
  static VALUE Renderer_output_size(VALUE self)
1646
1649
  {
@@ -1663,7 +1666,7 @@ static VALUE Renderer_output_size(VALUE self)
1663
1666
  * @param [SDL2::Texture,nil] target the targeted texture, or nil
1664
1667
  * for the default render target(i.e. screen)
1665
1668
  *
1666
- * @return [target]
1669
+ * @return [void]
1667
1670
  *
1668
1671
  * @see #render_target
1669
1672
  */
@@ -1773,6 +1776,8 @@ static VALUE Renderer_debug_info(VALUE self)
1773
1776
  /*
1774
1777
  * Destroy the texture and deallocate memory.
1775
1778
  *
1779
+ * @return [void]
1780
+ *
1776
1781
  * @see #destroy?
1777
1782
  */
1778
1783
  static VALUE Texture_destroy(VALUE self)
@@ -1800,7 +1805,7 @@ static VALUE Texture_blend_mode(VALUE self)
1800
1805
  * Set the blending model of the texture.
1801
1806
  *
1802
1807
  * @param mode [Integer] blending mode
1803
- * @return [mode]
1808
+ * @return [void]
1804
1809
  *
1805
1810
  * @see #blend_mode
1806
1811
  */
@@ -1830,7 +1835,7 @@ static VALUE Texture_alpha_mod(VALUE self)
1830
1835
  *
1831
1836
  * @param alpha [Integer] the alpha value multiplied into copy operation,
1832
1837
  * from 0 to 255
1833
- * @return [alpha]
1838
+ * @return [void]
1834
1839
  *
1835
1840
  * @see #alpha_mod
1836
1841
  */
@@ -1843,7 +1848,7 @@ static VALUE Texture_set_alpha_mod(VALUE self, VALUE alpha)
1843
1848
  /*
1844
1849
  * Get an additional color value used in render copy operations.
1845
1850
  *
1846
- * @return [[Integer, Integer, Integer]] the current red, green, and blue
1851
+ * @return [Array(Integer, Integer, Integer)] the current red, green, and blue
1847
1852
  * color value.
1848
1853
  */
1849
1854
  static VALUE Texture_color_mod(VALUE self)
@@ -1857,9 +1862,9 @@ static VALUE Texture_color_mod(VALUE self)
1857
1862
  * @overload color_mod=(rgb)
1858
1863
  * Set an additional color value used in render copy operations.
1859
1864
  *
1860
- * @param rgb [[Integer, Integer, Integer]] the red, green, and blue
1865
+ * @param rgb [Array(Integer, Integer, Integer)] the red, green, and blue
1861
1866
  * color value multiplied into copy operations.
1862
- * @return [rgb]
1867
+ * @return [void]
1863
1868
  */
1864
1869
  static VALUE Texture_set_color_mod(VALUE self, VALUE rgb)
1865
1870
  {
@@ -2015,7 +2020,7 @@ static VALUE Surface_s_save_bmp(VALUE self, VALUE src, VALUE fname)
2015
2020
  }
2016
2021
 
2017
2022
  /*
2018
- * @overload from_string(string, width, heigth, depth, pitch=nil, rmask=nil, gmask=nil, bmask=nil, amask=nil)
2023
+ * @overload from_string(string, width, height, depth, pitch=nil, rmask=nil, gmask=nil, bmask=nil, amask=nil)
2019
2024
  *
2020
2025
  * Create a RGB surface from pixel data as String object.
2021
2026
  *
@@ -2111,7 +2116,7 @@ static VALUE Surface_blend_mode(VALUE self)
2111
2116
  * Set the blending mode of the surface used for blit operations.
2112
2117
  *
2113
2118
  * @param mode [Integer] the blending mode
2114
- * @return [mode]
2119
+ * @return [void]
2115
2120
  * @see #blend_mode
2116
2121
  */
2117
2122
  static VALUE Surface_set_blend_mode(VALUE self, VALUE mode)
@@ -2238,7 +2243,7 @@ static VALUE Surface_bytes_per_pixel(VALUE self)
2238
2243
  *
2239
2244
  * @param x [Integer] the x coordinate
2240
2245
  * @param y [Integer] the y coordinate
2241
- * @return [[Integer, Integer, Integer, Integer]]
2246
+ * @return [Array(Integer, Integer, Integer, Integer)]
2242
2247
  * the red, green, blue, and alpha component of the specified pixel.
2243
2248
  *
2244
2249
  */
@@ -2298,7 +2303,7 @@ static VALUE Surface_unset_color_key(VALUE self)
2298
2303
  * the color key, pixel value (see {#pixel}) or pixel color (array of
2299
2304
  * three or four integer elements).
2300
2305
  *
2301
- * @return [key]
2306
+ * @return [Integer, Array<Integer>] value
2302
2307
  *
2303
2308
  * @see #color_key
2304
2309
  * @see #unset_color_key
@@ -2459,8 +2464,13 @@ static VALUE Surface_s_new(int argc, VALUE* argv, VALUE self)
2459
2464
  * Height of the rectangle
2460
2465
  * @return [Integer]
2461
2466
  *
2462
- * @!method self.[](*args)
2467
+ * @!method self.[](x, y, w, h)
2463
2468
  * Alias of new. See {#initialize}.
2469
+ *
2470
+ * @param x [Integer] X coordiante of the left-top point of the rectangle
2471
+ * @param y [Integer] Y coordiante of the left-top point of the rectangle
2472
+ * @param w [Integer] Width of the rectangle
2473
+ * @param h [Integer] Height of the rectangle
2464
2474
  * @return [SDL2::Rect]
2465
2475
  */
2466
2476
  static VALUE Rect_s_allocate(VALUE klass)
@@ -2711,6 +2721,8 @@ PIXELFORMAT_ATTR_READER(fourcc_p, SDL_ISPIXELFORMAT_FOURCC, INT2BOOL);
2711
2721
  * @overload ==(other)
2712
2722
  * Return true if two pixel format is the same format.
2713
2723
  *
2724
+ * @param other [SDL2::PixelFormat] other PixelFormat object
2725
+ *
2714
2726
  * @return [Boolean]
2715
2727
  */
2716
2728
  static VALUE PixelFormat_eq(VALUE self, VALUE other)
@@ -2830,45 +2842,45 @@ void rubysdl2_init_video(void)
2830
2842
  #endif
2831
2843
  rb_define_method(cWindow, "gl_swap", Window_gl_swap, 0);
2832
2844
 
2833
- /* Indicate that you don't care what the window position is */
2845
+ /* @return [Integer] Indicate that you don't care what the window position is */
2834
2846
  rb_define_const(cWindow, "POS_CENTERED", INT2NUM(SDL_WINDOWPOS_CENTERED));
2835
- /* Indicate that the window position should be centered */
2847
+ /* @return [Integer] Indicate that the window position should be centered */
2836
2848
  rb_define_const(cWindow, "POS_UNDEFINED", INT2NUM(SDL_WINDOWPOS_UNDEFINED));
2837
2849
 
2838
2850
  mWindowFlags = rb_define_module_under(cWindow, "Flags");
2839
2851
  /* define(`DEFINE_WINDOW_FLAGS_CONST',`rb_define_const(mWindowFlags, "$1", UINT2NUM(SDL_WINDOW_$1))') */
2840
- /* fullscreen window */
2852
+ /* @return [Integer] fullscreen window */
2841
2853
  DEFINE_WINDOW_FLAGS_CONST(FULLSCREEN);
2842
- /* fullscreen window at the current desktop resolution */
2854
+ /* @return [Integer] fullscreen window at the current desktop resolution */
2843
2855
  DEFINE_WINDOW_FLAGS_CONST(FULLSCREEN_DESKTOP);
2844
- /* window usable with OpenGL context */
2856
+ /* @return [Integer] window usable with OpenGL context */
2845
2857
  DEFINE_WINDOW_FLAGS_CONST(OPENGL);
2846
- /* window is visible */
2858
+ /* @return [Integer] window is visible */
2847
2859
  DEFINE_WINDOW_FLAGS_CONST(SHOWN);
2848
- /* window is not visible */
2860
+ /* @return [Integer] window is not visible */
2849
2861
  DEFINE_WINDOW_FLAGS_CONST(HIDDEN);
2850
- /* no window decoration */
2862
+ /* @return [Integer] no window decoration */
2851
2863
  DEFINE_WINDOW_FLAGS_CONST(BORDERLESS);
2852
- /* window is resizable */
2864
+ /* @return [Integer] window is resizable */
2853
2865
  DEFINE_WINDOW_FLAGS_CONST(RESIZABLE);
2854
- /* window is minimized */
2866
+ /* @return [Integer] window is minimized */
2855
2867
  DEFINE_WINDOW_FLAGS_CONST(MINIMIZED);
2856
- /* window is maximized */
2868
+ /* @return [Integer] window is maximized */
2857
2869
  DEFINE_WINDOW_FLAGS_CONST(MAXIMIZED);
2858
- /* window has grabbed input focus */
2870
+ /* @return [Integer] window has grabbed input focus */
2859
2871
  DEFINE_WINDOW_FLAGS_CONST(INPUT_GRABBED);
2860
- /* window has input focus */
2872
+ /* @return [Integer] window has input focus */
2861
2873
  DEFINE_WINDOW_FLAGS_CONST(INPUT_FOCUS);
2862
- /* window has mouse focus */
2874
+ /* @return [Integer] window has mouse focus */
2863
2875
  DEFINE_WINDOW_FLAGS_CONST(MOUSE_FOCUS);
2864
- /* window is not created by SDL */
2876
+ /* @return [Integer] window is not created by SDL */
2865
2877
  DEFINE_WINDOW_FLAGS_CONST(FOREIGN);
2866
- #ifdef SDL_WINDOW_ALLOW_HIGHDPI
2867
- /* window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
2878
+ #ifdef HAVE_CONST_SDL_WINDOW_ALLOW_HIGHDPI
2879
+ /* @return [Integer] window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
2868
2880
  DEFINE_WINDOW_FLAGS_CONST(ALLOW_HIGHDPI);
2869
2881
  #endif
2870
- #ifdef SDL_WINDOW_MOSUE_CAPTURE
2871
- /* window has mouse caputred (>= SDL 2.0.4) */
2882
+ #ifdef HAVE_CONST_SDL_WINDOW_MOUSE_CAPTURE
2883
+ /* @return [Integer] window has mouse caputred (>= SDL 2.0.4) */
2872
2884
  DEFINE_WINDOW_FLAGS_CONST(MOUSE_CAPTURE);
2873
2885
  #endif
2874
2886
 
@@ -2938,33 +2950,33 @@ void rubysdl2_init_video(void)
2938
2950
  mRendererFlags = rb_define_module_under(cRenderer, "Flags");
2939
2951
 
2940
2952
  /* define(`DEFINE_RENDERER_FLAGS_CONST',`rb_define_const(mRendererFlags, "$1", UINT2NUM(SDL_RENDERER_$1))') */
2941
- /* the renderer is a software fallback */
2953
+ /* @return [Integer] the renderer is a software fallback */
2942
2954
  DEFINE_RENDERER_FLAGS_CONST(SOFTWARE);
2943
- /* the renderer uses hardware acceleration */
2955
+ /* @return [Integer] the renderer uses hardware acceleration */
2944
2956
  DEFINE_RENDERER_FLAGS_CONST(ACCELERATED);
2945
- #ifdef SDL_RENDERER_PRESENTVSYNC
2946
- /* present is synchronized with the refresh rate */
2957
+ #ifdef HAVE_CONST_SDL_RENDERER_PRESENTVSYNC
2958
+ /* @return [Integer] present is synchronized with the refresh rate */
2947
2959
  DEFINE_RENDERER_FLAGS_CONST(PRESENTVSYNC);
2948
2960
  #endif
2949
- /* the renderer supports rendering to texture */
2961
+ /* @return [Integer] the renderer supports rendering to texture */
2950
2962
  DEFINE_RENDERER_FLAGS_CONST(TARGETTEXTURE);
2951
2963
  /* define(`DEFINE_SDL_FLIP_CONST',`rb_define_const(cRenderer, "FLIP_$1", INT2FIX(SDL_FLIP_$1))') */
2952
- /* Do not flip, used in {Renderer#copy_ex} */
2964
+ /* @return [Integer] Do not flip, used in {Renderer#copy_ex} */
2953
2965
  DEFINE_SDL_FLIP_CONST(NONE);
2954
- /* Flip horizontally, used in {Renderer#copy_ex} */
2966
+ /* @return [Integer] Flip horizontally, used in {Renderer#copy_ex} */
2955
2967
  DEFINE_SDL_FLIP_CONST(HORIZONTAL);
2956
- /* Flip vertically, used in {Renderer#copy_ex} */
2968
+ /* @return [Integer] Flip vertically, used in {Renderer#copy_ex} */
2957
2969
  DEFINE_SDL_FLIP_CONST(VERTICAL);
2958
2970
 
2959
2971
  mBlendMode = rb_define_module_under(mSDL2, "BlendMode");
2960
2972
  /* define(`DEFINE_BLENDMODE_CONST',`rb_define_const(mBlendMode, "$1", INT2FIX(SDL_BLENDMODE_$1))') */
2961
- /* no blending (dstRGBA = srcRGBA) */
2973
+ /* @return [Integer] no blending (dstRGBA = srcRGBA) */
2962
2974
  DEFINE_BLENDMODE_CONST(NONE);
2963
- /* alpha blending (dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA), dstA = srcA + (dstA * (1-srcA)))*/
2975
+ /* @return [Integer] alpha blending (dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA), dstA = srcA + (dstA * (1-srcA)))*/
2964
2976
  DEFINE_BLENDMODE_CONST(BLEND);
2965
- /* additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
2977
+ /* @return [Integer] additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
2966
2978
  DEFINE_BLENDMODE_CONST(ADD);
2967
- /* color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
2979
+ /* @return [Integer] color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
2968
2980
  DEFINE_BLENDMODE_CONST(MOD);
2969
2981
 
2970
2982
  cTexture = rb_define_class_under(mSDL2, "Texture", rb_cObject);
@@ -2982,11 +2994,11 @@ void rubysdl2_init_video(void)
2982
2994
  rb_define_method(cTexture, "inspect", Texture_inspect, 0);
2983
2995
  rb_define_method(cTexture, "debug_info", Texture_debug_info, 0);
2984
2996
  /* define(`DEFINE_TEXTUREAH_ACCESS_CONST', `rb_define_const(cTexture, "ACCESS_$1", INT2NUM(SDL_TEXTUREACCESS_$1))') */
2985
- /* texture access pattern - changes rarely, not lockable */
2997
+ /* @return [Integer] texture access pattern code - changes rarely, not lockable */
2986
2998
  DEFINE_TEXTUREAH_ACCESS_CONST(STATIC);
2987
- /* texture access pattern - changes frequently, lockable */
2999
+ /* @return [Integer] texture access pattern code - changes frequently, lockable */
2988
3000
  DEFINE_TEXTUREAH_ACCESS_CONST(STREAMING);
2989
- /* texture access pattern - can be used as a render target */
3001
+ /* @return [Integer] texture access pattern code - can be used as a render target */
2990
3002
  DEFINE_TEXTUREAH_ACCESS_CONST(TARGET);
2991
3003
 
2992
3004
 
@@ -3010,7 +3022,7 @@ void rubysdl2_init_video(void)
3010
3022
  rb_define_method(cSurface, "pixel_color", Surface_pixel_color, 2);
3011
3023
  rb_define_method(cSurface, "color_key", Surface_color_key, 0);
3012
3024
  rb_define_method(cSurface, "color_key=", Surface_set_color_key, 1);
3013
- rb_define_method(cSurface, "unset_color_key", Surface_set_color_key, 0);
3025
+ rb_define_method(cSurface, "unset_color_key", Surface_unset_color_key, 0);
3014
3026
  rb_define_method(cSurface, "pixels", Surface_pixels, 0);
3015
3027
  rb_define_method(cSurface, "pitch", Surface_pitch, 0);
3016
3028
  rb_define_method(cSurface, "bits_per_pixel", Surface_bits_per_pixel, 0);
@@ -3062,7 +3074,8 @@ void rubysdl2_init_video(void)
3062
3074
  rb_define_method(cPixelFormat, "==", PixelFormat_eq, 1);
3063
3075
 
3064
3076
  mPixelType = rb_define_module_under(cPixelFormat, "Type");
3065
- /* define(`DEFINE_PIXELTYPE_CONST',`rb_define_const(mPixelType, "$1", UINT2NUM(SDL_PIXELTYPE_$1))') */
3077
+ /* define(`DEFINE_PIXELTYPE_CONST',`/$8* @return [Integer] *$8/
3078
+ rb_define_const(mPixelType, "$1", UINT2NUM(SDL_PIXELTYPE_$1))') */
3066
3079
  DEFINE_PIXELTYPE_CONST(UNKNOWN);
3067
3080
  DEFINE_PIXELTYPE_CONST(INDEX1);
3068
3081
  DEFINE_PIXELTYPE_CONST(INDEX4);
@@ -3077,12 +3090,17 @@ void rubysdl2_init_video(void)
3077
3090
  DEFINE_PIXELTYPE_CONST(ARRAYF32);
3078
3091
 
3079
3092
  mBitmapOrder = rb_define_module_under(cPixelFormat, "BitmapOrder");
3093
+ /* @return [Integer] */
3080
3094
  rb_define_const(mBitmapOrder, "NONE", UINT2NUM(SDL_BITMAPORDER_NONE));
3095
+ /* @return [Integer] */
3081
3096
  rb_define_const(mBitmapOrder, "O_1234", UINT2NUM(SDL_BITMAPORDER_1234));
3097
+ /* @return [Integer] */
3082
3098
  rb_define_const(mBitmapOrder, "O_4321", UINT2NUM(SDL_BITMAPORDER_4321));
3083
3099
 
3084
3100
  mPackedOrder = rb_define_module_under(cPixelFormat, "PackedOrder");
3085
- /* define(`DEFINE_PACKEDORDER_CONST',`rb_define_const(mPackedOrder, "$1", UINT2NUM(SDL_PACKEDORDER_$1))') */
3101
+ /*
3102
+ define(`DEFINE_PACKEDORDER_CONST',`/$8* @return [Integer] *$8/
3103
+ rb_define_const(mPackedOrder, "$1", UINT2NUM(SDL_PACKEDORDER_$1))') */
3086
3104
  DEFINE_PACKEDORDER_CONST(NONE);
3087
3105
  DEFINE_PACKEDORDER_CONST(XRGB);
3088
3106
  DEFINE_PACKEDORDER_CONST(RGBX);
@@ -3094,7 +3112,8 @@ void rubysdl2_init_video(void)
3094
3112
  DEFINE_PACKEDORDER_CONST(BGRA);
3095
3113
 
3096
3114
  mArrayOrder = rb_define_module_under(cPixelFormat, "ArrayOrder");
3097
- /* define(`DEFINE_ARRAYORDER_CONST',`rb_define_const(mArrayOrder, "$1", UINT2NUM(SDL_ARRAYORDER_$1))') */
3115
+ /* define(`DEFINE_ARRAYORDER_CONST',`/$8* @return [Integer] *$8/
3116
+ rb_define_const(mArrayOrder, "$1", UINT2NUM(SDL_ARRAYORDER_$1))') */
3098
3117
  DEFINE_ARRAYORDER_CONST(NONE);
3099
3118
  DEFINE_ARRAYORDER_CONST(RGB);
3100
3119
  DEFINE_ARRAYORDER_CONST(RGBA);
@@ -3104,7 +3123,9 @@ void rubysdl2_init_video(void)
3104
3123
  DEFINE_ARRAYORDER_CONST(ABGR);
3105
3124
 
3106
3125
  mPackedLayout = rb_define_module_under(cPixelFormat, "PackedLayout");
3107
- /* define(`DEFINE_PACKEDLAYOUT_CONST',`rb_define_const(mPackedLayout, "L_$1", UINT2NUM(SDL_PACKEDLAYOUT_$1))') */
3126
+ /* define(`DEFINE_PACKEDLAYOUT_CONST',`/$8* @return [Integer] *$8/
3127
+ rb_define_const(mPackedLayout, "L_$1", UINT2NUM(SDL_PACKEDLAYOUT_$1))') */
3128
+ /* @return [Integer] */
3108
3129
  rb_define_const(mPackedLayout, "NONE", UINT2NUM(SDL_PACKEDLAYOUT_NONE));
3109
3130
  DEFINE_PACKEDLAYOUT_CONST(332);
3110
3131
  DEFINE_PACKEDLAYOUT_CONST(4444);
@@ -3117,17 +3138,17 @@ void rubysdl2_init_video(void)
3117
3138
 
3118
3139
  {
3119
3140
  VALUE formats = rb_ary_new();
3120
- /* -: Array of all available formats */
3141
+ /* -: @return [Array<SDL2::PixelFormat>] array of all available formats */
3121
3142
  rb_define_const(cPixelFormat, "FORMATS", formats);
3122
3143
  /* define(`DEFINE_PIXELFORMAT_CONST',`do {
3123
3144
  VALUE format = PixelFormat_new(SDL_PIXELFORMAT_$1);
3124
- $2
3145
+ /$8* -: @return [SDL2::PixelFormat] $2 *$8/
3125
3146
  rb_define_const(cPixelFormat, "$1", format);
3126
3147
  rb_ary_push(formats, format);
3127
3148
  } while (0)')
3128
3149
  */
3129
3150
 
3130
- DEFINE_PIXELFORMAT_CONST(UNKNOWN, /* -: PixelFormat: Unused - reserved by SDL */);
3151
+ DEFINE_PIXELFORMAT_CONST(UNKNOWN, Unused - reserved by SDL);
3131
3152
  DEFINE_PIXELFORMAT_CONST(INDEX1LSB);
3132
3153
  DEFINE_PIXELFORMAT_CONST(INDEX1MSB);
3133
3154
  DEFINE_PIXELFORMAT_CONST(INDEX4LSB);
@@ -3282,13 +3303,13 @@ void rubysdl2_init_image(void)
3282
3303
  rb_define_method(cRenderer, "load_texture", Renderer_load_texture, 1);
3283
3304
 
3284
3305
 
3285
- /* Initialize the JPEG loader */
3306
+ /* @return [Integer] Initialize the JPEG loader */
3286
3307
  rb_define_const(mIMG, "INIT_JPG", INT2NUM(IMG_INIT_JPG));
3287
- /* Initialize the PNG loader */
3308
+ /* @return [Integer] Initialize the PNG loader */
3288
3309
  rb_define_const(mIMG, "INIT_PNG", INT2NUM(IMG_INIT_PNG));
3289
- /* Initialize the TIF loader */
3310
+ /* @return [Integer] Initialize the TIF loader */
3290
3311
  rb_define_const(mIMG, "INIT_TIF", INT2NUM(IMG_INIT_TIF));
3291
- /* Initialize the WEBP loader */
3312
+ /* @return [Integer] Initialize the WEBP loader */
3292
3313
  rb_define_const(mIMG, "INIT_WEBP", INT2NUM(IMG_INIT_WEBP));
3293
3314
  }
3294
3315
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sdl2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ippei Obayashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2023-05-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Ruby/SDL2 is an extension library to use SDL 2.x
@@ -27,9 +27,12 @@ files:
27
27
  - ".dir-locals.el"
28
28
  - ".gitignore"
29
29
  - COPYING.txt
30
+ - Gemfile
30
31
  - README.md
31
32
  - Rakefile
33
+ - Steepfile
32
34
  - clipboard.c
35
+ - doc/DEVELOP.md
33
36
  - doc/po/ja.po
34
37
  - event.c
35
38
  - extconf.rb
@@ -50,6 +53,7 @@ files:
50
53
  - mixer.c
51
54
  - mixer.c.m4
52
55
  - mouse.c
56
+ - rbs_collection.yaml
53
57
  - rubysdl2_internal.h
54
58
  - sample/chunk_destroy.rb
55
59
  - sample/icon.bmp
@@ -98,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
102
  - !ruby/object:Gem::Version
99
103
  version: '0'
100
104
  requirements: []
101
- rubyforge_project:
102
- rubygems_version: 2.7.6
105
+ rubygems_version: 3.4.10
103
106
  signing_key:
104
107
  specification_version: 4
105
108
  summary: The simple ruby extension library for SDL 2.x