diff options
| author | realtradam <[email protected]> | 2022-02-04 01:06:43 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-02-04 01:06:43 -0500 |
| commit | 0c4da40c3e9589255d07cf4d4dc370575b202afa (patch) | |
| tree | 3f327aeee37fe3bcc4a624d4f8b15f6412b042cd /src/core.c | |
| parent | c2984380a21ed10aeb7eb030b5b88431a7dad204 (diff) | |
| download | mruby-raylib-0c4da40c3e9589255d07cf4d4dc370575b202afa.tar.gz mruby-raylib-0c4da40c3e9589255d07cf4d4dc370575b202afa.zip | |
testing yard stuff
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1,17 +1,21 @@ #include "raylib/core.h" /* + * @overload init_window(screen_width: 800, screen_height: 600, title: "Hello World from FelFlame!") + * @param [Integer] width ye * @overload init_window(screen_width, screen_height, title) * * Initialize window and OpenGL context. * * *Parameters:* * - * * *screen_width* (+Integer+) + * * *width* (+Integer+) * - * * *screen_height* (+Integer+) + * * *height* (+Integer+) * * * *title* (+String+) + * + * @return (Nil) */ static mrb_value mrb_init_window(mrb_state* mrb, mrb_value self) { @@ -21,7 +25,7 @@ mrb_init_window(mrb_state* mrb, mrb_value self) { uint32_t kw_num = 3; const mrb_sym kw_names[] = { - mrb_intern_lit(mrb, "width"), + mrb_intern_lit(mrb, "width"), mrb_intern_lit(mrb, "height"), mrb_intern_lit(mrb, "title"), }; @@ -44,8 +48,16 @@ mrb_init_window(mrb_state* mrb, mrb_value self) { return mrb_nil_value(); } + +static mrb_value +mrb_window_should_close(mrb_state* mrb, mrb_value self) { + return mrb_bool_value(WindowShouldClose()); +} + + void -mrb_raylib_core_init(mrb_state* mrb) { +mrb_init_raylib_core(mrb_state* mrb) { struct RClass *raylib = mrb_define_module(mrb, "Raylib"); mrb_define_module_function(mrb, raylib, "init_window", mrb_init_window, MRB_ARGS_OPT(3)); + mrb_define_module_function(mrb, raylib, "window_should_close?", mrb_window_should_close, MRB_ARGS_NONE()); } |
