gosu 1.0.0 → 1.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/include/Gosu/Version.hpp +1 -1
- data/include/Gosu/Window.hpp +23 -9
- data/lib/gosu/swig_patches.rb +3 -6
- data/rdoc/gosu.rb +14 -1
- data/src/Resolution.cpp +8 -8
- data/src/RubyGosu.cxx +224 -117
- data/src/RubyGosu.h +0 -1
- data/src/TrueTypeFontWin.cpp +3 -3
- data/src/Window.cpp +61 -24
- data/src/WindowUIKit.cpp +21 -9
- metadata +4 -24
- data/include/Gosu/Channel.h +0 -25
- data/include/Gosu/Color.h +0 -38
- data/include/Gosu/Font.h +0 -36
- data/include/Gosu/Gosu.h +0 -82
- data/include/Gosu/Image.h +0 -54
- data/include/Gosu/Sample.h +0 -19
- data/include/Gosu/Song.h +0 -24
- data/include/Gosu/TextInput.h +0 -30
- data/include/Gosu/Window.h +0 -63
- data/src/ChannelWrapper.cpp +0 -50
- data/src/ColorWrapper.cpp +0 -126
- data/src/Constants.cpp +0 -338
- data/src/FontWrapper.cpp +0 -74
- data/src/GosuWrapper.cpp +0 -251
- data/src/ImageWrapper.cpp +0 -168
- data/src/MPEGFile.hpp +0 -90
- data/src/SampleWrapper.cpp +0 -30
- data/src/SongWrapper.cpp +0 -52
- data/src/TextInputWrapper.cpp +0 -101
- data/src/WindowWrapper.cpp +0 -317
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c79a5d22ee53e69f48bcd2c1ffb20bf35672ee30d6f08890a9c3037a39fe24
|
4
|
+
data.tar.gz: 6a5e06a31f1a7ad257be143a37a1163b324e7124cb56a97154c9eba9fb0686d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db1b37245a24e569bbc623ec025a3e2d13fd61c7a011272e30cca9d4cf6970a2326ec159ee839236fc246ed177702c3de6942e46ba9297c50e51078f61cb564
|
7
|
+
data.tar.gz: 0a75ca1ddf6de40050638cc33e8c41acdd68808b1c3942aaecff2219aaf44e8148398bdd27991d5f5d4e1757b8fec651f59c7b9bba82b140dffdcda7df5ab632
|
data/include/Gosu/Version.hpp
CHANGED
data/include/Gosu/Window.hpp
CHANGED
@@ -8,6 +8,14 @@
|
|
8
8
|
|
9
9
|
namespace Gosu
|
10
10
|
{
|
11
|
+
enum WindowFlags
|
12
|
+
{
|
13
|
+
WF_WINDOWED,
|
14
|
+
WF_FULLSCREEN = 1,
|
15
|
+
WF_RESIZABLE = 2,
|
16
|
+
WF_BORDERLESS = 4
|
17
|
+
};
|
18
|
+
|
11
19
|
//! Convenient all-in-one class that serves as the foundation of a standard Gosu application.
|
12
20
|
//! Manages initialization of all of Gosu's core components and provides timing functionality.
|
13
21
|
//! Note that you should really only use one instance of this class at the same time.
|
@@ -21,17 +29,23 @@ namespace Gosu
|
|
21
29
|
//! \param width Width of the window in points; that is, pixels on a normal display, and
|
22
30
|
//! 'points' on a high-resolution display.
|
23
31
|
//! \param height See width.
|
32
|
+
//! \param window_flags A bitmask of values from Gosu::WindowFlags.
|
24
33
|
//! \param update_interval Interval in milliseconds between two calls to the update member
|
25
34
|
//! function.
|
26
|
-
Window(
|
27
|
-
|
35
|
+
Window(int width, int height, unsigned window_flags = WF_WINDOWED,
|
36
|
+
double update_interval = 16.666666);
|
28
37
|
virtual ~Window();
|
29
38
|
|
30
|
-
|
31
|
-
|
39
|
+
int width() const;
|
40
|
+
int height() const;
|
32
41
|
bool fullscreen() const;
|
42
|
+
void resize(int width, int height, bool fullscreen);
|
43
|
+
|
33
44
|
bool resizable() const;
|
34
|
-
void
|
45
|
+
void set_resizable(bool resizable);
|
46
|
+
|
47
|
+
bool borderless() const;
|
48
|
+
void set_borderless(bool borderless);
|
35
49
|
|
36
50
|
double update_interval() const;
|
37
51
|
void set_update_interval(double update_interval);
|
@@ -129,22 +143,22 @@ namespace Gosu
|
|
129
143
|
//! Returns the width (in pixels) of a screen.
|
130
144
|
//! \param window The result describes the screen on which the window is shown, or the
|
131
145
|
//! primary screen if no window is given.
|
132
|
-
|
146
|
+
int screen_width(Window* window = nullptr);
|
133
147
|
|
134
148
|
//! Returns the height (in pixels) of the user's primary screen.
|
135
149
|
//! \param window The result describes the screen on which the window is shown, or the
|
136
150
|
//! primary screen if no window is given.
|
137
|
-
|
151
|
+
int screen_height(Window* window = nullptr);
|
138
152
|
|
139
153
|
//! Returns the maximum width (in 'points') that is available for a non-fullscreen Window.
|
140
154
|
//! All windows larger than this size will automatically be shrunk to fit.
|
141
155
|
//! \param window The result describes the screen on which the window is shown, or the
|
142
156
|
//! primary screen if no window is given.
|
143
|
-
|
157
|
+
int available_width(Window* window = nullptr);
|
144
158
|
|
145
159
|
//! Returns the maximum height (in 'points') that is available for a non-fullscreen Window.
|
146
160
|
//! All windows larger than this size will automatically be shrunk to fit.
|
147
161
|
//! \param window The result describes the screen on which the window is shown, or the
|
148
162
|
//! primary screen if no window is given.
|
149
|
-
|
163
|
+
int available_height(Window* window = nullptr);
|
150
164
|
}
|
data/lib/gosu/swig_patches.rb
CHANGED
@@ -3,19 +3,16 @@
|
|
3
3
|
# compatible, but I just call protected_update etc. in the Ruby wrapper so I can add this
|
4
4
|
# custom debugging help:
|
5
5
|
class Gosu::Window
|
6
|
-
alias_method :
|
6
|
+
alias_method :initialize_with_options_hash, :initialize
|
7
7
|
|
8
8
|
def initialize width, height, *args
|
9
9
|
if args.empty? or args.first.is_a? Hash
|
10
10
|
options = args.first || {}
|
11
|
-
fullscreen = options[:fullscreen]
|
12
|
-
update_interval = options[:update_interval]
|
13
|
-
resizable = options[:resizable]
|
14
11
|
else
|
15
|
-
fullscreen, update_interval
|
12
|
+
options = { fullscreen: args[0], update_interval: args[1] }
|
16
13
|
end
|
17
14
|
$gosu_gl_blocks = nil
|
18
|
-
|
15
|
+
initialize_with_options_hash width, height, options
|
19
16
|
end
|
20
17
|
|
21
18
|
%w(update draw needs_redraw? needs_cursor?
|
data/rdoc/gosu.rb
CHANGED
@@ -811,6 +811,18 @@ module Gosu
|
|
811
811
|
# @return [true, false] whether this window is resizable.
|
812
812
|
def resizable?; end
|
813
813
|
|
814
|
+
##
|
815
|
+
# Toggles between resizable and fixed modes.
|
816
|
+
attr_writer :resizable
|
817
|
+
|
818
|
+
##
|
819
|
+
# @return [true, false] whether this window is borderless.
|
820
|
+
def borderless?; end
|
821
|
+
|
822
|
+
##
|
823
|
+
# Toggles between borderless mode and having window chrome.
|
824
|
+
attr_writer :borderless
|
825
|
+
|
814
826
|
##
|
815
827
|
# @return [Float] the interval between calls to {#update}, in milliseconds.
|
816
828
|
attr_accessor :update_interval
|
@@ -828,7 +840,8 @@ module Gosu
|
|
828
840
|
# @param height [Integer] the desired window height.
|
829
841
|
# @param [Hash] options
|
830
842
|
# @option options [true, false] :fullscreen (false) whether to present the window in fullscreen mode.
|
831
|
-
# @option options [true, false] :resizable (false) whether the window can be resized by the user.
|
843
|
+
# @option options [true, false] :resizable (false) whether the window can be resized by the user. Not useful if the window is either fullscreen or borderless.
|
844
|
+
# @option options [true, false] :borderless (false) whether the window should hide all its window chrome. Does not affect fullscreen windows.
|
832
845
|
# @option options [Float] :update_interval (16.666666) the interval between frames, in milliseconds.
|
833
846
|
def initialize(width, height, options); end
|
834
847
|
|
data/src/Resolution.cpp
CHANGED
@@ -18,12 +18,12 @@ static SDL_DisplayMode display_mode(Gosu::Window* window)
|
|
18
18
|
return result;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
21
|
+
int Gosu::screen_width(Window* window)
|
22
22
|
{
|
23
23
|
return display_mode(window).w;
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
int Gosu::screen_height(Window* window)
|
27
27
|
{
|
28
28
|
return display_mode(window).h;
|
29
29
|
}
|
@@ -41,12 +41,12 @@ static NSSize max_window_size(Gosu::Window* window)
|
|
41
41
|
return [NSWindow contentRectForFrameRect:screen_frame styleMask:style].size;
|
42
42
|
}
|
43
43
|
|
44
|
-
|
44
|
+
int Gosu::available_width(Window* window)
|
45
45
|
{
|
46
46
|
return max_window_size(window).width;
|
47
47
|
}
|
48
48
|
|
49
|
-
|
49
|
+
int Gosu::available_height(Window* window)
|
50
50
|
{
|
51
51
|
return max_window_size(window).height;
|
52
52
|
}
|
@@ -90,12 +90,12 @@ static SIZE max_window_size(Gosu::Window* window)
|
|
90
90
|
return size;
|
91
91
|
}
|
92
92
|
|
93
|
-
|
93
|
+
int Gosu::available_width(Window* window)
|
94
94
|
{
|
95
95
|
return max_window_size(window).cx;
|
96
96
|
}
|
97
97
|
|
98
|
-
|
98
|
+
int Gosu::available_height(Window* window)
|
99
99
|
{
|
100
100
|
return max_window_size(window).cy;
|
101
101
|
}
|
@@ -104,12 +104,12 @@ unsigned Gosu::available_height(Window* window)
|
|
104
104
|
#ifdef GOSU_IS_X
|
105
105
|
// Pessimistic fallback implementation for available_width / available_height.
|
106
106
|
// TODO: Look at this NET_WORKAREA based implementation: https://github.com/glfw/glfw/pull/989/files
|
107
|
-
|
107
|
+
int Gosu::available_width(Window* window)
|
108
108
|
{
|
109
109
|
return static_cast<unsigned>(Gosu::screen_width(window) * 0.9);
|
110
110
|
}
|
111
111
|
|
112
|
-
|
112
|
+
int Gosu::available_height(Window* window)
|
113
113
|
{
|
114
114
|
return static_cast<unsigned>(Gosu::screen_height(window) * 0.8);
|
115
115
|
}
|
data/src/RubyGosu.cxx
CHANGED
@@ -3218,6 +3218,45 @@ SWIGINTERN void Gosu_TextInput_set_selection_start(Gosu::TextInput *self,VALUE s
|
|
3218
3218
|
std::string prefix = StringValueCStr(rb_prefix);
|
3219
3219
|
self->set_selection_start(std::min(prefix.length(), self->text().length()));
|
3220
3220
|
}
|
3221
|
+
SWIGINTERN Gosu::Window *new_Gosu_Window(VALUE self,int width,int height,VALUE options=0){
|
3222
|
+
unsigned flags = 0;
|
3223
|
+
double update_interval = 16.666666;
|
3224
|
+
|
3225
|
+
if (options) {
|
3226
|
+
Check_Type(options, T_HASH);
|
3227
|
+
|
3228
|
+
VALUE keys = rb_funcall(options, rb_intern("keys"), 0, NULL);
|
3229
|
+
int keys_size = NUM2INT(rb_funcall(keys, rb_intern("size"), 0, NULL));
|
3230
|
+
|
3231
|
+
for (int i = 0; i < keys_size; ++i) {
|
3232
|
+
VALUE key = rb_ary_entry(keys, i);
|
3233
|
+
const char* key_string = Gosu::cstr_from_symbol(key);
|
3234
|
+
|
3235
|
+
VALUE value = rb_hash_aref(options, key);
|
3236
|
+
if (!strcmp(key_string, "fullscreen")) {
|
3237
|
+
if (RTEST(value)) flags |= Gosu::WF_FULLSCREEN;
|
3238
|
+
}
|
3239
|
+
else if (!strcmp(key_string, "resizable")) {
|
3240
|
+
if (RTEST(value)) flags |= Gosu::WF_RESIZABLE;
|
3241
|
+
}
|
3242
|
+
else if (!strcmp(key_string, "borderless")) {
|
3243
|
+
if (RTEST(value)) flags |= Gosu::WF_BORDERLESS;
|
3244
|
+
}
|
3245
|
+
else if (!strcmp(key_string, "update_interval")) {
|
3246
|
+
update_interval = NUM2DBL(value);
|
3247
|
+
}
|
3248
|
+
else {
|
3249
|
+
static bool issued_warning = false;
|
3250
|
+
if (!issued_warning) {
|
3251
|
+
issued_warning = true;
|
3252
|
+
rb_warn("Unknown keyword argument: :%s", key_string);
|
3253
|
+
}
|
3254
|
+
}
|
3255
|
+
}
|
3256
|
+
}
|
3257
|
+
|
3258
|
+
return new Gosu::Window(width, height, flags, update_interval);
|
3259
|
+
}
|
3221
3260
|
SWIGINTERN void Gosu_Window_set_width(Gosu::Window *self,unsigned int width){
|
3222
3261
|
self->resize(width, self->height(), self->fullscreen());
|
3223
3262
|
}
|
@@ -3300,12 +3339,6 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
|
|
3300
3339
|
}
|
3301
3340
|
|
3302
3341
|
|
3303
|
-
SwigDirector_Window::SwigDirector_Window(VALUE self,unsigned int width,unsigned int height,bool fullscreen,double update_interval,bool resizable): Gosu::Window(width, height, fullscreen, update_interval, resizable), Swig::Director(self) {
|
3304
|
-
|
3305
|
-
}
|
3306
|
-
|
3307
|
-
|
3308
|
-
|
3309
3342
|
SwigDirector_Window::~SwigDirector_Window() {
|
3310
3343
|
}
|
3311
3344
|
|
@@ -9180,112 +9213,50 @@ fail:
|
|
9180
9213
|
|
9181
9214
|
static swig_class SwigClassWindow;
|
9182
9215
|
|
9183
|
-
SWIGINTERN
|
9184
|
-
|
9185
|
-
|
9186
|
-
|
9187
|
-
|
9188
|
-
#endif
|
9189
|
-
{
|
9190
|
-
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Window);
|
9191
|
-
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
9192
|
-
rb_obj_call_init(vresult, argc, argv);
|
9193
|
-
#endif
|
9194
|
-
return vresult;
|
9216
|
+
SWIGINTERN void
|
9217
|
+
free_Gosu_Window(void *self) {
|
9218
|
+
Gosu::Window *arg1 = (Gosu::Window *)self;
|
9219
|
+
SWIG_RubyRemoveTracking(arg1);
|
9220
|
+
delete arg1;
|
9195
9221
|
}
|
9196
9222
|
|
9197
|
-
|
9198
9223
|
SWIGINTERN VALUE
|
9199
|
-
|
9200
|
-
|
9201
|
-
|
9202
|
-
|
9203
|
-
|
9204
|
-
|
9205
|
-
bool arg6 = (bool) false ;
|
9206
|
-
unsigned int val2 ;
|
9207
|
-
int ecode2 = 0 ;
|
9208
|
-
unsigned int val3 ;
|
9209
|
-
int ecode3 = 0 ;
|
9210
|
-
bool val4 ;
|
9211
|
-
int ecode4 = 0 ;
|
9212
|
-
double val5 ;
|
9213
|
-
int ecode5 = 0 ;
|
9214
|
-
bool val6 ;
|
9215
|
-
int ecode6 = 0 ;
|
9216
|
-
const char *classname SWIGUNUSED = "Gosu::Window";
|
9217
|
-
Gosu::Window *result = 0 ;
|
9224
|
+
_wrap_Window_width(int argc, VALUE *argv, VALUE self) {
|
9225
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9226
|
+
void *argp1 = 0 ;
|
9227
|
+
int res1 = 0 ;
|
9228
|
+
int result;
|
9229
|
+
VALUE vresult = Qnil;
|
9218
9230
|
|
9219
|
-
if ((argc <
|
9220
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for
|
9221
|
-
}
|
9222
|
-
arg1 = self;
|
9223
|
-
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
9224
|
-
if (!SWIG_IsOK(ecode2)) {
|
9225
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Window", 2, argv[0] ));
|
9226
|
-
}
|
9227
|
-
arg2 = static_cast< unsigned int >(val2);
|
9228
|
-
ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
|
9229
|
-
if (!SWIG_IsOK(ecode3)) {
|
9230
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","Window", 3, argv[1] ));
|
9231
|
-
}
|
9232
|
-
arg3 = static_cast< unsigned int >(val3);
|
9233
|
-
if (argc > 2) {
|
9234
|
-
ecode4 = SWIG_AsVal_bool(argv[2], &val4);
|
9235
|
-
if (!SWIG_IsOK(ecode4)) {
|
9236
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","Window", 4, argv[2] ));
|
9237
|
-
}
|
9238
|
-
arg4 = static_cast< bool >(val4);
|
9239
|
-
}
|
9240
|
-
if (argc > 3) {
|
9241
|
-
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
9242
|
-
if (!SWIG_IsOK(ecode5)) {
|
9243
|
-
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","Window", 5, argv[3] ));
|
9244
|
-
}
|
9245
|
-
arg5 = static_cast< double >(val5);
|
9231
|
+
if ((argc < 0) || (argc > 0)) {
|
9232
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
9246
9233
|
}
|
9247
|
-
|
9248
|
-
|
9249
|
-
|
9250
|
-
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "bool","Window", 6, argv[4] ));
|
9251
|
-
}
|
9252
|
-
arg6 = static_cast< bool >(val6);
|
9234
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9235
|
+
if (!SWIG_IsOK(res1)) {
|
9236
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","width", 1, self ));
|
9253
9237
|
}
|
9238
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9254
9239
|
{
|
9255
9240
|
try {
|
9256
|
-
|
9257
|
-
/* subclassed */
|
9258
|
-
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5,arg6);
|
9259
|
-
} else {
|
9260
|
-
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5,arg6);
|
9261
|
-
}
|
9262
|
-
|
9263
|
-
DATA_PTR(self) = result;
|
9264
|
-
SWIG_RubyAddTracking(result, self);
|
9241
|
+
result = (int)((Gosu::Window const *)arg1)->width();
|
9265
9242
|
}
|
9266
9243
|
catch (const std::exception& e) {
|
9267
9244
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
9268
9245
|
}
|
9269
9246
|
}
|
9270
|
-
|
9247
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
9248
|
+
return vresult;
|
9271
9249
|
fail:
|
9272
9250
|
return Qnil;
|
9273
9251
|
}
|
9274
9252
|
|
9275
9253
|
|
9276
|
-
SWIGINTERN void
|
9277
|
-
free_Gosu_Window(void *self) {
|
9278
|
-
Gosu::Window *arg1 = (Gosu::Window *)self;
|
9279
|
-
SWIG_RubyRemoveTracking(arg1);
|
9280
|
-
delete arg1;
|
9281
|
-
}
|
9282
|
-
|
9283
9254
|
SWIGINTERN VALUE
|
9284
|
-
|
9255
|
+
_wrap_Window_height(int argc, VALUE *argv, VALUE self) {
|
9285
9256
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9286
9257
|
void *argp1 = 0 ;
|
9287
9258
|
int res1 = 0 ;
|
9288
|
-
|
9259
|
+
int result;
|
9289
9260
|
VALUE vresult = Qnil;
|
9290
9261
|
|
9291
9262
|
if ((argc < 0) || (argc > 0)) {
|
@@ -9293,18 +9264,18 @@ _wrap_Window_width(int argc, VALUE *argv, VALUE self) {
|
|
9293
9264
|
}
|
9294
9265
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9295
9266
|
if (!SWIG_IsOK(res1)) {
|
9296
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","
|
9267
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","height", 1, self ));
|
9297
9268
|
}
|
9298
9269
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9299
9270
|
{
|
9300
9271
|
try {
|
9301
|
-
result = (
|
9272
|
+
result = (int)((Gosu::Window const *)arg1)->height();
|
9302
9273
|
}
|
9303
9274
|
catch (const std::exception& e) {
|
9304
9275
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
9305
9276
|
}
|
9306
9277
|
}
|
9307
|
-
vresult =
|
9278
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
9308
9279
|
return vresult;
|
9309
9280
|
fail:
|
9310
9281
|
return Qnil;
|
@@ -9312,11 +9283,11 @@ fail:
|
|
9312
9283
|
|
9313
9284
|
|
9314
9285
|
SWIGINTERN VALUE
|
9315
|
-
|
9286
|
+
_wrap_Window_fullscreenq___(int argc, VALUE *argv, VALUE self) {
|
9316
9287
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9317
9288
|
void *argp1 = 0 ;
|
9318
9289
|
int res1 = 0 ;
|
9319
|
-
|
9290
|
+
bool result;
|
9320
9291
|
VALUE vresult = Qnil;
|
9321
9292
|
|
9322
9293
|
if ((argc < 0) || (argc > 0)) {
|
@@ -9324,18 +9295,18 @@ _wrap_Window_height(int argc, VALUE *argv, VALUE self) {
|
|
9324
9295
|
}
|
9325
9296
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9326
9297
|
if (!SWIG_IsOK(res1)) {
|
9327
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","
|
9298
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","fullscreen", 1, self ));
|
9328
9299
|
}
|
9329
9300
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9330
9301
|
{
|
9331
9302
|
try {
|
9332
|
-
result = (
|
9303
|
+
result = (bool)((Gosu::Window const *)arg1)->fullscreen();
|
9333
9304
|
}
|
9334
9305
|
catch (const std::exception& e) {
|
9335
9306
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
9336
9307
|
}
|
9337
9308
|
}
|
9338
|
-
vresult =
|
9309
|
+
vresult = SWIG_From_bool(static_cast< bool >(result));
|
9339
9310
|
return vresult;
|
9340
9311
|
fail:
|
9341
9312
|
return Qnil;
|
@@ -9343,7 +9314,7 @@ fail:
|
|
9343
9314
|
|
9344
9315
|
|
9345
9316
|
SWIGINTERN VALUE
|
9346
|
-
|
9317
|
+
_wrap_Window_resizableq___(int argc, VALUE *argv, VALUE self) {
|
9347
9318
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9348
9319
|
void *argp1 = 0 ;
|
9349
9320
|
int res1 = 0 ;
|
@@ -9355,12 +9326,12 @@ _wrap_Window_fullscreenq___(int argc, VALUE *argv, VALUE self) {
|
|
9355
9326
|
}
|
9356
9327
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9357
9328
|
if (!SWIG_IsOK(res1)) {
|
9358
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","
|
9329
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","resizable", 1, self ));
|
9359
9330
|
}
|
9360
9331
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9361
9332
|
{
|
9362
9333
|
try {
|
9363
|
-
result = (bool)((Gosu::Window const *)arg1)->
|
9334
|
+
result = (bool)((Gosu::Window const *)arg1)->resizable();
|
9364
9335
|
}
|
9365
9336
|
catch (const std::exception& e) {
|
9366
9337
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
@@ -9374,7 +9345,43 @@ fail:
|
|
9374
9345
|
|
9375
9346
|
|
9376
9347
|
SWIGINTERN VALUE
|
9377
|
-
|
9348
|
+
_wrap_Window_resizablee___(int argc, VALUE *argv, VALUE self) {
|
9349
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9350
|
+
bool arg2 ;
|
9351
|
+
void *argp1 = 0 ;
|
9352
|
+
int res1 = 0 ;
|
9353
|
+
bool val2 ;
|
9354
|
+
int ecode2 = 0 ;
|
9355
|
+
|
9356
|
+
if ((argc < 1) || (argc > 1)) {
|
9357
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
9358
|
+
}
|
9359
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9360
|
+
if (!SWIG_IsOK(res1)) {
|
9361
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_resizable", 1, self ));
|
9362
|
+
}
|
9363
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9364
|
+
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
|
9365
|
+
if (!SWIG_IsOK(ecode2)) {
|
9366
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_resizable", 2, argv[0] ));
|
9367
|
+
}
|
9368
|
+
arg2 = static_cast< bool >(val2);
|
9369
|
+
{
|
9370
|
+
try {
|
9371
|
+
(arg1)->set_resizable(arg2);
|
9372
|
+
}
|
9373
|
+
catch (const std::exception& e) {
|
9374
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9375
|
+
}
|
9376
|
+
}
|
9377
|
+
return Qnil;
|
9378
|
+
fail:
|
9379
|
+
return Qnil;
|
9380
|
+
}
|
9381
|
+
|
9382
|
+
|
9383
|
+
SWIGINTERN VALUE
|
9384
|
+
_wrap_Window_borderlessq___(int argc, VALUE *argv, VALUE self) {
|
9378
9385
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9379
9386
|
void *argp1 = 0 ;
|
9380
9387
|
int res1 = 0 ;
|
@@ -9386,12 +9393,12 @@ _wrap_Window_resizableq___(int argc, VALUE *argv, VALUE self) {
|
|
9386
9393
|
}
|
9387
9394
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9388
9395
|
if (!SWIG_IsOK(res1)) {
|
9389
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","
|
9396
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","borderless", 1, self ));
|
9390
9397
|
}
|
9391
9398
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9392
9399
|
{
|
9393
9400
|
try {
|
9394
|
-
result = (bool)((Gosu::Window const *)arg1)->
|
9401
|
+
result = (bool)((Gosu::Window const *)arg1)->borderless();
|
9395
9402
|
}
|
9396
9403
|
catch (const std::exception& e) {
|
9397
9404
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
@@ -9404,6 +9411,42 @@ fail:
|
|
9404
9411
|
}
|
9405
9412
|
|
9406
9413
|
|
9414
|
+
SWIGINTERN VALUE
|
9415
|
+
_wrap_Window_borderlesse___(int argc, VALUE *argv, VALUE self) {
|
9416
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9417
|
+
bool arg2 ;
|
9418
|
+
void *argp1 = 0 ;
|
9419
|
+
int res1 = 0 ;
|
9420
|
+
bool val2 ;
|
9421
|
+
int ecode2 = 0 ;
|
9422
|
+
|
9423
|
+
if ((argc < 1) || (argc > 1)) {
|
9424
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
9425
|
+
}
|
9426
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9427
|
+
if (!SWIG_IsOK(res1)) {
|
9428
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_borderless", 1, self ));
|
9429
|
+
}
|
9430
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9431
|
+
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
|
9432
|
+
if (!SWIG_IsOK(ecode2)) {
|
9433
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_borderless", 2, argv[0] ));
|
9434
|
+
}
|
9435
|
+
arg2 = static_cast< bool >(val2);
|
9436
|
+
{
|
9437
|
+
try {
|
9438
|
+
(arg1)->set_borderless(arg2);
|
9439
|
+
}
|
9440
|
+
catch (const std::exception& e) {
|
9441
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9442
|
+
}
|
9443
|
+
}
|
9444
|
+
return Qnil;
|
9445
|
+
fail:
|
9446
|
+
return Qnil;
|
9447
|
+
}
|
9448
|
+
|
9449
|
+
|
9407
9450
|
SWIGINTERN VALUE
|
9408
9451
|
_wrap_Window_update_interval(int argc, VALUE *argv, VALUE self) {
|
9409
9452
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
@@ -10167,6 +10210,67 @@ fail:
|
|
10167
10210
|
}
|
10168
10211
|
|
10169
10212
|
|
10213
|
+
SWIGINTERN VALUE
|
10214
|
+
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
10215
|
+
_wrap_Window_allocate(VALUE self)
|
10216
|
+
#else
|
10217
|
+
_wrap_Window_allocate(int argc, VALUE *argv, VALUE self)
|
10218
|
+
#endif
|
10219
|
+
{
|
10220
|
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Window);
|
10221
|
+
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
10222
|
+
rb_obj_call_init(vresult, argc, argv);
|
10223
|
+
#endif
|
10224
|
+
return vresult;
|
10225
|
+
}
|
10226
|
+
|
10227
|
+
|
10228
|
+
SWIGINTERN VALUE
|
10229
|
+
_wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
10230
|
+
VALUE arg1 = (VALUE) 0 ;
|
10231
|
+
int arg2 ;
|
10232
|
+
int arg3 ;
|
10233
|
+
VALUE arg4 = (VALUE) 0 ;
|
10234
|
+
int val2 ;
|
10235
|
+
int ecode2 = 0 ;
|
10236
|
+
int val3 ;
|
10237
|
+
int ecode3 = 0 ;
|
10238
|
+
const char *classname SWIGUNUSED = "Gosu::Window";
|
10239
|
+
Gosu::Window *result = 0 ;
|
10240
|
+
|
10241
|
+
if ((argc < 2) || (argc > 3)) {
|
10242
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
10243
|
+
}
|
10244
|
+
arg1 = self;
|
10245
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
10246
|
+
if (!SWIG_IsOK(ecode2)) {
|
10247
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Window", 2, argv[0] ));
|
10248
|
+
}
|
10249
|
+
arg2 = static_cast< int >(val2);
|
10250
|
+
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
10251
|
+
if (!SWIG_IsOK(ecode3)) {
|
10252
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Window", 3, argv[1] ));
|
10253
|
+
}
|
10254
|
+
arg3 = static_cast< int >(val3);
|
10255
|
+
if (argc > 2) {
|
10256
|
+
arg4 = argv[2];
|
10257
|
+
}
|
10258
|
+
{
|
10259
|
+
try {
|
10260
|
+
result = (Gosu::Window *)new_Gosu_Window(arg1,arg2,arg3,arg4);
|
10261
|
+
DATA_PTR(self) = result;
|
10262
|
+
SWIG_RubyAddTracking(result, self);
|
10263
|
+
}
|
10264
|
+
catch (const std::exception& e) {
|
10265
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
10266
|
+
}
|
10267
|
+
}
|
10268
|
+
return self;
|
10269
|
+
fail:
|
10270
|
+
return Qnil;
|
10271
|
+
}
|
10272
|
+
|
10273
|
+
|
10170
10274
|
SWIGINTERN VALUE
|
10171
10275
|
_wrap_Window_widthe___(int argc, VALUE *argv, VALUE self) {
|
10172
10276
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
@@ -10584,7 +10688,7 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
|
|
10584
10688
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10585
10689
|
void *argp1 = 0 ;
|
10586
10690
|
int res1 = 0 ;
|
10587
|
-
|
10691
|
+
int result;
|
10588
10692
|
VALUE vresult = Qnil;
|
10589
10693
|
|
10590
10694
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10599,13 +10703,13 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
|
|
10599
10703
|
}
|
10600
10704
|
{
|
10601
10705
|
try {
|
10602
|
-
result = (
|
10706
|
+
result = (int)Gosu::screen_width(arg1);
|
10603
10707
|
}
|
10604
10708
|
catch (const std::exception& e) {
|
10605
10709
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10606
10710
|
}
|
10607
10711
|
}
|
10608
|
-
vresult =
|
10712
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10609
10713
|
return vresult;
|
10610
10714
|
fail:
|
10611
10715
|
return Qnil;
|
@@ -10617,7 +10721,7 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
|
|
10617
10721
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10618
10722
|
void *argp1 = 0 ;
|
10619
10723
|
int res1 = 0 ;
|
10620
|
-
|
10724
|
+
int result;
|
10621
10725
|
VALUE vresult = Qnil;
|
10622
10726
|
|
10623
10727
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10632,13 +10736,13 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
|
|
10632
10736
|
}
|
10633
10737
|
{
|
10634
10738
|
try {
|
10635
|
-
result = (
|
10739
|
+
result = (int)Gosu::screen_height(arg1);
|
10636
10740
|
}
|
10637
10741
|
catch (const std::exception& e) {
|
10638
10742
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10639
10743
|
}
|
10640
10744
|
}
|
10641
|
-
vresult =
|
10745
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10642
10746
|
return vresult;
|
10643
10747
|
fail:
|
10644
10748
|
return Qnil;
|
@@ -10650,7 +10754,7 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
|
|
10650
10754
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10651
10755
|
void *argp1 = 0 ;
|
10652
10756
|
int res1 = 0 ;
|
10653
|
-
|
10757
|
+
int result;
|
10654
10758
|
VALUE vresult = Qnil;
|
10655
10759
|
|
10656
10760
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10665,13 +10769,13 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
|
|
10665
10769
|
}
|
10666
10770
|
{
|
10667
10771
|
try {
|
10668
|
-
result = (
|
10772
|
+
result = (int)Gosu::available_width(arg1);
|
10669
10773
|
}
|
10670
10774
|
catch (const std::exception& e) {
|
10671
10775
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10672
10776
|
}
|
10673
10777
|
}
|
10674
|
-
vresult =
|
10778
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10675
10779
|
return vresult;
|
10676
10780
|
fail:
|
10677
10781
|
return Qnil;
|
@@ -10683,7 +10787,7 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
|
|
10683
10787
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10684
10788
|
void *argp1 = 0 ;
|
10685
10789
|
int res1 = 0 ;
|
10686
|
-
|
10790
|
+
int result;
|
10687
10791
|
VALUE vresult = Qnil;
|
10688
10792
|
|
10689
10793
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10698,13 +10802,13 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
|
|
10698
10802
|
}
|
10699
10803
|
{
|
10700
10804
|
try {
|
10701
|
-
result = (
|
10805
|
+
result = (int)Gosu::available_height(arg1);
|
10702
10806
|
}
|
10703
10807
|
catch (const std::exception& e) {
|
10704
10808
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10705
10809
|
}
|
10706
10810
|
}
|
10707
|
-
vresult =
|
10811
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10708
10812
|
return vresult;
|
10709
10813
|
fail:
|
10710
10814
|
return Qnil;
|
@@ -12425,7 +12529,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12425
12529
|
rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
|
12426
12530
|
rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
|
12427
12531
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(1)));
|
12428
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
12532
|
+
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(1)));
|
12429
12533
|
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
|
12430
12534
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
12431
12535
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
@@ -12881,6 +12985,9 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12881
12985
|
rb_define_method(SwigClassWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1);
|
12882
12986
|
rb_define_method(SwigClassWindow.klass, "fullscreen?", VALUEFUNC(_wrap_Window_fullscreenq___), -1);
|
12883
12987
|
rb_define_method(SwigClassWindow.klass, "resizable?", VALUEFUNC(_wrap_Window_resizableq___), -1);
|
12988
|
+
rb_define_method(SwigClassWindow.klass, "resizable=", VALUEFUNC(_wrap_Window_resizablee___), -1);
|
12989
|
+
rb_define_method(SwigClassWindow.klass, "borderless?", VALUEFUNC(_wrap_Window_borderlessq___), -1);
|
12990
|
+
rb_define_method(SwigClassWindow.klass, "borderless=", VALUEFUNC(_wrap_Window_borderlesse___), -1);
|
12884
12991
|
rb_define_method(SwigClassWindow.klass, "update_interval", VALUEFUNC(_wrap_Window_update_interval), -1);
|
12885
12992
|
rb_define_method(SwigClassWindow.klass, "update_interval=", VALUEFUNC(_wrap_Window_update_intervale___), -1);
|
12886
12993
|
rb_define_method(SwigClassWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1);
|