gosu 0.7.24 → 0.7.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 1.3.39
3
+ * Version 2.0.1
4
4
  *
5
5
  * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -193,15 +193,12 @@ struct Gosu::Window::Impl
193
193
  {
194
194
  NSRect rect = NSMakeRect(0, 0, width, height);
195
195
  unsigned style = NSTitledWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask;
196
- window.reset([[GosuWindow alloc] initWithContentRect: rect styleMask:style
197
- backing:NSBackingStoreBuffered defer:YES]);
196
+ window.reset([[GosuWindow alloc] initWithContentRect:rect styleMask:style
197
+ backing:NSBackingStoreBuffered defer:NO]);
198
198
  [window.obj() retain]; // TODO: Why?
199
199
 
200
200
  [window.obj() setContentView: [[GosuView alloc] init]];
201
-
202
201
  [window.obj() center];
203
- [window.obj() makeKeyAndOrderFront:nil];
204
- [[window.obj() contentView] display];
205
202
  }
206
203
 
207
204
  static void doTick(Window& window);
@@ -287,9 +284,7 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
287
284
  realWidth *= factor, realHeight *= factor;
288
285
 
289
286
  pimpl->createWindow(realWidth, realHeight);
290
-
291
287
  // Tell context to draw on this window.
292
-
293
288
  [pimpl->context.obj() setView:[pimpl->window.obj() contentView]];
294
289
  }
295
290
 
@@ -314,6 +309,8 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
314
309
  [pimpl->window.obj() setDelegate: pimpl->forwarder.obj()];
315
310
  [pimpl->window.obj() setInput: pimpl->input.get()];
316
311
  [(GosuView*)[pimpl->window.obj() contentView] setInput: pimpl->input.get()];
312
+ // Finally, safely hide the window.
313
+ [pimpl->window.obj() orderOut:nil];
317
314
  }
318
315
 
319
316
  pimpl->interval = updateInterval;
@@ -377,11 +374,12 @@ void Gosu::Window::show()
377
374
  // Start drawing in fullscreen
378
375
  [pimpl->context.obj() setFullScreen];
379
376
  }
377
+ else
378
+ [pimpl->window.obj() makeKeyAndOrderFront:nil];
380
379
 
381
380
  NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval: pimpl->interval / 1000.0
382
381
  target:pimpl->forwarder.obj() selector:@selector(doTick:)
383
382
  userInfo:nil repeats:YES];
384
- update();
385
383
  [NSApp run];
386
384
  [timer invalidate];
387
385
 
@@ -392,6 +390,10 @@ void Gosu::Window::show()
392
390
  CGDisplaySwitchToMode(kCGDirectMainDisplay, pimpl->savedMode);
393
391
  CGDisplayRelease(kCGDirectMainDisplay);
394
392
  }
393
+ else
394
+ {
395
+ [pimpl->window.obj() orderOut:nil];
396
+ }
395
397
  }
396
398
 
397
399
  void Gosu::Window::close()
@@ -344,9 +344,9 @@ void Gosu::Window::show()
344
344
  {
345
345
  Win::processMessages();
346
346
 
347
- // Whyever this would happen...!
348
347
  if (!::IsWindowVisible(handle()))
349
348
  {
349
+ // TODO: Find out what the Sleep here is doing...
350
350
  Sleep(50);
351
351
  return;
352
352
  }
data/examples/CptnRuby.rb CHANGED
@@ -25,13 +25,7 @@
25
25
  # ...Enemies, a more sophisticated object system, weapons, title and credits
26
26
  # screens...
27
27
 
28
- begin
29
- # In case you use Gosu via rubygems.
30
- require 'rubygems'
31
- rescue LoadError
32
- # In case you don't.
33
- end
34
-
28
+ require 'rubygems'
35
29
  require 'gosu'
36
30
  include Gosu
37
31
 
@@ -3,13 +3,7 @@
3
3
  # the block given to Window#gl, and that Gosu Images can be
4
4
  # used as textures using the gl_tex_info call.
5
5
 
6
- begin
7
- # In case you use Gosu via RubyGems.
8
- require 'rubygems'
9
- rescue LoadError
10
- # In case you don't.
11
- end
12
-
6
+ require 'rubygems'
13
7
  require 'gosu'
14
8
  require 'gl'
15
9
  require 'glu'
@@ -11,13 +11,7 @@
11
11
  # * The look of dead soldiers is, err, by accident. Soldier.png needs to be
12
12
  # designed in a less obfuscated way :)
13
13
 
14
- begin
15
- # In case you use Gosu via RubyGems.
16
- require 'rubygems'
17
- rescue LoadError
18
- # In case you don't.
19
- end
20
-
14
+ require 'rubygems'
21
15
  require 'gosu'
22
16
  require 'RMagick'
23
17
 
@@ -18,13 +18,7 @@
18
18
  # presented here is not mandatory! Gosu only aims to provide enough code for
19
19
  # games (or intermediate UI toolkits) to be built upon it.
20
20
 
21
- begin
22
- # In case you use Gosu via RubyGems.
23
- require 'rubygems'
24
- rescue LoadError
25
- # In case you don't.
26
- end
27
-
21
+ require 'rubygems'
28
22
  require 'gosu'
29
23
 
30
24
  class TextField < Gosu::TextInput
data/examples/Tutorial.rb CHANGED
@@ -1,10 +1,4 @@
1
- begin
2
- # In case you use Gosu via RubyGems.
3
- require 'rubygems'
4
- rescue LoadError
5
- # In case you don't.
6
- end
7
-
1
+ require 'rubygems'
8
2
  require 'gosu'
9
3
 
10
4
  module ZOrder
data/lib/gosu/patches.rb CHANGED
@@ -39,17 +39,28 @@ end
39
39
 
40
40
  # Color constants (SWIG messes up constants somehow)
41
41
  class Gosu::Color
42
- NONE = Gosu::Color.new(0x00000000)
43
- BLACK = Gosu::Color.new(0xff000000)
44
- GRAY = Gosu::Color.new(0xff808080)
45
- WHITE = Gosu::Color.new(0xffffffff)
46
- AQUA = Gosu::Color.new(0xff00ffff)
47
- RED = Gosu::Color.new(0xffff0000)
48
- GREEN = Gosu::Color.new(0xff00ff00)
49
- BLUE = Gosu::Color.new(0xff0000ff)
50
- YELLOW = Gosu::Color.new(0xffffff00)
51
- FUCHSIA = Gosu::Color.new(0xffff00ff)
52
- CYAN = Gosu::Color.new(0xff00ffff)
42
+ class Constant < Gosu::Color
43
+ private
44
+ def alpha=; end
45
+ def red=; end
46
+ def green=; end
47
+ def blue=; end
48
+ def hue=; end
49
+ def saturation=; end
50
+ def value=; end
51
+ end
52
+
53
+ NONE = Gosu::Color::Constant.new(0x00000000)
54
+ BLACK = Gosu::Color::Constant.new(0xff000000)
55
+ GRAY = Gosu::Color::Constant.new(0xff808080)
56
+ WHITE = Gosu::Color::Constant.new(0xffffffff)
57
+ AQUA = Gosu::Color::Constant.new(0xff00ffff)
58
+ RED = Gosu::Color::Constant.new(0xffff0000)
59
+ GREEN = Gosu::Color::Constant.new(0xff00ff00)
60
+ BLUE = Gosu::Color::Constant.new(0xff0000ff)
61
+ YELLOW = Gosu::Color::Constant.new(0xffffff00)
62
+ FUCHSIA = Gosu::Color::Constant.new(0xffff00ff)
63
+ CYAN = Gosu::Color::Constant.new(0xff00ffff)
53
64
  end
54
65
 
55
66
  # Instance methods for button_id_to_char and char_to_button_id
data/lib/gosu.rb CHANGED
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 24
10
- version: 0.7.24
9
+ - 25
10
+ version: 0.7.25
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julian Raschke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-08 00:00:00 +08:00
19
+ date: 2010-11-02 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies: []
22
22