gosu 0.7.25-i386-mingw32 → 0.7.26-i386-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,124 @@
1
+ //! \file Window.hpp
2
+ //! Interface of the Window class.
3
+
4
+ #ifndef GOSU_WINDOW_HPP
5
+ #define GOSU_WINDOW_HPP
6
+
7
+ #include <Gosu/Fwd.hpp>
8
+ #include <Gosu/Platform.hpp>
9
+ #include <Gosu/Input.hpp>
10
+ #include <boost/scoped_ptr.hpp>
11
+ #include <boost/shared_ptr.hpp>
12
+ #include <boost/function.hpp>
13
+ #include <string>
14
+
15
+ #ifdef GOSU_IS_WIN
16
+ #ifndef NOMINMAX
17
+ #define NOMINMAX
18
+ #endif
19
+ #include <windows.h>
20
+ #endif
21
+
22
+ namespace Gosu
23
+ {
24
+ //! Convenient all-in-one class that serves as the foundation of a standard
25
+ //! Gosu application. Manages initialization of all of Gosu's core components
26
+ //! and provides timing functionality.
27
+ //! Note that you should really only use on instance of this class at the same time.
28
+ //! This may or may not change later.
29
+ class Window
30
+ {
31
+ struct Impl;
32
+ boost::scoped_ptr<Impl> pimpl;
33
+
34
+ public:
35
+ //! Constructs a Window.
36
+ //! \param updateInterval Interval in milliseconds between two calls
37
+ //! to the update member function.
38
+ Window(unsigned width, unsigned height, bool fullscreen,
39
+ double updateInterval = 16.666666);
40
+ virtual ~Window();
41
+
42
+ std::wstring caption() const;
43
+ void setCaption(const std::wstring& caption);
44
+
45
+ double updateInterval() const;
46
+
47
+ //! Enters a modal loop where the Window is visible on screen and receives calls to draw, update etc.
48
+ void show();
49
+ //! Closes the window if it is currently shown.
50
+ void close();
51
+
52
+ //! Called every updateInterval milliseconds while the window is being
53
+ //! shown. Your application's main game logic goes here.
54
+ virtual void update() {}
55
+ //! Called after every update and when the OS wants the window to
56
+ //! repaint itself. Your application's rendering code goes here.
57
+ virtual void draw() {}
58
+
59
+ //! Gives the game a chance to say no to being redrawn.
60
+ //! This is not a definitive answer. The operating system can still cause
61
+ //! redraws for one reason or another.
62
+ //! By default, the window is redrawn all the time.
63
+ virtual bool needsRedraw() const { return true; }
64
+
65
+ //! If this function returns true, the system arrow cursor is drawn while
66
+ //! over the window.
67
+ virtual bool needsCursor() const { return false; }
68
+
69
+ //! This function is called when the window loses focus on some platforms.
70
+ //! Most importantly, it is called on the iPhone or iPad when the user
71
+ //! locks the screen.
72
+ virtual void loseFocus() {}
73
+
74
+ //! This function is called when the operating system's memory is low.
75
+ //! So far, it is only called in iOS applications.
76
+ virtual void releaseMemory() {}
77
+
78
+ //! Called before update when the user pressed a button while the
79
+ //! window had the focus.
80
+ virtual void buttonDown(Gosu::Button) {}
81
+ //! Same as buttonDown. Called then the user released a button.
82
+ virtual void buttonUp(Gosu::Button) {}
83
+
84
+ // Ignore when SWIG is wrapping this class for Ruby/Gosu.
85
+ #ifndef SWIG
86
+
87
+ const Graphics& graphics() const;
88
+ Graphics& graphics();
89
+
90
+ const Input& input() const;
91
+ Input& input();
92
+
93
+ #ifdef GOSU_IS_WIN
94
+ // Only on Windows, used for integrating with GUI toolkits.
95
+ HWND handle() const;
96
+ virtual LRESULT handleMessage(UINT message, WPARAM wparam,
97
+ LPARAM lparam);
98
+ #endif
99
+
100
+ #ifdef GOSU_IS_UNIX
101
+ // Context for creating shared contexts.
102
+ // Only on Unices (so far).
103
+ typedef boost::shared_ptr<boost::function<void()> > SharedContext;
104
+ SharedContext createSharedContext();
105
+ #endif
106
+
107
+ #ifdef GOSU_IS_IPHONE
108
+ // iPhone-only callbacks for touch events.
109
+ // Note that it does not hurt to override them even if you compile
110
+ // for another platform; if you don't specify "virtual" the code
111
+ // should even be stripped away cleanly.
112
+ virtual void touchBegan(Touch touch) {}
113
+ virtual void touchMoved(Touch touch) {}
114
+ virtual void touchEnded(Touch touch) {}
115
+ #endif
116
+
117
+ const Audio& audio() const;
118
+ Audio& audio();
119
+
120
+ #endif
121
+ };
122
+ }
123
+
124
+ #endif
Binary file
Binary file
@@ -25,7 +25,7 @@ class Gosu::Sample
25
25
 
26
26
  def initialize(*args)
27
27
  args.shift if args.first.is_a? Gosu::Window
28
- new_initialize *args
28
+ new_initialize(*args)
29
29
  end
30
30
  end
31
31
  class Gosu::Song
@@ -33,7 +33,7 @@ class Gosu::Song
33
33
 
34
34
  def initialize(*args)
35
35
  args.shift if args.first.is_a? Gosu::Window
36
- new_initialize *args
36
+ new_initialize(*args)
37
37
  end
38
38
  end
39
39
 
@@ -50,17 +50,17 @@ class Gosu::Color
50
50
  def value=; end
51
51
  end
52
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
+ NONE = Gosu::Color::Constant.argb(0x00000000)
54
+ BLACK = Gosu::Color::Constant.argb(0xff000000)
55
+ GRAY = Gosu::Color::Constant.argb(0xff808080)
56
+ WHITE = Gosu::Color::Constant.argb(0xffffffff)
57
+ AQUA = Gosu::Color::Constant.argb(0xff00ffff)
58
+ RED = Gosu::Color::Constant.argb(0xffff0000)
59
+ GREEN = Gosu::Color::Constant.argb(0xff00ff00)
60
+ BLUE = Gosu::Color::Constant.argb(0xff0000ff)
61
+ YELLOW = Gosu::Color::Constant.argb(0xffffff00)
62
+ FUCHSIA = Gosu::Color::Constant.argb(0xffff00ff)
63
+ CYAN = Gosu::Color::Constant.argb(0xff00ffff)
64
64
  end
65
65
 
66
66
  # Instance methods for button_id_to_char and char_to_button_id
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: 49
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 25
10
- version: 0.7.25
9
+ - 26
10
+ version: 0.7.26
11
11
  platform: i386-mingw32
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-11-02 00:00:00 +01:00
19
+ date: 2011-01-09 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -31,6 +31,34 @@ extra_rdoc_files: []
31
31
  files:
32
32
  - COPYING.txt
33
33
  - README.txt
34
+ - Gosu/Async.hpp
35
+ - Gosu/Audio.hpp
36
+ - Gosu/AutoLink.hpp
37
+ - Gosu/Bitmap.hpp
38
+ - Gosu/ButtonsMac.hpp
39
+ - Gosu/ButtonsWin.hpp
40
+ - Gosu/ButtonsX.hpp
41
+ - Gosu/Color.hpp
42
+ - Gosu/Directories.hpp
43
+ - Gosu/Font.hpp
44
+ - Gosu/Fwd.hpp
45
+ - Gosu/Gosu.hpp
46
+ - Gosu/Graphics.hpp
47
+ - Gosu/GraphicsBase.hpp
48
+ - Gosu/Image.hpp
49
+ - Gosu/ImageData.hpp
50
+ - Gosu/Input.hpp
51
+ - Gosu/IO.hpp
52
+ - Gosu/Math.hpp
53
+ - Gosu/Platform.hpp
54
+ - Gosu/Sockets.hpp
55
+ - Gosu/Text.hpp
56
+ - Gosu/TextInput.hpp
57
+ - Gosu/Timing.hpp
58
+ - Gosu/Utility.hpp
59
+ - Gosu/Version.hpp
60
+ - Gosu/Window.hpp
61
+ - Gosu/WinUtility.hpp
34
62
  - lib/gosu.rb
35
63
  - lib/gosu/patches.rb
36
64
  - lib/gosu/swig_patches.rb