blob: 305f065a5f6c0286e5059206917a53ba83035342 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Ruby2D module and native extension loader, adds DSL
unless RUBY_ENGINE == 'mruby'
require 'ruby2d/colorize'
require 'ruby2d/exceptions'
require 'ruby2d/renderable'
require 'ruby2d/color'
require 'ruby2d/window'
require 'ruby2d/dsl'
require 'ruby2d/quad'
require 'ruby2d/line'
require 'ruby2d/circle'
require 'ruby2d/rectangle'
require 'ruby2d/square'
require 'ruby2d/triangle'
require 'ruby2d/image'
require 'ruby2d/sprite'
require 'ruby2d/font'
require 'ruby2d/text'
require 'ruby2d/sound'
require 'ruby2d/music'
if RUBY_PLATFORM =~ /mingw/
# When using the Windows CI AppVeyor
if ENV['APPVEYOR']
s2d_dll_path = 'C:\msys64\usr\local\bin'
# When in a standard MinGW shell
else
s2d_dll_path = '~/../../usr/local/bin'
end
RubyInstaller::Runtime.add_dll_directory(File.expand_path(s2d_dll_path))
end
require 'ruby2d/ruby2d' # load native extension
end
module Ruby2D
@assets = nil
class << self
def assets
unless @assets
if RUBY_ENGINE == 'mruby'
@assets = Ruby2D.ext_base_path + 'assets'
else
@assets = './assets'
end
end
@assets
end
def assets=(path); @assets = path end
end
end
include Ruby2D
extend Ruby2D::DSL
|