gosu 0.8.7.2 → 0.9.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +29 -0
  3. data/Gosu/Audio.hpp +1 -0
  4. data/Gosu/Font.hpp +8 -4
  5. data/Gosu/Graphics.hpp +28 -18
  6. data/Gosu/GraphicsBase.hpp +17 -13
  7. data/Gosu/Image.hpp +54 -45
  8. data/Gosu/Input.hpp +5 -5
  9. data/Gosu/Version.hpp +3 -3
  10. data/Gosu/Window.hpp +1 -8
  11. data/README.txt +25 -0
  12. data/ext/gosu/gosu_wrap.cxx +1495 -1275
  13. data/ext/gosu/gosu_wrap.h +2 -2
  14. data/lib/gosu/patches.rb +71 -35
  15. data/lib/gosu/preview.rb +9 -142
  16. data/lib/gosu/swig_patches.rb +20 -10
  17. data/rdoc/gosu.rb +1185 -0
  18. data/src/Bitmap/BitmapUtils.cpp +9 -9
  19. data/src/Graphics/Common.hpp +3 -1
  20. data/src/Graphics/Graphics.cpp +100 -38
  21. data/src/Graphics/Image.cpp +57 -15
  22. data/src/Graphics/LargeImageData.cpp +9 -10
  23. data/src/Graphics/LargeImageData.hpp +1 -1
  24. data/src/Graphics/TexChunk.cpp +5 -6
  25. data/src/Graphics/TexChunk.hpp +1 -4
  26. data/src/Graphics/Texture.cpp +10 -3
  27. data/src/Graphics/Texture.hpp +1 -2
  28. data/src/Iconv.hpp +2 -2
  29. data/src/Input/Input.cpp +25 -9
  30. data/src/Input/InputTouch.mm +5 -3
  31. data/src/Text/Font.cpp +13 -8
  32. data/src/Window.cpp +66 -37
  33. data/src/WindowTouch.mm +3 -3
  34. metadata +79 -92
  35. data/examples/ChipmunkIntegration.rb +0 -275
  36. data/examples/CptnRuby.rb +0 -223
  37. data/examples/GosuZen.rb +0 -68
  38. data/examples/MoreChipmunkAndRMagick.rb +0 -155
  39. data/examples/OpenGLIntegration.rb +0 -226
  40. data/examples/RMagickIntegration.rb +0 -417
  41. data/examples/TextInput.rb +0 -154
  42. data/examples/Tutorial.rb +0 -131
  43. data/examples/media/Beep.wav +0 -0
  44. data/examples/media/CptnRuby Gem.png +0 -0
  45. data/examples/media/CptnRuby Map.txt +0 -25
  46. data/examples/media/CptnRuby Tileset.png +0 -0
  47. data/examples/media/CptnRuby.png +0 -0
  48. data/examples/media/Cursor.png +0 -0
  49. data/examples/media/Earth.png +0 -0
  50. data/examples/media/Explosion.wav +0 -0
  51. data/examples/media/Landscape.svg +0 -10
  52. data/examples/media/LargeStar.png +0 -0
  53. data/examples/media/Smoke.png +0 -0
  54. data/examples/media/Soldier.png +0 -0
  55. data/examples/media/Space.png +0 -0
  56. data/examples/media/Star.png +0 -0
  57. data/examples/media/Starfighter.bmp +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 564e517e2fe465b35b11306eba8721dc1d98bb51
4
- data.tar.gz: 48af31272649efe1e319f2d396ad52b9877849f9
3
+ metadata.gz: dd11308d7e4ec0b716285c993461a7eb3d0f4069
4
+ data.tar.gz: 72ae78ce681cbf45756c97d6267acca346bd08a9
5
5
  SHA512:
6
- metadata.gz: 13f4c5098555aaa675e30988431440ede46aede40c4500aad8a8ecd1e7beba5175b4d62420279e1ace487c6d7575ed1c620c2d29c41793a6c346865f16fa5bb7
7
- data.tar.gz: 8b28e1456134753e7b66dbbe023cd0f658a3ed5b28fb0df991f2b40ab62ebcb13a15c31ee9b7fd4f6774ff0a55bf37935a995aee3d94932eae236e1b5962f5f9
6
+ metadata.gz: f4c3400c2284f15cf12b9f036232c1790c77b63e76b6dfe19559b6fc2445ae57468fad1d5fdedd1d1c8a35ed39a16c4d7c10917498d2d5f6442da49890fc1bbb
7
+ data.tar.gz: 2a013ba899728594d5fabb8243c766c11eb08ae603485c435be051b1f6e3977a3287713b6ee9f852aa81a4febf5f40c7dd69bcc02e2e3b1c3a6fd4d91baa6787
data/COPYING ADDED
@@ -0,0 +1,29 @@
1
+ Copyright (C) 2001-2015 Julian Raschke, Jan Lücker and all contributors.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ DEALINGS IN THE SOFTWARE.
20
+
21
+ Julian Raschke <julian@raschke.de> & contributors
22
+ http://www.libgosu.org/
23
+
24
+ ***
25
+
26
+ This does NOT apply to libogg and libvorbis, which are included in all source
27
+ and binary distributions of Gosu. These projects are licensed under a BSD-like
28
+ license, and their copyright terms need to be supplied even with binary
29
+ redistributions (e.g. Gosu games).
@@ -36,6 +36,7 @@ namespace Gosu
36
36
 
37
37
  public:
38
38
  //! Called by Sample, do not use.
39
+ // TODO: See if we can use 'friend' here.
39
40
  SampleInstance(int handle, int extra);
40
41
 
41
42
  bool playing() const;
@@ -8,6 +8,7 @@
8
8
  #include <Gosu/Color.hpp>
9
9
  #include <Gosu/GraphicsBase.hpp>
10
10
  #include <Gosu/Platform.hpp>
11
+ #include <Gosu/Text.hpp>
11
12
  #include <Gosu/TR1.hpp>
12
13
  #include <string>
13
14
 
@@ -29,8 +30,8 @@ namespace Gosu
29
30
  //! \param fontHeight Height of the font, in pixels.
30
31
  //! \param fontFlags Flags used to render individual characters of
31
32
  //! the font.
32
- Font(Graphics& graphics, const std::wstring& fontName,
33
- unsigned fontHeight, unsigned fontFlags = ffBold);
33
+ Font(unsigned fontHeight, const std::wstring& fontName = defaultFontName(),
34
+ unsigned fontFlags = ffBold);
34
35
 
35
36
  //! Returns the name of the font that was used to create it.
36
37
  std::wstring name() const;
@@ -70,10 +71,13 @@ namespace Gosu
70
71
  void setImage(wchar_t wc, const Gosu::Image& image);
71
72
 
72
73
  #ifndef SWIG
74
+ GOSU_DEPRECATED Font(Graphics& graphics, const std::wstring& fontName,
75
+ unsigned fontHeight, unsigned fontFlags = ffBold);
76
+
73
77
  GOSU_DEPRECATED
74
78
  #endif
75
- //! DEPRECATED: Analogous to draw, but rotates the text by a given angle. Use
76
- //! a simple pushTransform to achieve the same effect.
79
+ //! DEPRECATED: Analogous to draw, but rotates the text by a given angle.
80
+ //! Use Graphics::pushTransform to achieve the same effect.
77
81
  void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
78
82
  double factorX = 1, double factorY = 1,
79
83
  Color c = Color::WHITE, AlphaMode mode = amDefault) const;
@@ -12,6 +12,8 @@
12
12
 
13
13
  namespace Gosu
14
14
  {
15
+ struct DrawOp;
16
+
15
17
  //! Returns the maximum size of an texture that will be allocated
16
18
  //! internally by Gosu.
17
19
  //! Useful when extending Gosu using OpenGL.
@@ -20,9 +22,15 @@ namespace Gosu
20
22
  //! Serves as the target of all drawing and provides primitive drawing
21
23
  //! functionality.
22
24
  //! Usually created internally by Gosu::Window.
25
+ //
26
+ // TODO: This class should be separated into a Gosu::Viewport class, which
27
+ // carries the width/height/fullscreen attributes, and global Gosu::drawFoo
28
+ // functions. A Window then has a Viewport, and in theory, multiple windows
29
+ // could have their own viewports etc.
23
30
  class Graphics
24
31
  {
25
32
  struct Impl;
33
+
26
34
  const GOSU_UNIQUE_PTR<Impl> pimpl;
27
35
 
28
36
  #if defined(GOSU_CPP11_ENABLED)
@@ -37,7 +45,6 @@ namespace Gosu
37
45
  Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen);
38
46
  ~Graphics();
39
47
 
40
- // TODO: Replace by setBaseTransform()
41
48
  void setResolution(unsigned virtualWidth, unsigned virtualHeight,
42
49
  double horizontalBlackBarWidth = 0, double verticalBlackBarHeight = 0);
43
50
 
@@ -50,65 +57,68 @@ namespace Gosu
50
57
  bool begin(Color clearWithColor = Color::BLACK);
51
58
  //! Every call to begin must have a matching call to end.
52
59
  void end();
60
+
53
61
  //! Flushes the Z queue to the screen and starts a new one.
54
62
  //! Useful for games that are *very* composite in nature (splitscreen).
55
- void flush();
63
+ static void flush();
56
64
 
57
65
  //! Finishes all pending Gosu drawing operations and executes
58
66
  //! the following OpenGL code in a clean environment.
59
- void beginGL();
67
+ static void beginGL();
60
68
  //! Resets Gosu into its default rendering state.
61
- void endGL();
69
+ static void endGL();
62
70
  //! Schedules a custom GL functor to be executed at a certain Z level.
63
71
  //! The functor is called in a clean GL context (as given by beginGL/endGL).
64
72
  //! Gosu's rendering up to the Z level may not yet have been glFlush()ed.
65
73
  //! Note: You may not call any Gosu rendering functions from within the
66
74
  //! functor, and you must schedule it from within Window::draw's call tree.
67
- void scheduleGL(const std::tr1::function<void()>& functor, ZPos z);
75
+ static void scheduleGL(const std::tr1::function<void()>& functor, ZPos z);
68
76
 
69
77
  //! Enables clipping to a specified rectangle.
70
- void beginClipping(double x, double y, double width, double height);
78
+ static void beginClipping(double x, double y, double width, double height);
71
79
  //! Disables clipping.
72
- void endClipping();
80
+ static void endClipping();
73
81
 
74
82
  //! Starts recording a macro. Cannot be nested.
75
- void beginRecording();
83
+ static void beginRecording();
76
84
  //! Finishes building the macro and returns it as a drawable object.
77
85
  //! The width and height affect nothing about the recording process,
78
86
  //! the resulting macro will simply return these values when you ask
79
87
  //! it.
80
88
  //! Most usually, the return value is passed to Image::Image().
81
- GOSU_UNIQUE_PTR<Gosu::ImageData> endRecording(int width, int height);
89
+ static GOSU_UNIQUE_PTR<Gosu::ImageData> endRecording(int width, int height);
82
90
 
83
91
  //! Pushes one transformation onto the transformation stack.
84
- void pushTransform(const Transform& transform);
92
+ static void pushTransform(const Transform& transform);
85
93
  //! Pops one transformation from the transformation stack.
86
- void popTransform();
94
+ static void popTransform();
87
95
 
88
96
  //! Draws a line from one point to another (last pixel exclusive).
89
97
  //! Note: OpenGL lines are not reliable at all and may have a missing pixel at the start
90
98
  //! or end point. Please only use this for debugging purposes. Otherwise, use a quad or
91
99
  //! image to simulate lines, or contribute a better drawLine to Gosu.
92
- void drawLine(double x1, double y1, Color c1,
100
+ static void drawLine(double x1, double y1, Color c1,
93
101
  double x2, double y2, Color c2,
94
102
  ZPos z, AlphaMode mode = amDefault);
95
103
 
96
- void drawTriangle(double x1, double y1, Color c1,
104
+ static void drawTriangle(double x1, double y1, Color c1,
97
105
  double x2, double y2, Color c2,
98
106
  double x3, double y3, Color c3,
99
107
  ZPos z, AlphaMode mode = amDefault);
100
108
 
101
- void drawQuad(double x1, double y1, Color c1,
109
+ static void drawQuad(double x1, double y1, Color c1,
102
110
  double x2, double y2, Color c2,
103
111
  double x3, double y3, Color c3,
104
112
  double x4, double y4, Color c4,
105
113
  ZPos z, AlphaMode mode = amDefault);
114
+
115
+ //! For internal use only.
116
+ static void scheduleDrawOp(const DrawOp& op);
106
117
 
107
- //! Turns a portion of a bitmap into something that can be drawn on
108
- //! this graphics object.
109
- GOSU_UNIQUE_PTR<ImageData> createImage(const Bitmap& src,
118
+ //! Turns a portion of a bitmap into something that can be drawn on a Graphics object.
119
+ static GOSU_UNIQUE_PTR<ImageData> createImage(const Bitmap& src,
110
120
  unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight,
111
- unsigned borderFlags);
121
+ unsigned imageFlags);
112
122
  };
113
123
  }
114
124
 
@@ -31,11 +31,11 @@ namespace Gosu
31
31
  //! The color's channels will be multiplied with each other.
32
32
  MULTIPLY
33
33
  };
34
- GOSU_DEPRECATED constexpr AlphaMode amDefault = AlphaMode::DEFAULT;
35
- GOSU_DEPRECATED constexpr AlphaMode amInterpolate = AlphaMode::INTERPOLATE;
36
- GOSU_DEPRECATED constexpr AlphaMode amAdd = AlphaMode::ADD;
37
- GOSU_DEPRECATED constexpr AlphaMode amAdditive = AlphaMode::ADD;
38
- GOSU_DEPRECATED constexpr AlphaMode amMultiply = AlphaMode::MULTIPLY;
34
+ constexpr AlphaMode amDefault = AlphaMode::DEFAULT;
35
+ constexpr AlphaMode amInterpolate = AlphaMode::INTERPOLATE;
36
+ constexpr AlphaMode amAdd = AlphaMode::ADD;
37
+ constexpr AlphaMode amAdditive = AlphaMode::ADD;
38
+ constexpr AlphaMode amMultiply = AlphaMode::MULTIPLY;
39
39
  #else
40
40
  enum AlphaMode
41
41
  {
@@ -68,15 +68,19 @@ namespace Gosu
68
68
  taJustify
69
69
  };
70
70
 
71
- //! Flags that affect the tileability of an image.
72
- enum BorderFlags
71
+ enum ImageFlags
73
72
  {
74
- bfSmooth = 0,
75
- bfTileableLeft = 1,
76
- bfTileableTop = 2,
77
- bfTileableRight = 4,
78
- bfTileableBottom = 8,
79
- bfTileable = bfTileableLeft | bfTileableTop | bfTileableRight | bfTileableBottom
73
+ //! Flags that affect the tileability of an image.
74
+ ifSmooth = 0,
75
+ // Note: No constant for '1', but Gosu treats '1' as ifTileable for
76
+ // backward compatibility reasons (this used to be a bool).
77
+ ifTileableLeft = 2,
78
+ ifTileableTop = 4,
79
+ ifTileableRight = 8,
80
+ ifTileableBottom = 16,
81
+ ifTileable = ifTileableLeft | ifTileableTop | ifTileableRight | ifTileableBottom
82
+
83
+ // TODO - ifNearestNeighbor to replace undocumentedRetrofication.
80
84
  };
81
85
 
82
86
  #ifdef GOSU_IS_MAC
@@ -19,31 +19,29 @@ namespace Gosu
19
19
  std::tr1::shared_ptr<ImageData> data;
20
20
 
21
21
  public:
22
- //! Loads an image from a given filename that can be drawn onto
23
- //! graphics.
24
- //! This constructor can handle PNG and BMP images. A color key of #ff00ff is
25
- //! automatically applied to BMP type images. For more flexibility, use the
26
- //! corresponding constructor that uses a Bitmap object.
27
- Image(Graphics& graphics, const std::wstring& filename,
28
- bool tileable = false);
29
- //! Loads a portion of the the image at the given filename that can be
30
- //! drawn onto graphics.
31
- //! This constructor can handle PNG and BMP images. A color key of #ff00ff is
32
- //! automatically applied to BMP type images. For more flexibility, use the
33
- //! corresponding constructor that uses a Bitmap object.
34
- Image(Graphics& graphics, const std::wstring& filename, unsigned srcX,
22
+ //! Loads an image from a given filename.
23
+ //!
24
+ //! A color key of #ff00ff is automatically applied to BMP image files.
25
+ //! For more flexibility, use the corresponding constructor that uses a Bitmap object.
26
+ explicit Image(const std::wstring& filename,
27
+ unsigned imageFlags = ifSmooth);
28
+
29
+ //! Loads a portion of the the image at the given filename..
30
+ //!
31
+ //! A color key of #ff00ff is automatically applied to BMP image files.
32
+ //! For more flexibility, use the corresponding constructor that uses a Bitmap object.
33
+ Image(const std::wstring& filename, unsigned srcX,
35
34
  unsigned srcY, unsigned srcWidth, unsigned srcHeight,
36
- bool tileable = false);
35
+ unsigned imageFlags = ifSmooth);
37
36
 
38
- //! Converts the given bitmap into an image that can be drawn onto
39
- //! graphics.
40
- Image(Graphics& graphics, const Bitmap& source,
41
- bool tileable = false);
42
- //! Converts a portion of the given bitmap into an image that can be
43
- //! drawn onto graphics.
44
- Image(Graphics& graphics, const Bitmap& source, unsigned srcX,
37
+ //! Converts the given bitmap into an image.
38
+ explicit Image(const Bitmap& source,
39
+ unsigned imageFlags = ifSmooth);
40
+
41
+ //! Converts a portion of the given bitmap into an image.
42
+ Image(const Bitmap& source, unsigned srcX,
45
43
  unsigned srcY, unsigned srcWidth, unsigned srcHeight,
46
- bool tileable = false);
44
+ unsigned imageFlags = ifSmooth);
47
45
 
48
46
  //! Creates an Image from a user-supplied instance of the ImageData interface.
49
47
  explicit Image(GOSU_UNIQUE_PTR<ImageData> data);
@@ -56,8 +54,8 @@ namespace Gosu
56
54
  double factorX = 1, double factorY = 1,
57
55
  Color c = Color::WHITE,
58
56
  AlphaMode mode = amDefault) const;
59
- //! Like draw(), but allows to give modulation colors for all four
60
- //! corners.
57
+ //! Like draw(), but with modulation colors for all four corners.
58
+ //! TODO: This can be an overload of draw() - in any case the name is terrible.
61
59
  void drawMod(double x, double y, ZPos z,
62
60
  double factorX, double factorY,
63
61
  Color c1, Color c2, Color c3, Color c4,
@@ -77,46 +75,57 @@ namespace Gosu
77
75
  double factorX = 1, double factorY = 1,
78
76
  Color c = Color::WHITE,
79
77
  AlphaMode mode = amDefault) const;
80
-
78
+
79
+ #ifndef SWIG
81
80
  //! Provides access to the underlying image data object.
82
81
  ImageData& getData() const;
82
+
83
+ GOSU_DEPRECATED Image(Graphics& graphics, const std::wstring& filename,
84
+ bool tileable = false);
85
+ GOSU_DEPRECATED Image(Graphics& graphics, const std::wstring& filename, unsigned srcX,
86
+ unsigned srcY, unsigned srcWidth, unsigned srcHeight,
87
+ bool tileable = false);
88
+ GOSU_DEPRECATED Image(Graphics& graphics, const Bitmap& source,
89
+ bool tileable = false);
90
+ GOSU_DEPRECATED Image(Graphics& graphics, const Bitmap& source, unsigned srcX,
91
+ unsigned srcY, unsigned srcWidth, unsigned srcHeight,
92
+ bool tileable = false);
93
+ #endif
83
94
  };
84
95
 
85
- std::vector<Gosu::Image> loadTiles(Graphics& graphics, const Bitmap& bmp, int tileWidth, int tileHeight, bool tileable);
86
- std::vector<Gosu::Image> loadTiles(Graphics& graphics, const std::wstring& bmp, int tileWidth, int tileHeight, bool tileable);
96
+ #ifndef SWIG
97
+ //! Convenience function that slices an image file into a grid and creates images from them.
98
+ //! \param tileWidth If positive, specifies the width of one tile in pixels.
99
+ //! If negative, the bitmap is divided into -tileWidth rows.
100
+ //! \param tileHeight See tileWidth.
101
+ std::vector<Gosu::Image> loadTiles(const Bitmap& bmp,
102
+ int tileWidth, int tileHeight, unsigned imageFlags = ifSmooth);
87
103
 
88
- //! Convenience function that splits a BMP or PNG file into an array
89
- //! of small rectangles and creates images from them.
90
- //! \param tileWidth If positive, specifies the width of one tile in
91
- //! pixels. If negative, the bitmap is divided into -tileWidth rows.
104
+ //! Convenience function that slices a bitmap into a grid and creates images from them.
105
+ //! \param tileWidth If positive, specifies the width of one tile in pixels.
106
+ //! If negative, the bitmap is divided into -tileWidth rows.
92
107
  //! \param tileHeight See tileWidth.
93
- //! \param appendTo STL container to which the images will be appended.
94
- //! Must provide a push_back member function; vector<tr1::shared_ptr<Image>>
95
- //! or boost::ptr_vector<Image> are good choices.
108
+ std::vector<Gosu::Image> loadTiles(const std::wstring& filename,
109
+ int tileWidth, int tileHeight, unsigned imageFlags = ifSmooth);
110
+
111
+ GOSU_DEPRECATED std::vector<Gosu::Image> loadTiles(Graphics& graphics, const Bitmap& bmp, int tileWidth, int tileHeight, bool tileable);
112
+ GOSU_DEPRECATED std::vector<Gosu::Image> loadTiles(Graphics& graphics, const std::wstring& bmp, int tileWidth, int tileHeight, bool tileable);
96
113
  template<typename Container>
97
- void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename, int tileWidth, int tileHeight, bool tileable, Container& appendTo)
114
+ GOSU_DEPRECATED void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename, int tileWidth, int tileHeight, bool tileable, Container& appendTo)
98
115
  {
99
116
  std::vector<Gosu::Image> tiles = loadTiles(graphics, filename, tileWidth, tileHeight, tileable);
100
117
  for (int i = 0, num = tiles.size(); i < num; ++i)
101
118
  appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
102
119
  }
103
-
104
- //! Convenience function that splits a bitmap into an area of array
105
- //! rectangles and creates images from them.
106
- //! \param tileWidth If positive, specifies the width of one tile in
107
- //! pixels. If negative, the bitmap is divided into -tileWidth rows.
108
- //! \param tileHeight See tileWidth.
109
- //! \param appendTo STL container to which the images will be appended.
110
- //! Must provide a push_back member function; std::vector<std::tr1::shared_ptr<Image>>
111
- //! or boost::ptr_vector<Image> are good choices.
112
120
  template<typename Container>
113
- void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
121
+ GOSU_DEPRECATED void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
114
122
  int tileWidth, int tileHeight, bool tileable, Container& appendTo)
115
123
  {
116
124
  std::vector<Gosu::Image> tiles = loadTiles(graphics, bmp, tileWidth, tileHeight, tileable);
117
125
  for (int i = 0, num = tiles.size(); i < num; ++i)
118
126
  appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
119
127
  }
128
+ #endif
120
129
  }
121
130
 
122
131
  #endif
@@ -103,7 +103,7 @@ namespace Gosu
103
103
 
104
104
  //! Returns true if a button is currently pressed.
105
105
  //! Updated every tick.
106
- bool down(Button btn) const;
106
+ static bool down(Button btn);
107
107
 
108
108
  //! Returns the horizontal position of the mouse relative to the top
109
109
  //! left corner of the window given to Input's constructor.
@@ -112,8 +112,8 @@ namespace Gosu
112
112
  double mouseY() const;
113
113
 
114
114
  //! Immediately moves the mouse as far towards the desired position
115
- //! as possible. x and y are relativ to the window just as in the mouse
116
- //! position accessors.
115
+ //! as possible. x and y are relative to the window, just as in mouseX()
116
+ //! and mouseY(), so (0, 0) is the top left corner of the window..
117
117
  void setMousePosition(double x, double y);
118
118
 
119
119
  // Undocumented for the moment. Also applies to currentTouches().
@@ -132,11 +132,11 @@ namespace Gosu
132
132
  void update();
133
133
 
134
134
  //! Assignable events that are called by update. You can bind these to your own functions.
135
- //! If you use the Window class, it will assign forward these to its own methods.
135
+ //! If you use the Window class, it will assign these to its own methods.
136
136
  std::tr1::function<void (Button)> onButtonDown, onButtonUp;
137
137
 
138
138
  //! Assignable events that are called by update. You can bind these to your own functions.
139
- //! If you use the Window class, it will assign forward these to its own methods.
139
+ //! If you use the Window class, it will assign these to its own methods.
140
140
  std::tr1::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded;
141
141
 
142
142
  //! Returns the currently active TextInput instance, or 0.
@@ -2,9 +2,9 @@
2
2
  #define GOSU_VERSION_HPP
3
3
 
4
4
  #define GOSU_MAJOR_VERSION 0
5
- #define GOSU_MINOR_VERSION 8
6
- #define GOSU_POINT_VERSION 7
7
- #define GOSU_VERSION "0.8.7"
5
+ #define GOSU_MINOR_VERSION 9
6
+ #define GOSU_POINT_VERSION 0
7
+ #define GOSU_VERSION "0.9.0.pre1"
8
8
 
9
9
  #define GOSU_COPYRIGHT_NOTICE \
10
10
  "This software uses the following third-party libraries:\n" \
@@ -57,7 +57,7 @@ namespace Gosu
57
57
  //! \param height See width.
58
58
  //! \param updateInterval Interval in milliseconds between two calls
59
59
  //! to the update member function.
60
- Window(unsigned width, unsigned height, bool fullscreen,
60
+ Window(unsigned width, unsigned height, bool fullscreen = false,
61
61
  double updateInterval = 16.666666);
62
62
  virtual ~Window();
63
63
 
@@ -113,13 +113,6 @@ namespace Gosu
113
113
  const Input& input() const;
114
114
  Input& input();
115
115
 
116
- #ifdef GOSU_IS_UNIX
117
- // Context for creating shared contexts.
118
- // Only on Unices (so far).
119
- typedef std::tr1::shared_ptr<std::tr1::function<void()> > SharedContext;
120
- SharedContext createSharedContext();
121
- #endif
122
-
123
116
  #ifdef GOSU_IS_IPHONE
124
117
  void* rootViewController() const;
125
118
  // iPhone-only callbacks for touch events.