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/src/WindowUIKit.mm
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
#include <Gosu/Gosu.hpp>
|
2
|
-
#include "AppleUtility.hpp"
|
3
|
-
#include "UIKit/GosuViewController.h"
|
4
|
-
|
5
|
-
namespace Gosu
|
6
|
-
{
|
7
|
-
unsigned screenWidth()
|
8
|
-
{
|
9
|
-
static CGSize screenSize = [UIScreen mainScreen].bounds.size;
|
10
|
-
static CGFloat width = MIN(screenSize.width, screenSize.height);
|
11
|
-
return width;
|
12
|
-
}
|
13
|
-
|
14
|
-
unsigned screenHeight()
|
15
|
-
{
|
16
|
-
static CGSize screenSize = [UIScreen mainScreen].bounds.size;
|
17
|
-
static CGFloat width = MAX(screenSize.width, screenSize.height);
|
18
|
-
return width;
|
19
|
-
}
|
20
|
-
|
21
|
-
unsigned availableWidth()
|
22
|
-
{
|
23
|
-
return screenWidth();
|
24
|
-
}
|
25
|
-
|
26
|
-
unsigned availableHeight()
|
27
|
-
{
|
28
|
-
return screenHeight();
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
class Gosu::Audio {};
|
33
|
-
|
34
|
-
struct Gosu::Window::Impl
|
35
|
-
{
|
36
|
-
::UIWindow *window;
|
37
|
-
GosuViewController *controller;
|
38
|
-
std::unique_ptr<Graphics> graphics;
|
39
|
-
std::unique_ptr<Input> input;
|
40
|
-
double interval;
|
41
|
-
std::wstring caption;
|
42
|
-
};
|
43
|
-
|
44
|
-
Gosu::Window::Window(unsigned width, unsigned height,
|
45
|
-
bool fullscreen, double updateInterval)
|
46
|
-
: pimpl(new Impl)
|
47
|
-
{
|
48
|
-
pimpl->window = [[::UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
49
|
-
pimpl->controller = [GosuViewController new];
|
50
|
-
pimpl->controller.gosuWindow = this;
|
51
|
-
pimpl->window.rootViewController = pimpl->controller;
|
52
|
-
|
53
|
-
// It is important to load the view before creating the Graphics instance.
|
54
|
-
[pimpl->controller loadView];
|
55
|
-
|
56
|
-
pimpl->graphics.reset(new Graphics(screenHeight(), screenWidth(), false));
|
57
|
-
pimpl->graphics->setResolution(width, height);
|
58
|
-
|
59
|
-
pimpl->input.reset(new Input((__bridge void *)pimpl->controller.view, updateInterval));
|
60
|
-
pimpl->input->setMouseFactors(1.0 * width / screenHeight(), 1.0 * height / screenWidth());
|
61
|
-
|
62
|
-
using namespace std::tr1::placeholders;
|
63
|
-
pimpl->input->onTouchBegan = std::tr1::bind(&Window::touchBegan, this, _1);
|
64
|
-
pimpl->input->onTouchMoved = std::tr1::bind(&Window::touchMoved, this, _1);
|
65
|
-
pimpl->input->onTouchEnded = std::tr1::bind(&Window::touchEnded, this, _1);
|
66
|
-
pimpl->input->onTouchCancelled = std::tr1::bind(&Window::touchCancelled, this, _1);
|
67
|
-
|
68
|
-
pimpl->interval = updateInterval;
|
69
|
-
}
|
70
|
-
|
71
|
-
Gosu::Window::~Window()
|
72
|
-
{
|
73
|
-
}
|
74
|
-
|
75
|
-
std::wstring Gosu::Window::caption() const
|
76
|
-
{
|
77
|
-
return pimpl->caption;
|
78
|
-
}
|
79
|
-
|
80
|
-
void Gosu::Window::setCaption(const std::wstring& caption)
|
81
|
-
{
|
82
|
-
pimpl->caption = caption;
|
83
|
-
}
|
84
|
-
|
85
|
-
double Gosu::Window::updateInterval() const
|
86
|
-
{
|
87
|
-
return pimpl->interval;
|
88
|
-
}
|
89
|
-
|
90
|
-
const Gosu::Graphics& Gosu::Window::graphics() const
|
91
|
-
{
|
92
|
-
return *pimpl->graphics;
|
93
|
-
}
|
94
|
-
|
95
|
-
Gosu::Graphics& Gosu::Window::graphics()
|
96
|
-
{
|
97
|
-
return *pimpl->graphics;
|
98
|
-
}
|
99
|
-
|
100
|
-
const Gosu::Audio& Gosu::Window::audio() const
|
101
|
-
{
|
102
|
-
static Gosu::Audio audio;
|
103
|
-
return audio;
|
104
|
-
}
|
105
|
-
|
106
|
-
Gosu::Audio& Gosu::Window::audio()
|
107
|
-
{
|
108
|
-
static Gosu::Audio audio;
|
109
|
-
return audio;
|
110
|
-
}
|
111
|
-
|
112
|
-
const Gosu::Input& Gosu::Window::input() const
|
113
|
-
{
|
114
|
-
return *pimpl->input;
|
115
|
-
}
|
116
|
-
|
117
|
-
Gosu::Input& Gosu::Window::input()
|
118
|
-
{
|
119
|
-
return *pimpl->input;
|
120
|
-
}
|
121
|
-
|
122
|
-
void Gosu::Window::show()
|
123
|
-
{
|
124
|
-
}
|
125
|
-
|
126
|
-
bool Gosu::Window::tick()
|
127
|
-
{
|
128
|
-
return true;
|
129
|
-
}
|
130
|
-
|
131
|
-
void Gosu::Window::close()
|
132
|
-
{
|
133
|
-
throw std::logic_error("Cannot close windows manually on iOS");
|
134
|
-
}
|
135
|
-
|
136
|
-
void *Gosu::Window::UIWindow() const
|
137
|
-
{
|
138
|
-
return (__bridge void *)pimpl->window;
|
139
|
-
}
|