summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/window.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb
index 5889c5d..69a4222 100644
--- a/lib/ruby2d/window.rb
+++ b/lib/ruby2d/window.rb
@@ -6,6 +6,7 @@ module Ruby2D
def initialize(width: 640, height: 480, title: "Ruby 2D", fps: 60, vsync: true)
@width, @height, @title = width, height, title
+ @background = Color.new([0.0, 0.0, 0.0, 1.0])
@mouse_x = @mouse_y = 0
@fps_cap = fps
@fps = 60
@@ -34,6 +35,9 @@ module Ruby2D
@title = opts[:title] || @title
@width = opts[:width] || @width
@height = opts[:height] || @height
+ if Color.is_valid? opts[:background]
+ @background = Color.new(opts[:background])
+ end
end
def add(o)