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.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/Gosu/Audio.hpp +35 -66
  3. data/Gosu/AutoLink.hpp +14 -16
  4. data/Gosu/Bitmap.hpp +50 -37
  5. data/Gosu/Buttons.hpp +246 -265
  6. data/Gosu/Color.hpp +32 -76
  7. data/Gosu/Directories.hpp +14 -17
  8. data/Gosu/Font.hpp +28 -34
  9. data/Gosu/Fwd.hpp +27 -31
  10. data/Gosu/Gosu.hpp +2 -5
  11. data/Gosu/Graphics.hpp +31 -48
  12. data/Gosu/GraphicsBase.hpp +27 -58
  13. data/Gosu/IO.hpp +44 -56
  14. data/Gosu/Image.hpp +29 -73
  15. data/Gosu/ImageData.hpp +13 -17
  16. data/Gosu/Input.hpp +42 -57
  17. data/Gosu/Inspection.hpp +2 -6
  18. data/Gosu/Math.hpp +32 -38
  19. data/Gosu/Platform.hpp +10 -29
  20. data/Gosu/Text.hpp +30 -39
  21. data/Gosu/TextInput.hpp +29 -36
  22. data/Gosu/Timing.hpp +14 -16
  23. data/Gosu/Utility.hpp +10 -15
  24. data/Gosu/Version.hpp +13 -14
  25. data/Gosu/Window.hpp +53 -68
  26. data/README.md +23 -11
  27. data/ext/gosu/extconf.rb +31 -81
  28. data/lib/gosu/patches.rb +35 -19
  29. data/lib/gosu/run.rb +13 -4
  30. data/rdoc/gosu.rb +24 -20
  31. data/src/ALChannelManagement.hpp +119 -0
  32. data/src/{Audio/Audio.cpp → Audio.cpp} +177 -211
  33. data/src/AudioFile.hpp +57 -0
  34. data/src/AudioToolboxFile.hpp +214 -0
  35. data/src/Bitmap.cpp +159 -0
  36. data/src/BitmapIO.cpp +141 -0
  37. data/src/BlockAllocator.cpp +133 -0
  38. data/src/{Graphics/BlockAllocator.hpp → BlockAllocator.hpp} +34 -35
  39. data/src/ClipRectStack.hpp +87 -0
  40. data/src/{Graphics/Color.cpp → Color.cpp} +30 -28
  41. data/src/DirectoriesApple.cpp +68 -0
  42. data/src/DirectoriesUnix.cpp +20 -18
  43. data/src/DirectoriesWin.cpp +40 -41
  44. data/src/DrawOp.hpp +168 -0
  45. data/src/DrawOpQueue.hpp +190 -0
  46. data/src/FileUnix.cpp +40 -46
  47. data/src/FileWin.cpp +42 -38
  48. data/src/Font.cpp +165 -0
  49. data/src/{Text/FormattedString.hpp → FormattedString.hpp} +114 -114
  50. data/src/GosuAppDelegate.cpp +30 -0
  51. data/src/{UIKit/GosuAppDelegate.h → GosuAppDelegate.h} +0 -0
  52. data/src/{UIKit/GosuGLView.mm → GosuGLView.cpp} +22 -17
  53. data/src/{UIKit/GosuGLView.h → GosuGLView.h} +0 -0
  54. data/src/GosuViewController.cpp +231 -0
  55. data/src/{UIKit/GosuViewController.h → GosuViewController.h} +0 -0
  56. data/src/Graphics.cpp +464 -0
  57. data/src/{Graphics/Common.hpp → GraphicsImpl.hpp} +29 -32
  58. data/src/IO.cpp +17 -16
  59. data/src/Iconv.hpp +13 -22
  60. data/src/Image.cpp +142 -0
  61. data/src/Input.cpp +459 -0
  62. data/src/InputUIKit.cpp +197 -0
  63. data/src/Inspection.cpp +4 -5
  64. data/src/LargeImageData.cpp +151 -0
  65. data/src/LargeImageData.hpp +43 -0
  66. data/src/{Graphics/Macro.cpp → Macro.cpp} +77 -78
  67. data/src/Macro.hpp +30 -0
  68. data/src/Math.cpp +17 -29
  69. data/src/{Audio/OggFile.hpp → OggFile.hpp} +19 -24
  70. data/src/RenderState.hpp +205 -0
  71. data/src/Resolution.cpp +86 -0
  72. data/src/ResolutionApple.cpp +25 -0
  73. data/{ext/gosu/gosu_wrap.cxx → src/RubyGosu.cxx} +2256 -1707
  74. data/{ext/gosu/gosu_wrap.h → src/RubyGosu.h} +9 -9
  75. data/src/{Audio/SndFile.hpp → SndFile.hpp} +54 -43
  76. data/src/TexChunk.cpp +117 -0
  77. data/src/{Graphics/TexChunk.hpp → TexChunk.hpp} +13 -18
  78. data/src/Text.cpp +371 -0
  79. data/src/TextApple.cpp +209 -0
  80. data/src/TextInput.cpp +278 -0
  81. data/src/TextTTFWin.cpp +251 -0
  82. data/src/{Text/TextUnix.cpp → TextUnix.cpp} +96 -92
  83. data/src/TextWin.cpp +194 -0
  84. data/src/{Graphics/Texture.cpp → Texture.cpp} +35 -38
  85. data/src/{Graphics/Texture.hpp → Texture.hpp} +9 -13
  86. data/src/TimingApple.cpp +11 -7
  87. data/src/TimingUnix.cpp +13 -7
  88. data/src/TimingWin.cpp +6 -1
  89. data/src/{Graphics/Transform.cpp → Transform.cpp} +17 -12
  90. data/src/{Graphics/TransformStack.hpp → TransformStack.hpp} +24 -25
  91. data/src/Utility.cpp +29 -70
  92. data/src/UtilityApple.cpp +52 -0
  93. data/src/UtilityWin.cpp +7 -4
  94. data/src/Version.cpp +22 -0
  95. data/src/WinMain.cpp +30 -33
  96. data/src/WinUtility.cpp +24 -22
  97. data/src/WinUtility.hpp +11 -20
  98. data/src/Window.cpp +142 -112
  99. data/src/WindowUIKit.cpp +155 -0
  100. data/src/stb_image.h +384 -173
  101. data/src/stb_vorbis.c +20 -18
  102. metadata +60 -62
  103. data/Gosu/TR1.hpp +0 -56
  104. data/src/AppleUtility.hpp +0 -66
  105. data/src/Audio/ALChannelManagement.hpp +0 -114
  106. data/src/Audio/Audio.mm +0 -1
  107. data/src/Audio/AudioFile.hpp +0 -53
  108. data/src/Audio/AudioToolboxFile.hpp +0 -207
  109. data/src/Bitmap/Bitmap.cpp +0 -183
  110. data/src/Bitmap/BitmapIO.cpp +0 -176
  111. data/src/DirectoriesApple.mm +0 -71
  112. data/src/Graphics/BlockAllocator.cpp +0 -142
  113. data/src/Graphics/ClipRectStack.hpp +0 -93
  114. data/src/Graphics/DrawOp.hpp +0 -175
  115. data/src/Graphics/DrawOpQueue.hpp +0 -188
  116. data/src/Graphics/Graphics.cpp +0 -478
  117. data/src/Graphics/Image.cpp +0 -193
  118. data/src/Graphics/LargeImageData.cpp +0 -133
  119. data/src/Graphics/LargeImageData.hpp +0 -46
  120. data/src/Graphics/Macro.hpp +0 -36
  121. data/src/Graphics/RenderState.hpp +0 -211
  122. data/src/Graphics/Resolution.cpp +0 -91
  123. data/src/Graphics/ResolutionApple.mm +0 -19
  124. data/src/Graphics/TexChunk.cpp +0 -112
  125. data/src/Input/Input.cpp +0 -463
  126. data/src/Input/InputUIKit.mm +0 -190
  127. data/src/Input/TextInput.cpp +0 -261
  128. data/src/Text/Font.cpp +0 -175
  129. data/src/Text/Text.cpp +0 -391
  130. data/src/Text/TextApple.mm +0 -227
  131. data/src/Text/TextTTFWin.cpp +0 -249
  132. data/src/Text/TextWin.cpp +0 -186
  133. data/src/UIKit/GosuAppDelegate.mm +0 -24
  134. data/src/UIKit/GosuViewController.mm +0 -211
  135. data/src/UtilityApple.mm +0 -63
  136. data/src/WindowUIKit.mm +0 -139
@@ -1,23 +1,20 @@
1
1
  //! \file Color.hpp
2
2
  //! Interface of the Color class.
3
3
 
4
- #ifndef GOSU_COLOR_HPP
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. Can be
13
- //! implicitly constructed from literals of the form 0xaarrggbb. Has fast
14
- //! value semantics.
15
- //! The four-byte layout in memory is RGBA. On Big-Endian machines the
16
- //! unsigned int interpretation is 0xrrggbbaa, on Little-Endian machines
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::tr1::uint32_t rep;
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::tr1::uint8_t Channel;
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
- //! respectively.
57
- //! The alpha value is set to 1 from this method.
58
- static Color fromHSV(double h, double s, double v);
59
- static Color fromAHSV(Channel alpha, double h, double s, double v);
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 setRed(Channel value)
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 setGreen(Channel value)
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 setBlue(Channel value)
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 setAlpha(Channel value)
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 setHue(double h);
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 setSaturation(double s);
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 setValue(double v);
118
+ void set_value(double v);
122
119
 
123
120
  //! Returns the color in 0xaarrggbb representation.
124
- std::tr1::uint32_t argb() const
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::tr1::uint32_t bgr() const
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::tr1::uint32_t abgr() const
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::tr1::uint32_t gl() const
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
- #ifndef SWIG
162
- inline bool operator<(Color a, Color b)
163
- {
164
- return a.gl() < b.gl();
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
+ }
@@ -1,39 +1,36 @@
1
1
  //! \file Directories.hpp
2
2
  //! Access to a small set of system paths.
3
3
 
4
- #ifndef GOSU_DIRECTORIES_HPP
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 resourcePrefix().
12
- void useResourceDirectory();
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 executable's containing directory.
16
- //! On OS X, the application's Resources subdirectory.
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::wstring resourcePrefix();
17
+ std::string resource_prefix();
19
18
 
20
- //! Prefix for resources of a group of programs.
21
- //! On Windows, the executable's containing directory.
22
- //! On OS X, the application's containing subdirectory.
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::wstring sharedResourcePrefix();
23
+ std::string shared_resource_prefix();
25
24
 
26
25
  //! Prefix for user settings.
27
26
  //! On Windows, the same as %APPDATA%.
28
- //! On OS X, the user's Library/Preferences folder.
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::wstring userSettingsPrefix();
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 OS X, the user's Documents folder.
33
+ //! On macOS, the user's Documents folder.
35
34
  //! On Linux, the home directory.
36
- std::wstring userDocsPrefix();
35
+ std::string user_documents_prefix();
37
36
  }
38
-
39
- #endif
@@ -1,40 +1,39 @@
1
1
  //! \file Font.hpp
2
2
  //! Interface of the Font class.
3
3
 
4
- #ifndef GOSU_FONT_HPP
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 <Gosu/TR1.hpp>
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 createBitmap and turn the result into
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::tr1::shared_ptr<Impl> pimpl;
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 fontName Name of a system font, or a filename to a TTF
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 fontHeight Height of the font, in pixels.
31
- //! \param fontFlags Flags used to render individual characters of
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 fontHeight, const std::wstring& fontName = defaultFontName(),
34
- unsigned fontFlags = ffBold);
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::wstring name() const;
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 textWidth(const std::wstring& text, double factorX = 1) const;
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::wstring& text, double x, double y, ZPos z,
51
- double factorX = 1, double factorY = 1,
52
- Color c = Color::WHITE, AlphaMode mode = amDefault) const;
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 relX Determines where the text is drawn horizontally. If
56
- //! relX is 0.0, the text will be to the right of x, if it is 1.0,
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 relY See relX.
60
- void drawRel(const std::wstring& text, double x, double y, ZPos z,
61
- double relX, double relY, double factorX = 1, double factorY = 1,
62
- Color c = Color::WHITE, AlphaMode mode = amDefault) const;
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 setImage(wchar_t wc, unsigned fontFlags, const Gosu::Image& image);
69
- //! A shortcut for mapping a character to an image regardless of fontFlags.
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 setImage(wchar_t wc, const Gosu::Image& image);
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::pushTransform to achieve the same effect.
81
- void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
82
- double factorX = 1, double factorY = 1,
83
- Color c = Color::WHITE, AlphaMode mode = amDefault) const;
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
@@ -1,31 +1,27 @@
1
- //! \file Fwd.hpp
2
- //! Contains declarations of all of Gosu's available classes.
3
-
4
- #ifndef GOSU_FWD_HPP
5
- #define GOSU_FWD_HPP
6
-
7
- //! The library's main namespace.
8
- namespace Gosu
9
- {
10
- class Audio;
11
- class Bitmap;
12
- class Buffer;
13
- class Button;
14
- class Color;
15
- class File;
16
- class Font;
17
- class Graphics;
18
- class Image;
19
- class ImageData;
20
- class Input;
21
- class Reader;
22
- class Resource;
23
- class Sample;
24
- class Song;
25
- class TextInput;
26
- class Timer;
27
- class Window;
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
+ }
@@ -1,5 +1,5 @@
1
1
  //! \file Gosu.hpp
2
- //! Umbrella header for lazy people with fast compilers, or pre-compiled headers.
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
- #ifndef GOSU_GOSU_HPP
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