diff options
| -rw-r--r-- | .yardoc/checksums | 5 | ||||
| -rw-r--r-- | .yardoc/object_types | bin | 4911 -> 826 bytes | |||
| -rw-r--r-- | .yardoc/objects/root.dat | bin | 70777 -> 14231 bytes | |||
| -rw-r--r-- | .yardopts | 12 | ||||
| -rw-r--r-- | Rakefile | 6 | ||||
| -rw-r--r-- | include/raylib/core.h | 2 | ||||
| -rw-r--r-- | mrbdoc/core.rb | 36 | ||||
| -rw-r--r-- | src/core.c | 20 | ||||
| -rw-r--r-- | src/raylib.c | 8 |
9 files changed, 68 insertions, 21 deletions
diff --git a/.yardoc/checksums b/.yardoc/checksums index a2753d5..32e6e7d 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,3 +1,2 @@ -src/core.c 53bf1c494a689b572f53c53d66fc53ed075ba02d -src/raylib.c 4a1f98604efd36c06c77d3eee319786851ae993e -mrblib/raylib.rb 98d89744b3ffefff688c982d791944043c83bd2d +mrblib/raylib.rb ce42382655c9ad1b0aa789cfb6d45d08be4eaf94 +mrbdoc/core.rb 5369d0cc12c20c57c3a60cccd64d624ee5070f87 diff --git a/.yardoc/object_types b/.yardoc/object_types Binary files differindex ae4930b..000a2c5 100644 --- a/.yardoc/object_types +++ b/.yardoc/object_types diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat Binary files differindex 136aa91..146720f 100644 --- a/.yardoc/objects/root.dat +++ b/.yardoc/objects/root.dat @@ -1,11 +1,11 @@ +--embed-mixin ClassMethods + --markup markdown +--markup textile --markup rdoc ---plugin mruby --output-dir ./docs -src/**/*.c mrblib/**/*.rb -include/**/*.h - -src/*.c -./mrblib/*.rb +mrblib/*.rb +mrbdoc/**/*.rb +mrbdoc/*.rb @@ -9,6 +9,12 @@ task default: [:api] # t.stats_options = ['--list-undoc'] #end # +YARD::Rake::YardocTask.new do |t| + t.files = ['mrblib/raylib.rb', 'mrbdoc/core.rb'] # ['system_manager.rb', 'component_manager.rb', 'entity_manager.rb', 'scene_manager.rb', 'stage_manager.rb', 'felecs.rb'] + t.options = ['--output-dir', './docs', 'yardoc --markup=markdown|textile|rdoc(default)'] + t.stats_options = ['--list-undoc'] +end + desc 'generate yard docs' task :api do begin diff --git a/include/raylib/core.h b/include/raylib/core.h index b327cec..4d27650 100644 --- a/include/raylib/core.h +++ b/include/raylib/core.h @@ -9,7 +9,7 @@ #include <emscripten/emscripten.h> #endif -void mrb_raylib_core_init(mrb_state*); +void mrb_init_raylib_core(mrb_state*); #endif /* end of include guard MRUBY_RAYLIB_CORE_H */ diff --git a/mrbdoc/core.rb b/mrbdoc/core.rb new file mode 100644 index 0000000..828bb48 --- /dev/null +++ b/mrbdoc/core.rb @@ -0,0 +1,36 @@ + +class Rect + # yardoc garbage test + # + # @param poo [Integer] this is more + def yep(stuff) + end +end + +module Raylib + class << self + + # Initialize window and OpenGL context. + # + # @param width [Integer] width ye + # @param height [Integer] height ye + # @param title [String] title ye + # @return (Nil) + + # Creates a new {FelECS::ComponentManager component manager}. + # + # @example + # # Here color is set to default to red + # # while max and current are nil until set. + # # When you make a new component using this component manager + # # these are the values and accessors it will have. + # FelECS::Component.new('Health', :max, :current, color: 'red') + # + # @param width [String] Name of your new component manager. Must be stylized in the format of constants in Ruby + # @param height [:Symbols] New components made with this manager will include these symbols as accessors, the values of these accessors will default to nil + # @param title [Keyword: DefaultValue] New components made with this manager will include these keywords as accessors, their defaults set to the values given to the keywords + # @return [ComponentManager] + def init_window(width: 800, height: 600, title: "Hello World from FelFlame!") + end + end +end @@ -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()); } diff --git a/src/raylib.c b/src/raylib.c index 6af8179..36b4550 100644 --- a/src/raylib.c +++ b/src/raylib.c @@ -865,11 +865,6 @@ mrb_call_main_loop(mrb_state* mrb, mrb_value self) { return mrb_funcall(mrb, mrb_obj_value(c), "main_loop", 0); } -static mrb_value -mrb_window_should_close(mrb_state* mrb, mrb_value self) { - return mrb_bool_value(WindowShouldClose()); -} - #if defined(PLATFORM_WEB) static mrb_value mrb_emscripten_set_main_loop(mrb_state* mrb, mrb_value self) { @@ -1012,7 +1007,7 @@ mrb_Rectangle_draw_rectangle_lines_ex(mrb_state* mrb, mrb_value self) { void mrb_mruby_raylib_gem_init(mrb_state* mrb) { - mrb_raylib_core_init(mrb); + mrb_init_raylib_core(mrb); struct RClass *raylib = mrb_define_module(mrb, "Raylib"); mrb_define_module_function(mrb, raylib, "platform", mrb_platform, MRB_ARGS_NONE()); @@ -1021,7 +1016,6 @@ mrb_mruby_raylib_gem_init(mrb_state* mrb) { mrb_define_module_function(mrb, raylib, "end_drawing", mrb_end_drawing, MRB_ARGS_NONE()); mrb_define_module_function(mrb, raylib, "clear_background", mrb_clear_background, MRB_ARGS_REQ(1)); mrb_define_module_function(mrb, raylib, "call_main_loop", mrb_call_main_loop, MRB_ARGS_NONE()); - mrb_define_module_function(mrb, raylib, "window_should_close?", mrb_window_should_close, MRB_ARGS_NONE()); mrb_define_module_function(mrb, raylib, "target_fps=", mrb_target_fps, MRB_ARGS_REQ(1)); mrb_define_module_function(mrb, raylib, "fps", mrb_fps, MRB_ARGS_NONE()); mrb_define_module_function(mrb, raylib, "frame_time", mrb_frame_time, MRB_ARGS_NONE()); |
