Module: MilkTea::VendoredRaylib
- Defined in:
- lib/milk_tea/bindings/vendored_raylib.rb
Defined Under Namespace
Classes: AdaptiveArchive
Constant Summary collapse
- Error =
VendoredCLibrary::Error
- SOURCES =
%w[ rcore.c rshapes.c rtextures.c rtext.c rmodels.c raudio.c ].freeze
- DESKTOP_DEFINES =
%w[ PLATFORM_DESKTOP_GLFW GRAPHICS_API_OPENGL_43 ].freeze
- DESKTOP_SYSTEM_LINK_FLAGS =
%w[ -lglfw -lm -ldl -lpthread -lrt -lX11 ].freeze
- WASM_DEFINES =
%w[ PLATFORM_WEB GRAPHICS_API_OPENGL_ES2 MA_ENABLE_AUDIO_WORKLETS ].freeze
- WASM_SYSTEM_LINK_FLAGS =
%w[ -sUSE_GLFW=3 -sAUDIO_WORKLET=1 -sWASM_WORKERS=1 -sASYNCIFY ].freeze
- WASM_COMPILE_FLAGS =
%w[ -sAUDIO_WORKLET=1 -sWASM_WORKERS=1 ].freeze
Class Method Summary collapse
- .archive_path(root: MilkTea.root, platform: nil) ⇒ Object
- .build_root(root: MilkTea.root, platform: nil) ⇒ Object
- .library(root: MilkTea.root) ⇒ Object
- .link_flags(root: MilkTea.root, platform: nil) ⇒ Object
- .prepare!(root: MilkTea.root, platform: nil, **kwargs) ⇒ Object
- .source_root(root: MilkTea.root) ⇒ Object
Class Method Details
.archive_path(root: MilkTea.root, platform: nil) ⇒ Object
119 120 121 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 119 def archive_path(root: MilkTea.root, platform: nil) build_root(root:, platform:).join("libraylib.a") end |
.build_root(root: MilkTea.root, platform: nil) ⇒ Object
114 115 116 117 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 114 def build_root(root: MilkTea.root, platform: nil) suffix = platform == :wasm ? "tmp/vendored-raylib-web" : "tmp/vendored-raylib-opengl43" MilkTea.writable_root_for(root).join(suffix) end |
.library(root: MilkTea.root) ⇒ Object
104 105 106 107 108 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 104 def library(root: MilkTea.root) resolved_root = Pathname.new(File.(root.to_s)) @libraries ||= {} @libraries[resolved_root.to_s] ||= AdaptiveArchive.new(root: resolved_root) end |
.link_flags(root: MilkTea.root, platform: nil) ⇒ Object
123 124 125 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 123 def link_flags(root: MilkTea.root, platform: nil) library(root:).link_flags(platform:) end |
.prepare!(root: MilkTea.root, platform: nil, **kwargs) ⇒ Object
127 128 129 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 127 def prepare!(root: MilkTea.root, platform: nil, **kwargs) library(root:).prepare!(platform:, **kwargs) end |
.source_root(root: MilkTea.root) ⇒ Object
110 111 112 |
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 110 def source_root(root: MilkTea.root) MilkTea.writable_root_for(root).join("third_party/raylib-upstream/src") end |