ruby-sdl2 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/Gemfile +11 -0
- data/README.md +5 -2
- data/Rakefile +22 -2
- data/Steepfile +24 -0
- data/doc/DEVELOP.md +35 -0
- data/event.c +3 -3
- data/gamecontroller.c +26 -25
- data/gamecontroller.c.m4 +26 -25
- data/gl.c +56 -63
- data/gl.c.m4 +56 -63
- data/hint.c +3 -3
- data/joystick.c +11 -10
- data/joystick.c.m4 +11 -10
- data/key.c +21 -19
- data/key.c.m4 +21 -19
- data/lib/sdl2/version.rb +3 -3
- data/main.c +13 -16
- data/messagebox.c +7 -7
- data/mixer.c +41 -31
- data/mixer.c.m4 +41 -31
- data/mouse.c +3 -3
- data/rbs_collection.yaml +32 -0
- data/ttf.c +15 -15
- data/ttf.c.m4 +15 -15
- data/video.c +172 -122
- data/video.c.m4 +109 -91
- metadata +7 -3
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
|
-
*
|
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
|
@@ -482,7 +483,7 @@ static VALUE Window_window_id(VALUE self)
|
|
482
483
|
/*
|
483
484
|
* Get information about the window.
|
484
485
|
*
|
485
|
-
* @return [SDL2::
|
486
|
+
* @return [SDL2::Display::Mode]
|
486
487
|
*/
|
487
488
|
static VALUE Window_display_mode(VALUE self)
|
488
489
|
{
|
@@ -519,7 +520,7 @@ static VALUE Window_brightness(VALUE self)
|
|
519
520
|
*
|
520
521
|
* @param brightness [Float] the brightness, 0.0 means complete dark and 1.0 means
|
521
522
|
* normal brightness.
|
522
|
-
* @return [
|
523
|
+
* @return [void]
|
523
524
|
*
|
524
525
|
* @see #brightness
|
525
526
|
*/
|
@@ -573,7 +574,7 @@ static VALUE Window_gamma_ramp(VALUE self)
|
|
573
574
|
* Set the window icon.
|
574
575
|
*
|
575
576
|
* @param icon [SDL2::Surface] the icon for the window
|
576
|
-
* @return [
|
577
|
+
* @return [void]
|
577
578
|
*/
|
578
579
|
static VALUE Window_set_icon(VALUE self, VALUE icon)
|
579
580
|
{
|
@@ -596,7 +597,7 @@ static VALUE Window_input_is_grabbed_p(VALUE self)
|
|
596
597
|
* Set the window's input grab mode.
|
597
598
|
*
|
598
599
|
* @param grabbed [Boolean] true to grub input, and false to release input
|
599
|
-
* @return [
|
600
|
+
* @return [void]
|
600
601
|
*
|
601
602
|
* @see #input_is_grabbed?
|
602
603
|
*/
|
@@ -625,7 +626,7 @@ static VALUE Window_set_int_int(void (*func)(SDL_Window*, int, int), VALUE windo
|
|
625
626
|
/*
|
626
627
|
* Get the maximum size of the window's client area.
|
627
628
|
*
|
628
|
-
* @return [Integer,Integer] maximum width and maximum height.
|
629
|
+
* @return [Array(Integer,Integer)] maximum width and maximum height.
|
629
630
|
*
|
630
631
|
* @see #maximum_size=
|
631
632
|
*/
|
@@ -638,10 +639,10 @@ static VALUE Window_maximum_size(VALUE self)
|
|
638
639
|
* @overload maximum_size=(size)
|
639
640
|
* Set the maximum size of the window's client area.
|
640
641
|
*
|
641
|
-
* @param size [
|
642
|
+
* @param size [Array(Integer, Integer)] maximum width and maximum height,
|
642
643
|
* the both must be positive.
|
643
644
|
*
|
644
|
-
* @return [
|
645
|
+
* @return [void]
|
645
646
|
*
|
646
647
|
* @see #maximum_size
|
647
648
|
*/
|
@@ -653,7 +654,7 @@ static VALUE Window_set_maximum_size(VALUE self, VALUE max_size)
|
|
653
654
|
/*
|
654
655
|
* Get the minimum size of the window's client area.
|
655
656
|
*
|
656
|
-
* @return [Integer,Integer] minimum width and minimum height.
|
657
|
+
* @return [Array(Integer,Integer)] minimum width and minimum height.
|
657
658
|
*
|
658
659
|
* @see #minimum_size=
|
659
660
|
*/
|
@@ -666,10 +667,10 @@ static VALUE Window_minimum_size(VALUE self)
|
|
666
667
|
* @overload minimum_size=(size)
|
667
668
|
* Set the minimum size of the window's client area.
|
668
669
|
*
|
669
|
-
* @param size [
|
670
|
+
* @param size [Array(Integer, Integer)] minimum width and minimum height,
|
670
671
|
* the both must be positive.
|
671
672
|
*
|
672
|
-
* @return [
|
673
|
+
* @return [void]
|
673
674
|
*
|
674
675
|
* @see #minimum_size
|
675
676
|
*/
|
@@ -681,7 +682,7 @@ static VALUE Window_set_minimum_size(VALUE self, VALUE min_size)
|
|
681
682
|
/*
|
682
683
|
* Get the position of the window.
|
683
684
|
*
|
684
|
-
* @return [Integer,Integer] the x position and the y position
|
685
|
+
* @return [Array(Integer,Integer)] the x position and the y position
|
685
686
|
*
|
686
687
|
* @see #position=
|
687
688
|
*/
|
@@ -694,11 +695,11 @@ static VALUE Window_position(VALUE self)
|
|
694
695
|
* @overload position=(xy)
|
695
696
|
* Set the position of the window
|
696
697
|
*
|
697
|
-
* @param xy [
|
698
|
+
* @param xy [Array(Integer, Integer)] the x position and the y position,
|
698
699
|
* {SDL2::Window::POS_CENTERED} and {SDL2::Window::POS_UNDEFINED}
|
699
700
|
* are available.
|
700
701
|
*
|
701
|
-
* @return [
|
702
|
+
* @return [void]
|
702
703
|
*
|
703
704
|
* @see #position
|
704
705
|
*/
|
@@ -710,7 +711,7 @@ static VALUE Window_set_position(VALUE self, VALUE xy)
|
|
710
711
|
/*
|
711
712
|
* Get the size of the window.
|
712
713
|
*
|
713
|
-
* @return [
|
714
|
+
* @return [Array(Integer, Integer)] the width and the height
|
714
715
|
*
|
715
716
|
* @see size=
|
716
717
|
*/
|
@@ -723,9 +724,9 @@ static VALUE Window_size(VALUE self)
|
|
723
724
|
* @overload size=(size)
|
724
725
|
* Set the size of the window.
|
725
726
|
*
|
726
|
-
* @param
|
727
|
+
* @param size [Array(Integer, Integer)] new width and new height
|
727
728
|
*
|
728
|
-
* @return [
|
729
|
+
* @return [void]
|
729
730
|
*
|
730
731
|
* @see #size
|
731
732
|
*/
|
@@ -765,7 +766,7 @@ static VALUE Window_bordered(VALUE self)
|
|
765
766
|
* @param bordered [Boolean] true for bordered window, anad false for
|
766
767
|
* borderless window
|
767
768
|
*
|
768
|
-
* @return [
|
769
|
+
* @return [void]
|
769
770
|
*
|
770
771
|
* @see #bordered
|
771
772
|
*/
|
@@ -780,7 +781,7 @@ static VALUE Window_set_bordered(VALUE self, VALUE bordered)
|
|
780
781
|
* Set the title of the window.
|
781
782
|
*
|
782
783
|
* @param title [String] the title
|
783
|
-
* @return [
|
784
|
+
* @return [void]
|
784
785
|
*
|
785
786
|
* @see #title
|
786
787
|
*/
|
@@ -870,7 +871,7 @@ static VALUE Window_fullscreen_mode(VALUE self)
|
|
870
871
|
* @param flag [Integer] 0 for window mode, {SDL2::Window::Flags::FULLSCREEN} for
|
871
872
|
* fullscreen mode, and {SDL2::Flags::Window::FULLSCREEN_DESKTOP} for fullscreen
|
872
873
|
* at the current desktop resolution.
|
873
|
-
* @return [
|
874
|
+
* @return [void]
|
874
875
|
*
|
875
876
|
* @see #fullscreen_mode
|
876
877
|
*/
|
@@ -884,7 +885,7 @@ static VALUE Window_set_fullscreen_mode(VALUE self, VALUE flags)
|
|
884
885
|
/*
|
885
886
|
* Get the size of the drawable region.
|
886
887
|
*
|
887
|
-
* @return [
|
888
|
+
* @return [Array(Integer, Integer)] the width and height of the region
|
888
889
|
*/
|
889
890
|
static VALUE Window_gl_drawable_size(VALUE self)
|
890
891
|
{
|
@@ -962,7 +963,7 @@ static VALUE Window_debug_info(VALUE self)
|
|
962
963
|
*
|
963
964
|
* @!attribute [r] name
|
964
965
|
* The name of the display
|
965
|
-
* @return [
|
966
|
+
* @return [String]
|
966
967
|
*
|
967
968
|
*/
|
968
969
|
|
@@ -1336,7 +1337,7 @@ static VALUE Renderer_clear(VALUE self)
|
|
1336
1337
|
|
1337
1338
|
/*
|
1338
1339
|
* Get the color used for drawing operations
|
1339
|
-
* @return [
|
1340
|
+
* @return [Array(Integer,Integer,Integer,Integer)]
|
1340
1341
|
* red, green, blue, and alpha components of the drawing color
|
1341
1342
|
* (all components are more than or equal to 0 and less than and equal to 255)
|
1342
1343
|
*
|
@@ -1364,12 +1365,10 @@ static VALUE Renderer_draw_color(VALUE self)
|
|
1364
1365
|
* * {#fill_rect}
|
1365
1366
|
* * {#clear}
|
1366
1367
|
*
|
1367
|
-
* @param [
|
1368
|
-
* red, green, and
|
1369
|
-
* @param [[Integer, Integer, Integer, Integer]] color
|
1370
|
-
* 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
|
1371
1370
|
*
|
1372
|
-
* @return [
|
1371
|
+
* @return [Array<Integer>]
|
1373
1372
|
*
|
1374
1373
|
* @see #draw_color
|
1375
1374
|
*/
|
@@ -1514,7 +1513,8 @@ static VALUE Renderer_clip_rect(VALUE self)
|
|
1514
1513
|
*
|
1515
1514
|
* Set the clip rectangle for the current target.
|
1516
1515
|
*
|
1517
|
-
* @
|
1516
|
+
* @param rect [SDL2::Rect]
|
1517
|
+
* @return [void]
|
1518
1518
|
* @see #clip_rect
|
1519
1519
|
*/
|
1520
1520
|
static VALUE Renderer_set_clip_rect(VALUE self, VALUE rect)
|
@@ -1538,7 +1538,7 @@ static VALUE Render_clip_enabled_p(VALUE self)
|
|
1538
1538
|
/*
|
1539
1539
|
* Get device indepndent resolution for rendering.
|
1540
1540
|
*
|
1541
|
-
* @return [
|
1541
|
+
* @return [Array(Integer, Integer)] the logical width and height
|
1542
1542
|
* @see #logical_size=
|
1543
1543
|
*/
|
1544
1544
|
static VALUE Renderer_logical_size(VALUE self)
|
@@ -1553,8 +1553,8 @@ static VALUE Renderer_logical_size(VALUE self)
|
|
1553
1553
|
*
|
1554
1554
|
* Set a device indepndent resolution for rendering.
|
1555
1555
|
*
|
1556
|
-
* @param w_and_h [
|
1557
|
-
* @return [
|
1556
|
+
* @param w_and_h [Array(Integer, Integer)] the width and height of the logical resolution
|
1557
|
+
* @return [void]
|
1558
1558
|
* @see #logical_size
|
1559
1559
|
*/
|
1560
1560
|
static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
|
@@ -1568,7 +1568,7 @@ static VALUE Renderer_set_logical_size(VALUE self, VALUE wh)
|
|
1568
1568
|
/*
|
1569
1569
|
* Get the drawing scale for the current target.
|
1570
1570
|
*
|
1571
|
-
* @return [
|
1571
|
+
* @return [Array(Integer, Integer)] horizontal and vertical scale factor
|
1572
1572
|
* @see #scale=
|
1573
1573
|
*/
|
1574
1574
|
static VALUE Renderer_scale(VALUE self)
|
@@ -1590,8 +1590,8 @@ static VALUE Renderer_scale(VALUE self)
|
|
1590
1590
|
* it will be handled using the appropriate
|
1591
1591
|
* quality hints. For best results use integer scaling factors.
|
1592
1592
|
*
|
1593
|
-
* @param scaleX_and_scaleY [
|
1594
|
-
* @return [
|
1593
|
+
* @param scaleX_and_scaleY [Array(Float, Float)] the horizontal and vertical scaling factors
|
1594
|
+
* @return [void]
|
1595
1595
|
* @see #scale
|
1596
1596
|
*/
|
1597
1597
|
static VALUE Renderer_set_scale(VALUE self, VALUE xy)
|
@@ -1621,7 +1621,7 @@ static VALUE Renderer_viewport(VALUE self)
|
|
1621
1621
|
* Set the drawing area for rendering on the current target.
|
1622
1622
|
*
|
1623
1623
|
* @param area [SDL2::Rect,nil] the drawing area, or nil to set the viewport to the entire target
|
1624
|
-
* @return [
|
1624
|
+
* @return [void]
|
1625
1625
|
* @see #viewport
|
1626
1626
|
*/
|
1627
1627
|
static VALUE Renderer_set_viewport(VALUE self, VALUE rect)
|
@@ -1643,7 +1643,7 @@ static VALUE Renderer_support_render_target_p(VALUE self)
|
|
1643
1643
|
/*
|
1644
1644
|
* Get the output size of a rendering context.
|
1645
1645
|
*
|
1646
|
-
* @return [
|
1646
|
+
* @return [Array(Integer, Integer)] the width and the height
|
1647
1647
|
*/
|
1648
1648
|
static VALUE Renderer_output_size(VALUE self)
|
1649
1649
|
{
|
@@ -1666,7 +1666,7 @@ static VALUE Renderer_output_size(VALUE self)
|
|
1666
1666
|
* @param [SDL2::Texture,nil] target the targeted texture, or nil
|
1667
1667
|
* for the default render target(i.e. screen)
|
1668
1668
|
*
|
1669
|
-
* @return [
|
1669
|
+
* @return [void]
|
1670
1670
|
*
|
1671
1671
|
* @see #render_target
|
1672
1672
|
*/
|
@@ -1776,6 +1776,8 @@ static VALUE Renderer_debug_info(VALUE self)
|
|
1776
1776
|
/*
|
1777
1777
|
* Destroy the texture and deallocate memory.
|
1778
1778
|
*
|
1779
|
+
* @return [void]
|
1780
|
+
*
|
1779
1781
|
* @see #destroy?
|
1780
1782
|
*/
|
1781
1783
|
static VALUE Texture_destroy(VALUE self)
|
@@ -1803,7 +1805,7 @@ static VALUE Texture_blend_mode(VALUE self)
|
|
1803
1805
|
* Set the blending model of the texture.
|
1804
1806
|
*
|
1805
1807
|
* @param mode [Integer] blending mode
|
1806
|
-
* @return [
|
1808
|
+
* @return [void]
|
1807
1809
|
*
|
1808
1810
|
* @see #blend_mode
|
1809
1811
|
*/
|
@@ -1833,7 +1835,7 @@ static VALUE Texture_alpha_mod(VALUE self)
|
|
1833
1835
|
*
|
1834
1836
|
* @param alpha [Integer] the alpha value multiplied into copy operation,
|
1835
1837
|
* from 0 to 255
|
1836
|
-
* @return [
|
1838
|
+
* @return [void]
|
1837
1839
|
*
|
1838
1840
|
* @see #alpha_mod
|
1839
1841
|
*/
|
@@ -1846,7 +1848,7 @@ static VALUE Texture_set_alpha_mod(VALUE self, VALUE alpha)
|
|
1846
1848
|
/*
|
1847
1849
|
* Get an additional color value used in render copy operations.
|
1848
1850
|
*
|
1849
|
-
* @return [
|
1851
|
+
* @return [Array(Integer, Integer, Integer)] the current red, green, and blue
|
1850
1852
|
* color value.
|
1851
1853
|
*/
|
1852
1854
|
static VALUE Texture_color_mod(VALUE self)
|
@@ -1860,9 +1862,9 @@ static VALUE Texture_color_mod(VALUE self)
|
|
1860
1862
|
* @overload color_mod=(rgb)
|
1861
1863
|
* Set an additional color value used in render copy operations.
|
1862
1864
|
*
|
1863
|
-
* @param rgb [
|
1865
|
+
* @param rgb [Array(Integer, Integer, Integer)] the red, green, and blue
|
1864
1866
|
* color value multiplied into copy operations.
|
1865
|
-
* @return [
|
1867
|
+
* @return [void]
|
1866
1868
|
*/
|
1867
1869
|
static VALUE Texture_set_color_mod(VALUE self, VALUE rgb)
|
1868
1870
|
{
|
@@ -2018,7 +2020,7 @@ static VALUE Surface_s_save_bmp(VALUE self, VALUE src, VALUE fname)
|
|
2018
2020
|
}
|
2019
2021
|
|
2020
2022
|
/*
|
2021
|
-
* @overload from_string(string, width,
|
2023
|
+
* @overload from_string(string, width, height, depth, pitch=nil, rmask=nil, gmask=nil, bmask=nil, amask=nil)
|
2022
2024
|
*
|
2023
2025
|
* Create a RGB surface from pixel data as String object.
|
2024
2026
|
*
|
@@ -2114,7 +2116,7 @@ static VALUE Surface_blend_mode(VALUE self)
|
|
2114
2116
|
* Set the blending mode of the surface used for blit operations.
|
2115
2117
|
*
|
2116
2118
|
* @param mode [Integer] the blending mode
|
2117
|
-
* @return [
|
2119
|
+
* @return [void]
|
2118
2120
|
* @see #blend_mode
|
2119
2121
|
*/
|
2120
2122
|
static VALUE Surface_set_blend_mode(VALUE self, VALUE mode)
|
@@ -2241,7 +2243,7 @@ static VALUE Surface_bytes_per_pixel(VALUE self)
|
|
2241
2243
|
*
|
2242
2244
|
* @param x [Integer] the x coordinate
|
2243
2245
|
* @param y [Integer] the y coordinate
|
2244
|
-
* @return [
|
2246
|
+
* @return [Array(Integer, Integer, Integer, Integer)]
|
2245
2247
|
* the red, green, blue, and alpha component of the specified pixel.
|
2246
2248
|
*
|
2247
2249
|
*/
|
@@ -2301,7 +2303,7 @@ static VALUE Surface_unset_color_key(VALUE self)
|
|
2301
2303
|
* the color key, pixel value (see {#pixel}) or pixel color (array of
|
2302
2304
|
* three or four integer elements).
|
2303
2305
|
*
|
2304
|
-
* @return [
|
2306
|
+
* @return [Integer, Array<Integer>] value
|
2305
2307
|
*
|
2306
2308
|
* @see #color_key
|
2307
2309
|
* @see #unset_color_key
|
@@ -2462,8 +2464,13 @@ static VALUE Surface_s_new(int argc, VALUE* argv, VALUE self)
|
|
2462
2464
|
* Height of the rectangle
|
2463
2465
|
* @return [Integer]
|
2464
2466
|
*
|
2465
|
-
* @!method self.[](
|
2467
|
+
* @!method self.[](x, y, w, h)
|
2466
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
|
2467
2474
|
* @return [SDL2::Rect]
|
2468
2475
|
*/
|
2469
2476
|
static VALUE Rect_s_allocate(VALUE klass)
|
@@ -2714,6 +2721,8 @@ PIXELFORMAT_ATTR_READER(fourcc_p, SDL_ISPIXELFORMAT_FOURCC, INT2BOOL);
|
|
2714
2721
|
* @overload ==(other)
|
2715
2722
|
* Return true if two pixel format is the same format.
|
2716
2723
|
*
|
2724
|
+
* @param other [SDL2::PixelFormat] other PixelFormat object
|
2725
|
+
*
|
2717
2726
|
* @return [Boolean]
|
2718
2727
|
*/
|
2719
2728
|
static VALUE PixelFormat_eq(VALUE self, VALUE other)
|
@@ -2833,45 +2842,45 @@ void rubysdl2_init_video(void)
|
|
2833
2842
|
#endif
|
2834
2843
|
rb_define_method(cWindow, "gl_swap", Window_gl_swap, 0);
|
2835
2844
|
|
2836
|
-
/* 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 */
|
2837
2846
|
rb_define_const(cWindow, "POS_CENTERED", INT2NUM(SDL_WINDOWPOS_CENTERED));
|
2838
|
-
/* Indicate that the window position should be centered */
|
2847
|
+
/* @return [Integer] Indicate that the window position should be centered */
|
2839
2848
|
rb_define_const(cWindow, "POS_UNDEFINED", INT2NUM(SDL_WINDOWPOS_UNDEFINED));
|
2840
2849
|
|
2841
2850
|
mWindowFlags = rb_define_module_under(cWindow, "Flags");
|
2842
2851
|
/* define(`DEFINE_WINDOW_FLAGS_CONST',`rb_define_const(mWindowFlags, "$1", UINT2NUM(SDL_WINDOW_$1))') */
|
2843
|
-
/* fullscreen window */
|
2852
|
+
/* @return [Integer] fullscreen window */
|
2844
2853
|
DEFINE_WINDOW_FLAGS_CONST(FULLSCREEN);
|
2845
|
-
/* fullscreen window at the current desktop resolution */
|
2854
|
+
/* @return [Integer] fullscreen window at the current desktop resolution */
|
2846
2855
|
DEFINE_WINDOW_FLAGS_CONST(FULLSCREEN_DESKTOP);
|
2847
|
-
/* window usable with OpenGL context */
|
2856
|
+
/* @return [Integer] window usable with OpenGL context */
|
2848
2857
|
DEFINE_WINDOW_FLAGS_CONST(OPENGL);
|
2849
|
-
/* window is visible */
|
2858
|
+
/* @return [Integer] window is visible */
|
2850
2859
|
DEFINE_WINDOW_FLAGS_CONST(SHOWN);
|
2851
|
-
/* window is not visible */
|
2860
|
+
/* @return [Integer] window is not visible */
|
2852
2861
|
DEFINE_WINDOW_FLAGS_CONST(HIDDEN);
|
2853
|
-
/* no window decoration */
|
2862
|
+
/* @return [Integer] no window decoration */
|
2854
2863
|
DEFINE_WINDOW_FLAGS_CONST(BORDERLESS);
|
2855
|
-
/* window is resizable */
|
2864
|
+
/* @return [Integer] window is resizable */
|
2856
2865
|
DEFINE_WINDOW_FLAGS_CONST(RESIZABLE);
|
2857
|
-
/* window is minimized */
|
2866
|
+
/* @return [Integer] window is minimized */
|
2858
2867
|
DEFINE_WINDOW_FLAGS_CONST(MINIMIZED);
|
2859
|
-
/* window is maximized */
|
2868
|
+
/* @return [Integer] window is maximized */
|
2860
2869
|
DEFINE_WINDOW_FLAGS_CONST(MAXIMIZED);
|
2861
|
-
/* window has grabbed input focus */
|
2870
|
+
/* @return [Integer] window has grabbed input focus */
|
2862
2871
|
DEFINE_WINDOW_FLAGS_CONST(INPUT_GRABBED);
|
2863
|
-
/* window has input focus */
|
2872
|
+
/* @return [Integer] window has input focus */
|
2864
2873
|
DEFINE_WINDOW_FLAGS_CONST(INPUT_FOCUS);
|
2865
|
-
/* window has mouse focus */
|
2874
|
+
/* @return [Integer] window has mouse focus */
|
2866
2875
|
DEFINE_WINDOW_FLAGS_CONST(MOUSE_FOCUS);
|
2867
|
-
/* window is not created by SDL */
|
2876
|
+
/* @return [Integer] window is not created by SDL */
|
2868
2877
|
DEFINE_WINDOW_FLAGS_CONST(FOREIGN);
|
2869
2878
|
#ifdef HAVE_CONST_SDL_WINDOW_ALLOW_HIGHDPI
|
2870
|
-
/* window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
|
2879
|
+
/* @return [Integer] window should be created in high-DPI mode if supported (>= SDL 2.0.1)*/
|
2871
2880
|
DEFINE_WINDOW_FLAGS_CONST(ALLOW_HIGHDPI);
|
2872
2881
|
#endif
|
2873
2882
|
#ifdef HAVE_CONST_SDL_WINDOW_MOUSE_CAPTURE
|
2874
|
-
/* window has mouse caputred (>= SDL 2.0.4) */
|
2883
|
+
/* @return [Integer] window has mouse caputred (>= SDL 2.0.4) */
|
2875
2884
|
DEFINE_WINDOW_FLAGS_CONST(MOUSE_CAPTURE);
|
2876
2885
|
#endif
|
2877
2886
|
|
@@ -2941,33 +2950,33 @@ void rubysdl2_init_video(void)
|
|
2941
2950
|
mRendererFlags = rb_define_module_under(cRenderer, "Flags");
|
2942
2951
|
|
2943
2952
|
/* define(`DEFINE_RENDERER_FLAGS_CONST',`rb_define_const(mRendererFlags, "$1", UINT2NUM(SDL_RENDERER_$1))') */
|
2944
|
-
/* the renderer is a software fallback */
|
2953
|
+
/* @return [Integer] the renderer is a software fallback */
|
2945
2954
|
DEFINE_RENDERER_FLAGS_CONST(SOFTWARE);
|
2946
|
-
/* the renderer uses hardware acceleration */
|
2955
|
+
/* @return [Integer] the renderer uses hardware acceleration */
|
2947
2956
|
DEFINE_RENDERER_FLAGS_CONST(ACCELERATED);
|
2948
2957
|
#ifdef HAVE_CONST_SDL_RENDERER_PRESENTVSYNC
|
2949
|
-
/* present is synchronized with the refresh rate */
|
2958
|
+
/* @return [Integer] present is synchronized with the refresh rate */
|
2950
2959
|
DEFINE_RENDERER_FLAGS_CONST(PRESENTVSYNC);
|
2951
2960
|
#endif
|
2952
|
-
/* the renderer supports rendering to texture */
|
2961
|
+
/* @return [Integer] the renderer supports rendering to texture */
|
2953
2962
|
DEFINE_RENDERER_FLAGS_CONST(TARGETTEXTURE);
|
2954
2963
|
/* define(`DEFINE_SDL_FLIP_CONST',`rb_define_const(cRenderer, "FLIP_$1", INT2FIX(SDL_FLIP_$1))') */
|
2955
|
-
/* Do not flip, used in {Renderer#copy_ex} */
|
2964
|
+
/* @return [Integer] Do not flip, used in {Renderer#copy_ex} */
|
2956
2965
|
DEFINE_SDL_FLIP_CONST(NONE);
|
2957
|
-
/* Flip horizontally, used in {Renderer#copy_ex} */
|
2966
|
+
/* @return [Integer] Flip horizontally, used in {Renderer#copy_ex} */
|
2958
2967
|
DEFINE_SDL_FLIP_CONST(HORIZONTAL);
|
2959
|
-
/* Flip vertically, used in {Renderer#copy_ex} */
|
2968
|
+
/* @return [Integer] Flip vertically, used in {Renderer#copy_ex} */
|
2960
2969
|
DEFINE_SDL_FLIP_CONST(VERTICAL);
|
2961
2970
|
|
2962
2971
|
mBlendMode = rb_define_module_under(mSDL2, "BlendMode");
|
2963
2972
|
/* define(`DEFINE_BLENDMODE_CONST',`rb_define_const(mBlendMode, "$1", INT2FIX(SDL_BLENDMODE_$1))') */
|
2964
|
-
/* no blending (dstRGBA = srcRGBA) */
|
2973
|
+
/* @return [Integer] no blending (dstRGBA = srcRGBA) */
|
2965
2974
|
DEFINE_BLENDMODE_CONST(NONE);
|
2966
|
-
/* 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)))*/
|
2967
2976
|
DEFINE_BLENDMODE_CONST(BLEND);
|
2968
|
-
/* additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
|
2977
|
+
/* @return [Integer] additive blending (dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA) */
|
2969
2978
|
DEFINE_BLENDMODE_CONST(ADD);
|
2970
|
-
/* color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
|
2979
|
+
/* @return [Integer] color modulate (multiplicative) (dstRGB = srcRGB * dstRGB, dstA = dstA) */
|
2971
2980
|
DEFINE_BLENDMODE_CONST(MOD);
|
2972
2981
|
|
2973
2982
|
cTexture = rb_define_class_under(mSDL2, "Texture", rb_cObject);
|
@@ -2985,11 +2994,11 @@ void rubysdl2_init_video(void)
|
|
2985
2994
|
rb_define_method(cTexture, "inspect", Texture_inspect, 0);
|
2986
2995
|
rb_define_method(cTexture, "debug_info", Texture_debug_info, 0);
|
2987
2996
|
/* define(`DEFINE_TEXTUREAH_ACCESS_CONST', `rb_define_const(cTexture, "ACCESS_$1", INT2NUM(SDL_TEXTUREACCESS_$1))') */
|
2988
|
-
/* texture access pattern - changes rarely, not lockable */
|
2997
|
+
/* @return [Integer] texture access pattern code - changes rarely, not lockable */
|
2989
2998
|
DEFINE_TEXTUREAH_ACCESS_CONST(STATIC);
|
2990
|
-
/* texture access pattern - changes frequently, lockable */
|
2999
|
+
/* @return [Integer] texture access pattern code - changes frequently, lockable */
|
2991
3000
|
DEFINE_TEXTUREAH_ACCESS_CONST(STREAMING);
|
2992
|
-
/* texture access pattern - can be used as a render target */
|
3001
|
+
/* @return [Integer] texture access pattern code - can be used as a render target */
|
2993
3002
|
DEFINE_TEXTUREAH_ACCESS_CONST(TARGET);
|
2994
3003
|
|
2995
3004
|
|
@@ -3013,7 +3022,7 @@ void rubysdl2_init_video(void)
|
|
3013
3022
|
rb_define_method(cSurface, "pixel_color", Surface_pixel_color, 2);
|
3014
3023
|
rb_define_method(cSurface, "color_key", Surface_color_key, 0);
|
3015
3024
|
rb_define_method(cSurface, "color_key=", Surface_set_color_key, 1);
|
3016
|
-
rb_define_method(cSurface, "unset_color_key",
|
3025
|
+
rb_define_method(cSurface, "unset_color_key", Surface_unset_color_key, 0);
|
3017
3026
|
rb_define_method(cSurface, "pixels", Surface_pixels, 0);
|
3018
3027
|
rb_define_method(cSurface, "pitch", Surface_pitch, 0);
|
3019
3028
|
rb_define_method(cSurface, "bits_per_pixel", Surface_bits_per_pixel, 0);
|
@@ -3065,7 +3074,8 @@ void rubysdl2_init_video(void)
|
|
3065
3074
|
rb_define_method(cPixelFormat, "==", PixelFormat_eq, 1);
|
3066
3075
|
|
3067
3076
|
mPixelType = rb_define_module_under(cPixelFormat, "Type");
|
3068
|
-
/* define(`DEFINE_PIXELTYPE_CONST'
|
3077
|
+
/* define(`DEFINE_PIXELTYPE_CONST',`/$8* @return [Integer] *$8/
|
3078
|
+
rb_define_const(mPixelType, "$1", UINT2NUM(SDL_PIXELTYPE_$1))') */
|
3069
3079
|
DEFINE_PIXELTYPE_CONST(UNKNOWN);
|
3070
3080
|
DEFINE_PIXELTYPE_CONST(INDEX1);
|
3071
3081
|
DEFINE_PIXELTYPE_CONST(INDEX4);
|
@@ -3080,12 +3090,17 @@ void rubysdl2_init_video(void)
|
|
3080
3090
|
DEFINE_PIXELTYPE_CONST(ARRAYF32);
|
3081
3091
|
|
3082
3092
|
mBitmapOrder = rb_define_module_under(cPixelFormat, "BitmapOrder");
|
3093
|
+
/* @return [Integer] */
|
3083
3094
|
rb_define_const(mBitmapOrder, "NONE", UINT2NUM(SDL_BITMAPORDER_NONE));
|
3095
|
+
/* @return [Integer] */
|
3084
3096
|
rb_define_const(mBitmapOrder, "O_1234", UINT2NUM(SDL_BITMAPORDER_1234));
|
3097
|
+
/* @return [Integer] */
|
3085
3098
|
rb_define_const(mBitmapOrder, "O_4321", UINT2NUM(SDL_BITMAPORDER_4321));
|
3086
3099
|
|
3087
3100
|
mPackedOrder = rb_define_module_under(cPixelFormat, "PackedOrder");
|
3088
|
-
/*
|
3101
|
+
/*
|
3102
|
+
define(`DEFINE_PACKEDORDER_CONST',`/$8* @return [Integer] *$8/
|
3103
|
+
rb_define_const(mPackedOrder, "$1", UINT2NUM(SDL_PACKEDORDER_$1))') */
|
3089
3104
|
DEFINE_PACKEDORDER_CONST(NONE);
|
3090
3105
|
DEFINE_PACKEDORDER_CONST(XRGB);
|
3091
3106
|
DEFINE_PACKEDORDER_CONST(RGBX);
|
@@ -3097,7 +3112,8 @@ void rubysdl2_init_video(void)
|
|
3097
3112
|
DEFINE_PACKEDORDER_CONST(BGRA);
|
3098
3113
|
|
3099
3114
|
mArrayOrder = rb_define_module_under(cPixelFormat, "ArrayOrder");
|
3100
|
-
/* define(`DEFINE_ARRAYORDER_CONST'
|
3115
|
+
/* define(`DEFINE_ARRAYORDER_CONST',`/$8* @return [Integer] *$8/
|
3116
|
+
rb_define_const(mArrayOrder, "$1", UINT2NUM(SDL_ARRAYORDER_$1))') */
|
3101
3117
|
DEFINE_ARRAYORDER_CONST(NONE);
|
3102
3118
|
DEFINE_ARRAYORDER_CONST(RGB);
|
3103
3119
|
DEFINE_ARRAYORDER_CONST(RGBA);
|
@@ -3107,7 +3123,9 @@ void rubysdl2_init_video(void)
|
|
3107
3123
|
DEFINE_ARRAYORDER_CONST(ABGR);
|
3108
3124
|
|
3109
3125
|
mPackedLayout = rb_define_module_under(cPixelFormat, "PackedLayout");
|
3110
|
-
/* define(`DEFINE_PACKEDLAYOUT_CONST'
|
3126
|
+
/* define(`DEFINE_PACKEDLAYOUT_CONST',`/$8* @return [Integer] *$8/
|
3127
|
+
rb_define_const(mPackedLayout, "L_$1", UINT2NUM(SDL_PACKEDLAYOUT_$1))') */
|
3128
|
+
/* @return [Integer] */
|
3111
3129
|
rb_define_const(mPackedLayout, "NONE", UINT2NUM(SDL_PACKEDLAYOUT_NONE));
|
3112
3130
|
DEFINE_PACKEDLAYOUT_CONST(332);
|
3113
3131
|
DEFINE_PACKEDLAYOUT_CONST(4444);
|
@@ -3120,17 +3138,17 @@ void rubysdl2_init_video(void)
|
|
3120
3138
|
|
3121
3139
|
{
|
3122
3140
|
VALUE formats = rb_ary_new();
|
3123
|
-
/* -: Array of all available formats */
|
3141
|
+
/* -: @return [Array<SDL2::PixelFormat>] array of all available formats */
|
3124
3142
|
rb_define_const(cPixelFormat, "FORMATS", formats);
|
3125
3143
|
/* define(`DEFINE_PIXELFORMAT_CONST',`do {
|
3126
3144
|
VALUE format = PixelFormat_new(SDL_PIXELFORMAT_$1);
|
3127
|
-
$2
|
3145
|
+
/$8* -: @return [SDL2::PixelFormat] $2 *$8/
|
3128
3146
|
rb_define_const(cPixelFormat, "$1", format);
|
3129
3147
|
rb_ary_push(formats, format);
|
3130
3148
|
} while (0)')
|
3131
3149
|
*/
|
3132
3150
|
|
3133
|
-
DEFINE_PIXELFORMAT_CONST(UNKNOWN,
|
3151
|
+
DEFINE_PIXELFORMAT_CONST(UNKNOWN, Unused - reserved by SDL);
|
3134
3152
|
DEFINE_PIXELFORMAT_CONST(INDEX1LSB);
|
3135
3153
|
DEFINE_PIXELFORMAT_CONST(INDEX1MSB);
|
3136
3154
|
DEFINE_PIXELFORMAT_CONST(INDEX4LSB);
|
@@ -3285,13 +3303,13 @@ void rubysdl2_init_image(void)
|
|
3285
3303
|
rb_define_method(cRenderer, "load_texture", Renderer_load_texture, 1);
|
3286
3304
|
|
3287
3305
|
|
3288
|
-
/* Initialize the JPEG loader */
|
3306
|
+
/* @return [Integer] Initialize the JPEG loader */
|
3289
3307
|
rb_define_const(mIMG, "INIT_JPG", INT2NUM(IMG_INIT_JPG));
|
3290
|
-
/* Initialize the PNG loader */
|
3308
|
+
/* @return [Integer] Initialize the PNG loader */
|
3291
3309
|
rb_define_const(mIMG, "INIT_PNG", INT2NUM(IMG_INIT_PNG));
|
3292
|
-
/* Initialize the TIF loader */
|
3310
|
+
/* @return [Integer] Initialize the TIF loader */
|
3293
3311
|
rb_define_const(mIMG, "INIT_TIF", INT2NUM(IMG_INIT_TIF));
|
3294
|
-
/* Initialize the WEBP loader */
|
3312
|
+
/* @return [Integer] Initialize the WEBP loader */
|
3295
3313
|
rb_define_const(mIMG, "INIT_WEBP", INT2NUM(IMG_INIT_WEBP));
|
3296
3314
|
}
|
3297
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
|
+
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:
|
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,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
102
|
- !ruby/object:Gem::Version
|
99
103
|
version: '0'
|
100
104
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.4.10
|
102
106
|
signing_key:
|
103
107
|
specification_version: 4
|
104
108
|
summary: The simple ruby extension library for SDL 2.x
|