rubydraw 0.3.2.1 → 0.3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rubydraw/flags.rb +4 -0
- data/lib/rubydraw/window.rb +6 -4
- metadata +2 -2
data/lib/rubydraw/flags.rb
CHANGED
@@ -14,7 +14,11 @@ module Rubydraw
|
|
14
14
|
num | total}
|
15
15
|
end
|
16
16
|
|
17
|
+
HardwareSurface, HWSurface = SDL::HWSURFACE, SDL::HWSURFACE
|
18
|
+
SoftwareSurface, SWSurface = SDL::SWSURFACE, SDL::SWSURFACE
|
19
|
+
DoubleBuffered, DoubleBuf = SDL::DOUBLEBUF, SDL::DOUBLEBUF
|
17
20
|
Fullscreen = SDL::FULLSCREEN
|
18
21
|
Resizable = SDL::RESIZABLE
|
22
|
+
Frameless, Noframe = SDL::NOFRAME, SDL::NOFRAME
|
19
23
|
end
|
20
24
|
end
|
data/lib/rubydraw/window.rb
CHANGED
@@ -8,9 +8,9 @@ module Rubydraw
|
|
8
8
|
attr_accessor(:bkg_color)
|
9
9
|
|
10
10
|
# Create a new window.
|
11
|
-
def initialize(dimensions, flags=[], bkg_color=Color::Black)
|
11
|
+
def initialize(dimensions, flags=[], bkg_color=Color::Black, persistent=false)
|
12
12
|
width, height = dimensions.to_ary
|
13
|
-
@fullscreen = flags.include?(Rubydraw::Flags::Fullscreen)
|
13
|
+
@fullscreen, @persistent = flags.include?(Rubydraw::Flags::Fullscreen), persistent
|
14
14
|
if width < 0
|
15
15
|
raise SDLError, "New window width cannot be less than zero"
|
16
16
|
end
|
@@ -70,8 +70,10 @@ module Rubydraw
|
|
70
70
|
loop do
|
71
71
|
handle_events
|
72
72
|
if @open
|
73
|
-
|
74
|
-
|
73
|
+
unless @persistent
|
74
|
+
# Clear the contents of the window
|
75
|
+
clear
|
76
|
+
end
|
75
77
|
tick
|
76
78
|
# Update the screen to show any changes.
|
77
79
|
SDL::UpdateRect(@screen, 0, 0, 0, 0)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rubydraw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.2.
|
5
|
+
version: 0.3.2.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- J. Wostenberg
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-02-04 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|