gosu 0.7.50 → 0.8.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +1 -1
- data/Gosu/Buttons.hpp +97 -97
- data/Gosu/Graphics.hpp +5 -26
- data/Gosu/GraphicsBase.hpp +27 -4
- data/Gosu/Input.hpp +8 -19
- data/Gosu/Platform.hpp +5 -1
- data/Gosu/TextInput.hpp +5 -11
- data/Gosu/Version.hpp +3 -3
- data/GosuImpl/Graphics/Common.hpp +2 -11
- data/GosuImpl/Graphics/DrawOp.hpp +23 -27
- data/GosuImpl/Graphics/DrawOpQueue.hpp +2 -2
- data/GosuImpl/Graphics/Graphics.cpp +55 -18
- data/GosuImpl/Graphics/Macro.hpp +1 -1
- data/GosuImpl/Graphics/RenderState.hpp +2 -2
- data/GosuImpl/Graphics/TexChunk.cpp +1 -1
- data/GosuImpl/Graphics/TextUnix.cpp +1 -1
- data/GosuImpl/Graphics/Texture.cpp +2 -2
- data/GosuImpl/Graphics/Transform.cpp +15 -3
- data/GosuImpl/Graphics/TransformStack.hpp +2 -2
- data/GosuImpl/Input.cpp +329 -0
- data/GosuImpl/TextInput.cpp +239 -0
- data/GosuImpl/Window.cpp +215 -0
- data/lib/gosu/swig_patches.rb +1 -0
- data/linux/extconf.rb +10 -16
- metadata +8 -6
- data/GosuImpl/WindowMac.mm +0 -574
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44a9c34018bb68377bbebea3d2b032802164035f
|
4
|
+
data.tar.gz: c54379a8fc21c22f1134e25fcab64eb86b03affb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1097c5da7679685396bbd3dafa24ad914813a025277ad110b039a9ae8d8b70cae79b5188d3def18e08b5a668c0c32102d303957f3163c7ee3730069bf9ce795c
|
7
|
+
data.tar.gz: 47e91556e91d55cead8de660b37c621ab40a5f712f6047147f4424fce9b55f069a94b5c2b3eb6d378b1aee95139d7b82df5724789b7fc4cfd68129ffd4f67cd9
|
data/COPYING
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (C)
|
1
|
+
Copyright (C) 2001-2014 Julian Raschke, Jan Lücker and all contributors.
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a
|
4
4
|
copy of this software and associated documentation files (the "Software"),
|
data/Gosu/Buttons.hpp
CHANGED
@@ -23,103 +23,103 @@ namespace Gosu
|
|
23
23
|
enum ButtonName
|
24
24
|
{
|
25
25
|
kbRangeBegin,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
26
|
+
kbEscape = 41,
|
27
|
+
kbF1 = 58,
|
28
|
+
kbF2 = 59,
|
29
|
+
kbF3 = 60,
|
30
|
+
kbF4 = 61,
|
31
|
+
kbF5 = 62,
|
32
|
+
kbF6 = 63,
|
33
|
+
kbF7 = 64,
|
34
|
+
kbF8 = 65,
|
35
|
+
kbF9 = 66,
|
36
|
+
kbF10 = 67,
|
37
|
+
kbF11 = 68,
|
38
|
+
kbF12 = 69,
|
39
|
+
kb0 = 30,
|
40
|
+
kb1 = 31,
|
41
|
+
kb2 = 32,
|
42
|
+
kb3 = 33,
|
43
|
+
kb4 = 34,
|
44
|
+
kb5 = 35,
|
45
|
+
kb6 = 36,
|
46
|
+
kb7 = 37,
|
47
|
+
kb8 = 38,
|
48
|
+
kb9 = 39,
|
49
|
+
kbTab = 43,
|
50
|
+
kbReturn = 40,
|
51
|
+
kbSpace = 44,
|
52
|
+
kbLeftShift = 225,
|
53
|
+
kbRightShift = 229,
|
54
|
+
kbLeftControl = 224,
|
55
|
+
kbRightControl = 228,
|
56
|
+
kbLeftAlt = 226,
|
57
|
+
kbRightAlt = 230,
|
58
|
+
kbLeftMeta = 227,
|
59
|
+
kbRightMeta = 231,
|
60
|
+
kbBackspace = 42,
|
61
|
+
kbLeft = 80,
|
62
|
+
kbRight = 79,
|
63
|
+
kbUp = 82,
|
64
|
+
kbDown = 81,
|
65
|
+
kbHome = 74,
|
66
|
+
kbEnd = 77,
|
67
|
+
kbInsert = 73,
|
68
|
+
kbDelete = 76,
|
69
|
+
kbPageUp = 75,
|
70
|
+
kbPageDown = 78,
|
71
|
+
kbEnter = 88,
|
72
|
+
kbBacktick = 53,
|
73
|
+
kbMinus = 45,
|
74
|
+
kbEqual = 46, // TODO: Rename ->kbEquals
|
75
|
+
kbBracketLeft = 47, // TODO: Rename ->kbLeftBracket
|
76
|
+
kbBracketRight = 48, // TODO: Rename ->kbRightBracket
|
77
|
+
kbBackslash = 49,
|
78
|
+
kbSemicolon = 51,
|
79
|
+
kbApostrophe = 52,
|
80
|
+
kbComma = 54,
|
81
|
+
kbPeriod = 55,
|
82
|
+
kbSlash = 49,
|
83
|
+
kbA = 4,
|
84
|
+
kbB = 5,
|
85
|
+
kbC = 6,
|
86
|
+
kbD = 7,
|
87
|
+
kbE = 8,
|
88
|
+
kbF = 9,
|
89
|
+
kbG = 10,
|
90
|
+
kbH = 11,
|
91
|
+
kbI = 12,
|
92
|
+
kbJ = 13,
|
93
|
+
kbK = 14,
|
94
|
+
kbL = 15,
|
95
|
+
kbM = 16,
|
96
|
+
kbN = 17,
|
97
|
+
kbO = 18,
|
98
|
+
kbP = 19,
|
99
|
+
kbQ = 20,
|
100
|
+
kbR = 21,
|
101
|
+
kbS = 22,
|
102
|
+
kbT = 23,
|
103
|
+
kbU = 24,
|
104
|
+
kbV = 25,
|
105
|
+
kbW = 26,
|
106
|
+
kbX = 27,
|
107
|
+
kbY = 28,
|
108
|
+
kbZ = 29,
|
109
|
+
kbNumpad0 = 98,
|
110
|
+
kbNumpad1 = 89,
|
111
|
+
kbNumpad2 = 90,
|
112
|
+
kbNumpad3 = 91,
|
113
|
+
kbNumpad4 = 92,
|
114
|
+
kbNumpad5 = 93,
|
115
|
+
kbNumpad6 = 94,
|
116
|
+
kbNumpad7 = 95,
|
117
|
+
kbNumpad8 = 96,
|
118
|
+
kbNumpad9 = 97,
|
119
|
+
kbNumpadAdd = 87, // TODO: Rename ->kbNumpadPlus
|
120
|
+
kbNumpadSubtract = 86, // TODO: Rename ->kbNumpadMinus
|
121
|
+
kbNumpadMultiply = 85,
|
122
|
+
kbNumpadDivide = 84,
|
123
123
|
kbRangeEnd = 0xff,
|
124
124
|
|
125
125
|
msRangeBegin,
|
data/Gosu/Graphics.hpp
CHANGED
@@ -23,26 +23,6 @@ namespace Gosu
|
|
23
23
|
//! Useful when extending Gosu using OpenGL.
|
24
24
|
unsigned const MAX_TEXTURE_SIZE = 1024;
|
25
25
|
|
26
|
-
#ifdef GOSU_IS_MAC
|
27
|
-
// TODO: Without this gigantic hack, Gosu crashes in the "scale" function,
|
28
|
-
// but _only_ when used from Ruby 1.9. It is unclear what might cause this -
|
29
|
-
// maybe a compiler bug that tries to use SSE functions with the wrong
|
30
|
-
// alignment. Adding __attribute__((aligned(16))) does not help, though.
|
31
|
-
struct Transform
|
32
|
-
{
|
33
|
-
double value[16];
|
34
|
-
bool operator==(const Transform &other) { for (int i = 0; i < 16; ++i) if ((*this)[i] != other[i]) return false; return true; }
|
35
|
-
const double &operator[](std::size_t idx) const { return value[idx]; }
|
36
|
-
double &operator[](std::size_t idx) { return value[idx]; }
|
37
|
-
};
|
38
|
-
#else
|
39
|
-
typedef std::tr1::array<double, 16> Transform;
|
40
|
-
#endif
|
41
|
-
Transform translate(double x, double y);
|
42
|
-
Transform rotate(double angle, double aroundX = 0, double aroundY = 0);
|
43
|
-
Transform scale(double factor);
|
44
|
-
Transform scale(double factorX, double factorY, double fromX = 0, double fromY = 0);
|
45
|
-
|
46
26
|
//! Serves as the target of all drawing and provides primitive drawing
|
47
27
|
//! functionality.
|
48
28
|
//! Usually created internally by Gosu::Window.
|
@@ -51,21 +31,21 @@ namespace Gosu
|
|
51
31
|
struct Impl;
|
52
32
|
const GOSU_UNIQUE_PTR<Impl> pimpl;
|
53
33
|
|
54
|
-
#if defined(GOSU_CPP11_ENABLED)
|
34
|
+
#if defined(GOSU_CPP11_ENABLED)
|
55
35
|
// explicitly forbid copying and moving
|
56
36
|
Graphics(Graphics&&) = delete;
|
57
37
|
Graphics& operator=(Graphics&&) = delete;
|
58
38
|
Graphics(const Graphics&) = delete;
|
59
39
|
Graphics& operator=(const Graphics&) = delete;
|
60
|
-
#endif
|
40
|
+
#endif
|
61
41
|
|
62
42
|
public:
|
63
43
|
Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen);
|
64
44
|
~Graphics();
|
65
45
|
|
66
|
-
//
|
67
|
-
void setResolution(unsigned virtualWidth, unsigned virtualHeight
|
68
|
-
|
46
|
+
// TODO: Replace by setBaseTransform()
|
47
|
+
void setResolution(unsigned virtualWidth, unsigned virtualHeight,
|
48
|
+
double horizontalBlackBarWidth = 0, double verticalBlackBarHeight = 0);
|
69
49
|
|
70
50
|
unsigned width() const;
|
71
51
|
unsigned height() const;
|
@@ -85,7 +65,6 @@ namespace Gosu
|
|
85
65
|
void beginGL();
|
86
66
|
//! Resets Gosu into its default rendering state.
|
87
67
|
void endGL();
|
88
|
-
//! (Experimental)
|
89
68
|
//! Schedules a custom GL functor to be executed at a certain Z level.
|
90
69
|
//! The functor is called in a clean GL context (as given by beginGL/endGL).
|
91
70
|
//! Gosu's rendering up to the Z level may not yet have been glFlush()ed.
|
data/Gosu/GraphicsBase.hpp
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
#define GOSU_GRAPHICSBASE_HPP
|
6
6
|
|
7
7
|
#include <Gosu/Platform.hpp>
|
8
|
+
#include <Gosu/TR1.hpp>
|
8
9
|
#include <limits>
|
9
10
|
|
10
11
|
namespace Gosu
|
@@ -76,12 +77,34 @@ namespace Gosu
|
|
76
77
|
bfTileableRight = 4,
|
77
78
|
bfTileableBottom = 8,
|
78
79
|
bfTileable = bfTileableLeft | bfTileableTop | bfTileableRight | bfTileableBottom
|
79
|
-
};
|
80
|
+
};
|
80
81
|
|
81
|
-
|
82
|
-
//
|
82
|
+
#ifdef GOSU_IS_MAC
|
83
|
+
// TODO: Without this gigantic hack, Gosu crashes in the "scale" function,
|
84
|
+
// but _only_ when used from Ruby 1.9. It is unclear what might cause this -
|
85
|
+
// maybe a compiler bug that tries to use SSE functions with the wrong
|
86
|
+
// alignment. Adding __attribute__((aligned(16))) does not help, though.
|
87
|
+
struct Transform
|
88
|
+
{
|
89
|
+
double value[16];
|
90
|
+
bool operator==(const Transform &other) { for (int i = 0; i < 16; ++i) if ((*this)[i] != other[i]) return false; return true; }
|
91
|
+
const double &operator[](std::size_t idx) const { return value[idx]; }
|
92
|
+
double &operator[](std::size_t idx) { return value[idx]; }
|
93
|
+
};
|
94
|
+
#else
|
95
|
+
typedef std::tr1::array<double, 16> Transform;
|
96
|
+
#endif
|
97
|
+
Transform translate(double x, double y);
|
98
|
+
Transform rotate(double angle, double aroundX = 0, double aroundY = 0);
|
99
|
+
Transform scale(double factor);
|
100
|
+
Transform scale(double factorX, double factorY, double fromX = 0, double fromY = 0);
|
101
|
+
Transform concat(const Transform& lhs, const Transform& rhs);
|
102
|
+
|
103
|
+
#ifndef SWIG
|
104
|
+
// A not so useful optimization - this was supposed to bypass the Z queue for immediate rendering.
|
105
|
+
// In retrospect, the only useful optimization would be to work down the Z queue on a second thread.
|
83
106
|
GOSU_DEPRECATED const double zImmediate = -std::numeric_limits<double>::infinity();
|
84
|
-
|
107
|
+
#endif
|
85
108
|
}
|
86
109
|
|
87
110
|
#endif
|
data/Gosu/Input.hpp
CHANGED
@@ -76,33 +76,22 @@ namespace Gosu
|
|
76
76
|
{
|
77
77
|
struct Impl;
|
78
78
|
const GOSU_UNIQUE_PTR<Impl> pimpl;
|
79
|
-
#if defined(GOSU_CPP11_ENABLED)
|
79
|
+
#if defined(GOSU_CPP11_ENABLED)
|
80
80
|
// explicitly forbid copying and moving
|
81
81
|
Input(Input&&) = delete;
|
82
82
|
Input& operator=(Input&&) = delete;
|
83
83
|
Input(const Input&) = delete;
|
84
84
|
Input& operator=(const Input&) = delete;
|
85
|
-
#endif
|
85
|
+
#endif
|
86
86
|
|
87
87
|
public:
|
88
|
-
|
89
|
-
Input(HWND window);
|
90
|
-
#endif
|
91
|
-
|
92
|
-
#ifdef GOSU_IS_MAC
|
93
|
-
#ifdef GOSU_IS_IPHONE
|
88
|
+
#ifdef GOSU_IS_IPHONE
|
94
89
|
Input(void* view, float updateInterval);
|
95
90
|
void feedTouchEvent(int type, void* touches);
|
96
|
-
|
97
|
-
Input(
|
98
|
-
bool
|
99
|
-
|
100
|
-
#endif
|
101
|
-
|
102
|
-
#ifdef GOSU_IS_X
|
103
|
-
Input(::Display* display, ::Window window);
|
104
|
-
bool feedXEvent(::XEvent& event);
|
105
|
-
#endif
|
91
|
+
#else
|
92
|
+
Input();
|
93
|
+
bool feedSDLEvent(void* event);
|
94
|
+
#endif
|
106
95
|
|
107
96
|
~Input();
|
108
97
|
|
@@ -128,7 +117,7 @@ namespace Gosu
|
|
128
117
|
void setMousePosition(double x, double y);
|
129
118
|
|
130
119
|
// Undocumented for the moment. Also applies to currentTouches().
|
131
|
-
void setMouseFactors(double factorX, double factorY);
|
120
|
+
void setMouseFactors(double factorX, double factorY, double offsetX = 0, double offsetY = 0);
|
132
121
|
|
133
122
|
//! Currently known touches.
|
134
123
|
const Touches& currentTouches() const;
|
data/Gosu/Platform.hpp
CHANGED
@@ -62,8 +62,12 @@ namespace Gosu
|
|
62
62
|
# endif
|
63
63
|
#endif
|
64
64
|
|
65
|
+
#if defined (GOSU_IS_IPHONE) || defined(__arm__)
|
66
|
+
# define GOSU_IS_OPENGLES
|
67
|
+
#endif
|
68
|
+
|
65
69
|
#ifndef SWIG
|
66
|
-
# if
|
70
|
+
# if _MSC_VER >= 1700 || ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__GXX_EXPERIMENTAL_CXX0X__))
|
67
71
|
# define GOSU_CPP11_ENABLED
|
68
72
|
# endif
|
69
73
|
#endif
|
data/Gosu/TextInput.hpp
CHANGED
@@ -24,12 +24,12 @@ namespace Gosu
|
|
24
24
|
{
|
25
25
|
struct Impl;
|
26
26
|
const GOSU_UNIQUE_PTR<Impl> pimpl;
|
27
|
-
#if defined(GOSU_CPP11_ENABLED)
|
27
|
+
#if defined(GOSU_CPP11_ENABLED)
|
28
28
|
TextInput(TextInput&&) = delete;
|
29
29
|
TextInput& operator=(TextInput&&) = delete;
|
30
30
|
TextInput(const TextInput&) = delete;
|
31
31
|
TextInput& operator=(const TextInput&) = delete;
|
32
|
-
#endif
|
32
|
+
#endif
|
33
33
|
|
34
34
|
public:
|
35
35
|
TextInput();
|
@@ -55,20 +55,14 @@ namespace Gosu
|
|
55
55
|
void setSelectionStart(unsigned pos);
|
56
56
|
|
57
57
|
// Platform-specific communication with Gosu::Input.
|
58
|
-
|
59
|
-
bool feedNSEvent(void* event);
|
60
|
-
#elif defined(GOSU_IS_WIN)
|
61
|
-
bool feedMessage(unsigned long message, unsigned long wparam, unsigned long lparam);
|
62
|
-
#elif defined(GOSU_IS_X)
|
63
|
-
bool feedXEvent(void* display, void* event);
|
64
|
-
#endif
|
58
|
+
bool feedSDLEvent(void* event);
|
65
59
|
|
66
60
|
//! Overridable filter that is applied to all new text that is entered.
|
67
61
|
//! Allows for context-sensitive filtering/extending/... of the text.
|
68
62
|
//! The text will be inserted at caretPos afterwards.
|
69
|
-
virtual std::wstring filter(const std::wstring&
|
63
|
+
virtual std::wstring filter(const std::wstring& text) const
|
70
64
|
{
|
71
|
-
return
|
65
|
+
return text;
|
72
66
|
}
|
73
67
|
};
|
74
68
|
}
|
data/Gosu/Version.hpp
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
#define GOSU_VERSION_HPP
|
3
3
|
|
4
4
|
#define GOSU_MAJOR_VERSION 0
|
5
|
-
#define GOSU_MINOR_VERSION
|
6
|
-
#define GOSU_POINT_VERSION
|
7
|
-
#define GOSU_VERSION "0.
|
5
|
+
#define GOSU_MINOR_VERSION 8
|
6
|
+
#define GOSU_POINT_VERSION 0
|
7
|
+
#define GOSU_VERSION "0.8.0.pre1"
|
8
8
|
|
9
9
|
#define GOSU_COPYRIGHT_NOTICE \
|
10
10
|
" " \
|
@@ -16,6 +16,8 @@
|
|
16
16
|
#include <OpenGLES/ES1/glext.h>
|
17
17
|
#elif defined(GOSU_IS_MAC)
|
18
18
|
#include <OpenGL/gl.h>
|
19
|
+
#elif defined GOSU_IS_OPENGLES
|
20
|
+
#include <GLES/gl.h>
|
19
21
|
#else
|
20
22
|
#include <GL/gl.h>
|
21
23
|
#endif
|
@@ -85,17 +87,6 @@ namespace Gosu
|
|
85
87
|
}
|
86
88
|
}
|
87
89
|
|
88
|
-
inline Transform multiply(const Transform& left, const Transform& right)
|
89
|
-
{
|
90
|
-
Gosu::Transform result;
|
91
|
-
for (int i = 0; i < 16; ++i) {
|
92
|
-
result[i] = 0;
|
93
|
-
for (int j = 0; j < 4; ++j)
|
94
|
-
result[i] += left[i / 4 * 4 + j] * right[i % 4 + j * 4];
|
95
|
-
}
|
96
|
-
return result;
|
97
|
-
}
|
98
|
-
|
99
90
|
template<typename Float>
|
100
91
|
void applyTransform(const Transform& transform, Float& x, Float& y)
|
101
92
|
{
|