gosu 0.10.9.pre1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gosu/Audio.hpp +35 -66
- data/Gosu/AutoLink.hpp +14 -16
- data/Gosu/Bitmap.hpp +50 -37
- data/Gosu/Buttons.hpp +246 -265
- data/Gosu/Color.hpp +32 -76
- data/Gosu/Directories.hpp +14 -17
- data/Gosu/Font.hpp +28 -34
- data/Gosu/Fwd.hpp +27 -31
- data/Gosu/Gosu.hpp +2 -5
- data/Gosu/Graphics.hpp +31 -48
- data/Gosu/GraphicsBase.hpp +27 -58
- data/Gosu/IO.hpp +44 -56
- data/Gosu/Image.hpp +29 -73
- data/Gosu/ImageData.hpp +13 -17
- data/Gosu/Input.hpp +42 -57
- data/Gosu/Inspection.hpp +2 -6
- data/Gosu/Math.hpp +32 -38
- data/Gosu/Platform.hpp +10 -29
- data/Gosu/Text.hpp +30 -39
- data/Gosu/TextInput.hpp +29 -36
- data/Gosu/Timing.hpp +14 -16
- data/Gosu/Utility.hpp +10 -15
- data/Gosu/Version.hpp +13 -14
- data/Gosu/Window.hpp +53 -68
- data/README.md +23 -11
- data/ext/gosu/extconf.rb +31 -81
- data/lib/gosu/patches.rb +35 -19
- data/lib/gosu/run.rb +13 -4
- data/rdoc/gosu.rb +24 -20
- data/src/ALChannelManagement.hpp +119 -0
- data/src/{Audio/Audio.cpp → Audio.cpp} +177 -211
- data/src/AudioFile.hpp +57 -0
- data/src/AudioToolboxFile.hpp +214 -0
- data/src/Bitmap.cpp +159 -0
- data/src/BitmapIO.cpp +141 -0
- data/src/BlockAllocator.cpp +133 -0
- data/src/{Graphics/BlockAllocator.hpp → BlockAllocator.hpp} +34 -35
- data/src/ClipRectStack.hpp +87 -0
- data/src/{Graphics/Color.cpp → Color.cpp} +30 -28
- data/src/DirectoriesApple.cpp +68 -0
- data/src/DirectoriesUnix.cpp +20 -18
- data/src/DirectoriesWin.cpp +40 -41
- data/src/DrawOp.hpp +168 -0
- data/src/DrawOpQueue.hpp +190 -0
- data/src/FileUnix.cpp +40 -46
- data/src/FileWin.cpp +42 -38
- data/src/Font.cpp +165 -0
- data/src/{Text/FormattedString.hpp → FormattedString.hpp} +114 -114
- data/src/GosuAppDelegate.cpp +30 -0
- data/src/{UIKit/GosuAppDelegate.h → GosuAppDelegate.h} +0 -0
- data/src/{UIKit/GosuGLView.mm → GosuGLView.cpp} +22 -17
- data/src/{UIKit/GosuGLView.h → GosuGLView.h} +0 -0
- data/src/GosuViewController.cpp +231 -0
- data/src/{UIKit/GosuViewController.h → GosuViewController.h} +0 -0
- data/src/Graphics.cpp +464 -0
- data/src/{Graphics/Common.hpp → GraphicsImpl.hpp} +29 -32
- data/src/IO.cpp +17 -16
- data/src/Iconv.hpp +13 -22
- data/src/Image.cpp +142 -0
- data/src/Input.cpp +459 -0
- data/src/InputUIKit.cpp +197 -0
- data/src/Inspection.cpp +4 -5
- data/src/LargeImageData.cpp +151 -0
- data/src/LargeImageData.hpp +43 -0
- data/src/{Graphics/Macro.cpp → Macro.cpp} +77 -78
- data/src/Macro.hpp +30 -0
- data/src/Math.cpp +17 -29
- data/src/{Audio/OggFile.hpp → OggFile.hpp} +19 -24
- data/src/RenderState.hpp +205 -0
- data/src/Resolution.cpp +86 -0
- data/src/ResolutionApple.cpp +25 -0
- data/{ext/gosu/gosu_wrap.cxx → src/RubyGosu.cxx} +2256 -1707
- data/{ext/gosu/gosu_wrap.h → src/RubyGosu.h} +9 -9
- data/src/{Audio/SndFile.hpp → SndFile.hpp} +54 -43
- data/src/TexChunk.cpp +117 -0
- data/src/{Graphics/TexChunk.hpp → TexChunk.hpp} +13 -18
- data/src/Text.cpp +371 -0
- data/src/TextApple.cpp +209 -0
- data/src/TextInput.cpp +278 -0
- data/src/TextTTFWin.cpp +251 -0
- data/src/{Text/TextUnix.cpp → TextUnix.cpp} +96 -92
- data/src/TextWin.cpp +194 -0
- data/src/{Graphics/Texture.cpp → Texture.cpp} +35 -38
- data/src/{Graphics/Texture.hpp → Texture.hpp} +9 -13
- data/src/TimingApple.cpp +11 -7
- data/src/TimingUnix.cpp +13 -7
- data/src/TimingWin.cpp +6 -1
- data/src/{Graphics/Transform.cpp → Transform.cpp} +17 -12
- data/src/{Graphics/TransformStack.hpp → TransformStack.hpp} +24 -25
- data/src/Utility.cpp +29 -70
- data/src/UtilityApple.cpp +52 -0
- data/src/UtilityWin.cpp +7 -4
- data/src/Version.cpp +22 -0
- data/src/WinMain.cpp +30 -33
- data/src/WinUtility.cpp +24 -22
- data/src/WinUtility.hpp +11 -20
- data/src/Window.cpp +142 -112
- data/src/WindowUIKit.cpp +155 -0
- data/src/stb_image.h +384 -173
- data/src/stb_vorbis.c +20 -18
- metadata +60 -62
- data/Gosu/TR1.hpp +0 -56
- data/src/AppleUtility.hpp +0 -66
- data/src/Audio/ALChannelManagement.hpp +0 -114
- data/src/Audio/Audio.mm +0 -1
- data/src/Audio/AudioFile.hpp +0 -53
- data/src/Audio/AudioToolboxFile.hpp +0 -207
- data/src/Bitmap/Bitmap.cpp +0 -183
- data/src/Bitmap/BitmapIO.cpp +0 -176
- data/src/DirectoriesApple.mm +0 -71
- data/src/Graphics/BlockAllocator.cpp +0 -142
- data/src/Graphics/ClipRectStack.hpp +0 -93
- data/src/Graphics/DrawOp.hpp +0 -175
- data/src/Graphics/DrawOpQueue.hpp +0 -188
- data/src/Graphics/Graphics.cpp +0 -478
- data/src/Graphics/Image.cpp +0 -193
- data/src/Graphics/LargeImageData.cpp +0 -133
- data/src/Graphics/LargeImageData.hpp +0 -46
- data/src/Graphics/Macro.hpp +0 -36
- data/src/Graphics/RenderState.hpp +0 -211
- data/src/Graphics/Resolution.cpp +0 -91
- data/src/Graphics/ResolutionApple.mm +0 -19
- data/src/Graphics/TexChunk.cpp +0 -112
- data/src/Input/Input.cpp +0 -463
- data/src/Input/InputUIKit.mm +0 -190
- data/src/Input/TextInput.cpp +0 -261
- data/src/Text/Font.cpp +0 -175
- data/src/Text/Text.cpp +0 -391
- data/src/Text/TextApple.mm +0 -227
- data/src/Text/TextTTFWin.cpp +0 -249
- data/src/Text/TextWin.cpp +0 -186
- data/src/UIKit/GosuAppDelegate.mm +0 -24
- data/src/UIKit/GosuViewController.mm +0 -211
- data/src/UtilityApple.mm +0 -63
- data/src/WindowUIKit.mm +0 -139
data/Gosu/Color.hpp
CHANGED
@@ -1,23 +1,20 @@
|
|
1
1
|
//! \file Color.hpp
|
2
2
|
//! Interface of the Color class.
|
3
3
|
|
4
|
-
#
|
5
|
-
#define GOSU_COLOR_HPP
|
4
|
+
#pragma once
|
6
5
|
|
7
6
|
#include <Gosu/Platform.hpp>
|
8
|
-
#include <Gosu/TR1.hpp>
|
9
7
|
|
10
8
|
namespace Gosu
|
11
9
|
{
|
12
|
-
//! Represents an RGBA color value with 8 bits for each channel.
|
13
|
-
//! implicitly constructed from literals of the form 0xaarrggbb.
|
14
|
-
//! value semantics.
|
15
|
-
//! The four-byte layout in memory is RGBA. On Big-Endian machines the
|
16
|
-
//!
|
17
|
-
//! it is 0xaabbggrr.
|
10
|
+
//! Represents an RGBA color value with 8 bits for each channel.
|
11
|
+
//! Can be implicitly constructed from literals of the form 0xaarrggbb.
|
12
|
+
//! Has fast value semantics.
|
13
|
+
//! The four-byte layout in memory is RGBA. On Big-Endian machines the unsigned int will look
|
14
|
+
//! like 0xrrggbbaa, on Little-Endian machines it is 0xaabbggrr.
|
18
15
|
class Color
|
19
16
|
{
|
20
|
-
std::
|
17
|
+
std::uint32_t rep;
|
21
18
|
#ifdef GOSU_IS_LITTLE_ENDIAN
|
22
19
|
enum { RED_OFFSET = 0, GREEN_OFFSET = 8, BLUE_OFFSET = 16, ALPHA_OFFSET = 24 };
|
23
20
|
#else
|
@@ -25,7 +22,7 @@ namespace Gosu
|
|
25
22
|
#endif
|
26
23
|
|
27
24
|
public:
|
28
|
-
typedef std::
|
25
|
+
typedef std::uint8_t Channel;
|
29
26
|
static const unsigned GL_FORMAT = 0x1908; // GL_RGBA
|
30
27
|
|
31
28
|
//! The default constructor does not initialize the color to any value.
|
@@ -35,14 +32,13 @@ namespace Gosu
|
|
35
32
|
|
36
33
|
//! Conversion constructor for literals of the form 0xaarrggbb.
|
37
34
|
Color(unsigned argb)
|
35
|
+
: Color((argb >> 24) & 0xff, (argb >> 16) & 0xff, (argb >> 8) & 0xff, (argb >> 0) & 0xff)
|
38
36
|
{
|
39
|
-
*this = Color((argb >> 24) & 0xff, (argb >> 16) & 0xff,
|
40
|
-
(argb >> 8) & 0xff, (argb >> 0) & 0xff);
|
41
37
|
}
|
42
38
|
|
43
39
|
Color(Channel red, Channel green, Channel blue)
|
40
|
+
: Color(0xff, red, green, blue)
|
44
41
|
{
|
45
|
-
*this = Color(0xff, red, green, blue);
|
46
42
|
}
|
47
43
|
|
48
44
|
Color(Channel alpha, Channel red, Channel green, Channel blue)
|
@@ -52,11 +48,12 @@ namespace Gosu
|
|
52
48
|
}
|
53
49
|
|
54
50
|
//! Constructs a color from the given hue/saturation/value triple.
|
55
|
-
//! Ranges of these values are given as 0..360, 0..1 and 0..1,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
//! Ranges of these values are given as 0..360, 0..1, and 0..1, respectively.
|
52
|
+
static Color from_hsv(double h, double s, double v);
|
53
|
+
|
54
|
+
//! Constructs a color from the given hue/saturation/value triple.
|
55
|
+
//! Ranges of these values are given as 0..360, 0..1, and 0..1, respectively.
|
56
|
+
static Color from_ahsv(Channel alpha, double h, double s, double v);
|
60
57
|
|
61
58
|
Channel red() const
|
62
59
|
{
|
@@ -78,25 +75,25 @@ namespace Gosu
|
|
78
75
|
return static_cast<Channel>(rep >> ALPHA_OFFSET);
|
79
76
|
}
|
80
77
|
|
81
|
-
void
|
78
|
+
void set_red(Channel value)
|
82
79
|
{
|
83
80
|
rep &= ~(0xff << RED_OFFSET);
|
84
81
|
rep |= value << RED_OFFSET;
|
85
82
|
}
|
86
83
|
|
87
|
-
void
|
84
|
+
void set_green(Channel value)
|
88
85
|
{
|
89
86
|
rep &= ~(0xff << GREEN_OFFSET);
|
90
87
|
rep |= value << GREEN_OFFSET;
|
91
88
|
}
|
92
89
|
|
93
|
-
void
|
90
|
+
void set_blue(Channel value)
|
94
91
|
{
|
95
92
|
rep &= ~(0xff << BLUE_OFFSET);
|
96
93
|
rep |= value << BLUE_OFFSET;
|
97
94
|
}
|
98
95
|
|
99
|
-
void
|
96
|
+
void set_alpha(Channel value)
|
100
97
|
{
|
101
98
|
rep &= ~(0xff << ALPHA_OFFSET);
|
102
99
|
rep |= value << ALPHA_OFFSET;
|
@@ -106,43 +103,31 @@ namespace Gosu
|
|
106
103
|
double hue() const;
|
107
104
|
|
108
105
|
//! Changes the current color so hue() will return h.
|
109
|
-
void
|
106
|
+
void set_hue(double h);
|
110
107
|
|
111
108
|
//! Returns the saturation of the color, in the range of 0..1.
|
112
109
|
double saturation() const;
|
113
110
|
|
114
111
|
//! Changes the current color so saturation() will return s.
|
115
|
-
void
|
112
|
+
void set_saturation(double s);
|
116
113
|
|
117
114
|
//! Returns the value (brightness) of the color, in the range of 0..1.
|
118
115
|
double value() const;
|
119
116
|
|
120
117
|
//! Changes the current color so value() will return v.
|
121
|
-
void
|
118
|
+
void set_value(double v);
|
122
119
|
|
123
120
|
//! Returns the color in 0xaarrggbb representation.
|
124
|
-
std::
|
125
|
-
{
|
126
|
-
return alpha() << 24 | red() << 16 | green() << 8 | blue();
|
127
|
-
}
|
121
|
+
std::uint32_t argb() const { return alpha() << 24 | red() << 16 | green() << 8 | blue(); }
|
128
122
|
|
129
123
|
//! Returns the color in 0x00bbggrr representation. Useful for Win32 programming.
|
130
|
-
std::
|
131
|
-
{
|
132
|
-
return blue() << 16 | green() << 8 | red();
|
133
|
-
}
|
124
|
+
std::uint32_t bgr() const { return blue() << 16 | green() << 8 | red(); }
|
134
125
|
|
135
126
|
//! Returns the color in 0xaabbggrr representation.
|
136
|
-
std::
|
137
|
-
{
|
138
|
-
return alpha() << 24 | blue() << 16 | green() << 8 | red();
|
139
|
-
}
|
127
|
+
std::uint32_t abgr() const { return alpha() << 24 | blue() << 16 | green() << 8 | red(); }
|
140
128
|
|
141
129
|
//! Returns the internal representation of the color (RGBA in memory).
|
142
|
-
std::
|
143
|
-
{
|
144
|
-
return rep;
|
145
|
-
}
|
130
|
+
std::uint32_t gl() const { return rep; }
|
146
131
|
|
147
132
|
static const Color NONE;
|
148
133
|
static const Color BLACK;
|
@@ -158,21 +143,10 @@ namespace Gosu
|
|
158
143
|
static const Color CYAN;
|
159
144
|
};
|
160
145
|
|
161
|
-
|
162
|
-
inline bool operator<(Color a, Color b)
|
163
|
-
{
|
164
|
-
|
165
|
-
}
|
166
|
-
|
167
|
-
inline bool operator==(Color a, Color b)
|
168
|
-
{
|
169
|
-
return a.gl() == b.gl();
|
170
|
-
}
|
171
|
-
|
172
|
-
inline bool operator!=(Color a, Color b)
|
173
|
-
{
|
174
|
-
return a.gl() != b.gl();
|
175
|
-
}
|
146
|
+
#ifndef SWIG
|
147
|
+
inline bool operator<(Color a, Color b) { return a.gl() < b.gl(); }
|
148
|
+
inline bool operator==(Color a, Color b) { return a.gl() == b.gl(); }
|
149
|
+
inline bool operator!=(Color a, Color b) { return a.gl() != b.gl(); }
|
176
150
|
|
177
151
|
//! Interpolates linearly between two colors, with a given weight towards
|
178
152
|
//! the second color.
|
@@ -182,23 +156,5 @@ namespace Gosu
|
|
182
156
|
//! Combines two colors as if their channels were mapped to the 0..1 range
|
183
157
|
//! and then multiplied with each other.
|
184
158
|
Color multiply(Color a, Color b);
|
185
|
-
|
186
|
-
namespace Colors
|
187
|
-
{
|
188
|
-
GOSU_DEPRECATED const Color none (0x00000000);
|
189
|
-
GOSU_DEPRECATED const Color black (0xff000000);
|
190
|
-
GOSU_DEPRECATED const Color gray (0xff808080);
|
191
|
-
GOSU_DEPRECATED const Color white (0xffffffff);
|
192
|
-
|
193
|
-
GOSU_DEPRECATED const Color aqua (0xff00ffff);
|
194
|
-
GOSU_DEPRECATED const Color red (0xffff0000);
|
195
|
-
GOSU_DEPRECATED const Color green (0xff00ff00);
|
196
|
-
GOSU_DEPRECATED const Color blue (0xff0000ff);
|
197
|
-
GOSU_DEPRECATED const Color yellow (0xffffff00);
|
198
|
-
GOSU_DEPRECATED const Color fuchsia (0xffff00ff);
|
199
|
-
GOSU_DEPRECATED const Color cyan (0xff00ffff);
|
200
|
-
}
|
201
|
-
#endif
|
202
|
-
}
|
203
|
-
|
204
159
|
#endif
|
160
|
+
}
|
data/Gosu/Directories.hpp
CHANGED
@@ -1,39 +1,36 @@
|
|
1
1
|
//! \file Directories.hpp
|
2
2
|
//! Access to a small set of system paths.
|
3
3
|
|
4
|
-
#
|
5
|
-
#define GOSU_DIRECTORIES_HPP
|
4
|
+
#pragma once
|
6
5
|
|
7
6
|
#include <string>
|
8
7
|
|
9
8
|
namespace Gosu
|
10
9
|
{
|
11
|
-
//! Changes the current directory to the result of
|
12
|
-
void
|
10
|
+
//! Changes the current directory to the result of resource_prefix().
|
11
|
+
void use_resource_directory();
|
13
12
|
|
14
13
|
//! Prefix for a program's own resources.
|
15
|
-
//! On Windows, the
|
16
|
-
//! On
|
14
|
+
//! On Windows, the parent directory of the executable.
|
15
|
+
//! On macOS, the 'Resources' directory inside the .app bundle.
|
17
16
|
//! On Linux, the current directory (empty string).
|
18
|
-
std::
|
17
|
+
std::string resource_prefix();
|
19
18
|
|
20
|
-
//! Prefix for resources of a group of programs.
|
21
|
-
//! On Windows, the
|
22
|
-
//! On
|
19
|
+
//! Prefix for shared resources of a group of programs.
|
20
|
+
//! On Windows, the parent directory of the executable.
|
21
|
+
//! On macOS, the parent directory of the .app bundle.
|
23
22
|
//! On Linux, the current directory (empty string).
|
24
|
-
std::
|
23
|
+
std::string shared_resource_prefix();
|
25
24
|
|
26
25
|
//! Prefix for user settings.
|
27
26
|
//! On Windows, the same as %APPDATA%.
|
28
|
-
//! On
|
27
|
+
//! On macOS, the user's Library/Preferences folder.
|
29
28
|
//! On Linux, the home directory plus a trailing dot for hidden files.
|
30
|
-
std::
|
29
|
+
std::string user_settings_prefix();
|
31
30
|
|
32
31
|
//! Prefix for user documents, e.g. saved games.
|
33
32
|
//! On Windows, the My Documents folder.
|
34
|
-
//! On
|
33
|
+
//! On macOS, the user's Documents folder.
|
35
34
|
//! On Linux, the home directory.
|
36
|
-
std::
|
35
|
+
std::string user_documents_prefix();
|
37
36
|
}
|
38
|
-
|
39
|
-
#endif
|
data/Gosu/Font.hpp
CHANGED
@@ -1,40 +1,39 @@
|
|
1
1
|
//! \file Font.hpp
|
2
2
|
//! Interface of the Font class.
|
3
3
|
|
4
|
-
#
|
5
|
-
#define GOSU_FONT_HPP
|
4
|
+
#pragma once
|
6
5
|
|
7
6
|
#include <Gosu/Fwd.hpp>
|
8
7
|
#include <Gosu/Color.hpp>
|
9
8
|
#include <Gosu/GraphicsBase.hpp>
|
10
9
|
#include <Gosu/Platform.hpp>
|
11
10
|
#include <Gosu/Text.hpp>
|
12
|
-
#include <
|
11
|
+
#include <memory>
|
13
12
|
#include <string>
|
14
13
|
|
15
14
|
namespace Gosu
|
16
15
|
{
|
17
16
|
//! A font can be used to draw text on a Graphics object very flexibly.
|
18
17
|
//! Fonts are ideal for small texts that change regularly. For large,
|
19
|
-
//! static texts you should use
|
18
|
+
//! static texts you should use create_bitmap and turn the result into
|
20
19
|
//! an image.
|
21
20
|
class Font
|
22
21
|
{
|
23
22
|
struct Impl;
|
24
|
-
std::
|
23
|
+
std::shared_ptr<Impl> pimpl;
|
25
24
|
|
26
25
|
public:
|
27
26
|
//! Constructs a font that can be drawn onto the graphics object.
|
28
|
-
//! \param
|
27
|
+
//! \param font_name Name of a system font, or a filename to a TTF
|
29
28
|
//! file (must contain '/', does not work on Linux).
|
30
|
-
//! \param
|
31
|
-
//! \param
|
29
|
+
//! \param font_height Height of the font, in pixels.
|
30
|
+
//! \param font_flags Flags used to render individual characters of
|
32
31
|
//! the font.
|
33
|
-
Font(unsigned
|
34
|
-
unsigned
|
32
|
+
Font(unsigned font_height, const std::string& font_name = default_font_name(),
|
33
|
+
unsigned font_flags = FF_BOLD);
|
35
34
|
|
36
35
|
//! Returns the name of the font that was used to create it.
|
37
|
-
std::
|
36
|
+
std::string name() const;
|
38
37
|
|
39
38
|
//! Returns the height of the font, in pixels.
|
40
39
|
unsigned height() const;
|
@@ -43,45 +42,40 @@ namespace Gosu
|
|
43
42
|
unsigned flags() const;
|
44
43
|
|
45
44
|
//! Returns the width, in pixels, the given text would occupy if drawn.
|
46
|
-
double
|
45
|
+
double text_width(const std::string& text, double scale_x = 1) const;
|
47
46
|
|
48
47
|
//! Draws text so the top left corner of the text is at (x; y).
|
49
48
|
//! \param text Formatted text without line-breaks.
|
50
|
-
void draw(const std::
|
51
|
-
double
|
52
|
-
|
49
|
+
void draw(const std::string& text, double x, double y, ZPos z,
|
50
|
+
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
51
|
+
AlphaMode mode = AM_DEFAULT) const;
|
53
52
|
|
54
53
|
//! Draws text at a position relative to (x; y).
|
55
|
-
//! \param
|
56
|
-
//!
|
54
|
+
//! \param rel_x Determines where the text is drawn horizontally. If
|
55
|
+
//! rel_x is 0.0, the text will be to the right of x, if it is 1.0,
|
57
56
|
//! the text will be to the left of x, if it is 0.5, it will be
|
58
57
|
//! centered on x. Of course, all real numbers are possible values.
|
59
|
-
//! \param
|
60
|
-
void
|
61
|
-
double
|
62
|
-
Color c = Color::WHITE, AlphaMode mode =
|
58
|
+
//! \param rel_y See rel_x.
|
59
|
+
void draw_rel(const std::string& text, double x, double y, ZPos z,
|
60
|
+
double rel_x, double rel_y, double scale_x = 1, double scale_y = 1,
|
61
|
+
Color c = Color::WHITE, AlphaMode mode = AM_DEFAULT) const;
|
63
62
|
|
64
63
|
//! Maps a letter to a specific image instead of generating one using
|
65
64
|
//! Gosu's built-in text rendering. This can only be called once per
|
66
65
|
//! character, and the character must not have been drawn before.
|
67
|
-
//! This ensures that Fonts are still sort of immutable.
|
68
|
-
void
|
69
|
-
//! A shortcut for mapping a character to an image regardless of
|
66
|
+
//! This ensures that Fonts are still (sort of) immutable.
|
67
|
+
void set_image(wchar_t wc, unsigned font_flags, const Gosu::Image& image);
|
68
|
+
//! A shortcut for mapping a character to an image regardless of font_flags.
|
70
69
|
//! Later versions might apply faux italics or faux bold to it (to be decided!).
|
71
|
-
void
|
70
|
+
void set_image(wchar_t wc, const Gosu::Image& image);
|
72
71
|
|
73
72
|
#ifndef SWIG
|
74
|
-
GOSU_DEPRECATED Font(Graphics& graphics, const std::wstring& fontName,
|
75
|
-
unsigned fontHeight, unsigned fontFlags = ffBold);
|
76
|
-
|
77
73
|
GOSU_DEPRECATED
|
78
74
|
#endif
|
79
75
|
//! DEPRECATED: Analogous to draw, but rotates the text by a given angle.
|
80
|
-
//! Use Graphics::
|
81
|
-
void
|
82
|
-
double
|
83
|
-
|
76
|
+
//! Use Graphics::push_transform to achieve the same effect.
|
77
|
+
void draw_rot(const std::string& text, double x, double y, ZPos z, double angle,
|
78
|
+
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
79
|
+
AlphaMode mode = AM_DEFAULT) const;
|
84
80
|
};
|
85
81
|
}
|
86
|
-
|
87
|
-
#endif
|
data/Gosu/Fwd.hpp
CHANGED
@@ -1,31 +1,27 @@
|
|
1
|
-
//! \file Fwd.hpp
|
2
|
-
//! Contains declarations of all of Gosu's available classes.
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
class
|
11
|
-
class
|
12
|
-
class
|
13
|
-
class
|
14
|
-
class
|
15
|
-
class
|
16
|
-
class
|
17
|
-
class
|
18
|
-
class
|
19
|
-
class
|
20
|
-
class
|
21
|
-
class
|
22
|
-
class
|
23
|
-
class
|
24
|
-
class
|
25
|
-
class
|
26
|
-
class
|
27
|
-
|
28
|
-
class Writer;
|
29
|
-
}
|
30
|
-
|
31
|
-
#endif
|
1
|
+
//! \file Fwd.hpp
|
2
|
+
//! Contains forward declarations of all of Gosu's available classes.
|
3
|
+
|
4
|
+
#pragma once
|
5
|
+
|
6
|
+
//! The library's main namespace.
|
7
|
+
namespace Gosu
|
8
|
+
{
|
9
|
+
class Bitmap;
|
10
|
+
class Buffer;
|
11
|
+
class Button;
|
12
|
+
class Color;
|
13
|
+
class File;
|
14
|
+
class Font;
|
15
|
+
class Graphics;
|
16
|
+
class Image;
|
17
|
+
class ImageData;
|
18
|
+
class Input;
|
19
|
+
class Reader;
|
20
|
+
class Resource;
|
21
|
+
class Sample;
|
22
|
+
class Song;
|
23
|
+
class TextInput;
|
24
|
+
class Timer;
|
25
|
+
class Window;
|
26
|
+
class Writer;
|
27
|
+
}
|
data/Gosu/Gosu.hpp
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
//! \file Gosu.hpp
|
2
|
-
//! Umbrella header for
|
2
|
+
//! Umbrella header for all of Gosu.
|
3
3
|
|
4
4
|
//! \mainpage Gosu C++ Documentation
|
5
5
|
//!
|
@@ -7,8 +7,7 @@
|
|
7
7
|
//! discussion of concepts and ideas behind the library, see the Wiki entries linked
|
8
8
|
//! from the official website, https://www.libgosu.org/.
|
9
9
|
|
10
|
-
#
|
11
|
-
#define GOSU_GOSU_HPP
|
10
|
+
#pragma once
|
12
11
|
|
13
12
|
#include <Gosu/Audio.hpp>
|
14
13
|
#include <Gosu/Bitmap.hpp>
|
@@ -29,5 +28,3 @@
|
|
29
28
|
#include <Gosu/Utility.hpp>
|
30
29
|
#include <Gosu/Version.hpp>
|
31
30
|
#include <Gosu/Window.hpp>
|
32
|
-
|
33
|
-
#endif
|