gosu 0.7.25-universal-darwin → 0.7.26-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING.txt +1 -1
- data/Gosu/Async.hpp +48 -0
- data/Gosu/Audio.hpp +165 -0
- data/Gosu/AutoLink.hpp +16 -0
- data/Gosu/Bitmap.hpp +85 -0
- data/Gosu/ButtonsMac.hpp +140 -0
- data/Gosu/ButtonsWin.hpp +140 -0
- data/Gosu/ButtonsX.hpp +141 -0
- data/Gosu/Color.hpp +202 -0
- data/Gosu/Directories.hpp +36 -0
- data/Gosu/Font.hpp +74 -0
- data/Gosu/Fwd.hpp +30 -0
- data/Gosu/Gosu.hpp +33 -0
- data/Gosu/Graphics.hpp +118 -0
- data/Gosu/GraphicsBase.hpp +69 -0
- data/Gosu/IO.hpp +252 -0
- data/Gosu/Image.hpp +136 -0
- data/Gosu/ImageData.hpp +49 -0
- data/Gosu/Input.hpp +162 -0
- data/Gosu/Math.hpp +135 -0
- data/Gosu/Platform.hpp +73 -0
- data/Gosu/Sockets.hpp +139 -0
- data/Gosu/Text.hpp +71 -0
- data/Gosu/TextInput.hpp +70 -0
- data/Gosu/Timing.hpp +16 -0
- data/Gosu/Utility.hpp +25 -0
- data/Gosu/Version.hpp +9 -0
- data/Gosu/WinUtility.hpp +76 -0
- data/Gosu/Window.hpp +124 -0
- data/lib/gosu.for_1_8.bundle +0 -0
- data/lib/gosu.for_1_9.bundle +0 -0
- data/lib/gosu/patches.rb +13 -13
- metadata +32 -4
data/Gosu/Window.hpp
ADDED
@@ -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
|
data/lib/gosu.for_1_8.bundle
CHANGED
Binary file
|
data/lib/gosu.for_1_9.bundle
CHANGED
Binary file
|
data/lib/gosu/patches.rb
CHANGED
@@ -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
|
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
|
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.
|
54
|
-
BLACK = Gosu::Color::Constant.
|
55
|
-
GRAY = Gosu::Color::Constant.
|
56
|
-
WHITE = Gosu::Color::Constant.
|
57
|
-
AQUA = Gosu::Color::Constant.
|
58
|
-
RED = Gosu::Color::Constant.
|
59
|
-
GREEN = Gosu::Color::Constant.
|
60
|
-
BLUE = Gosu::Color::Constant.
|
61
|
-
YELLOW = Gosu::Color::Constant.
|
62
|
-
FUCHSIA = Gosu::Color::Constant.
|
63
|
-
CYAN = Gosu::Color::Constant.
|
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:
|
4
|
+
hash: 55
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 26
|
10
|
+
version: 0.7.26
|
11
11
|
platform: universal-darwin
|
12
12
|
authors:
|
13
13
|
- Julian Raschke
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
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
|