gosu 1.0.0 → 1.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/src/Resolution.cpp CHANGED
@@ -11,19 +11,19 @@ static SDL_DisplayMode display_mode(Gosu::Window* window)
11
11
  VideoSubsystem() { SDL_InitSubSystem(SDL_INIT_VIDEO); };
12
12
  ~VideoSubsystem() { SDL_QuitSubSystem(SDL_INIT_VIDEO); };
13
13
  } subsystem;
14
-
14
+
15
15
  int index = window ? SDL_GetWindowDisplayIndex(Gosu::shared_window()) : 0;
16
16
  SDL_DisplayMode result;
17
17
  SDL_GetDesktopDisplayMode(index, &result);
18
18
  return result;
19
19
  }
20
20
 
21
- unsigned Gosu::screen_width(Window* window)
21
+ int Gosu::screen_width(Window* window)
22
22
  {
23
23
  return display_mode(window).w;
24
24
  }
25
25
 
26
- unsigned Gosu::screen_height(Window* window)
26
+ int Gosu::screen_height(Window* window)
27
27
  {
28
28
  return display_mode(window).h;
29
29
  }
@@ -31,88 +31,136 @@ unsigned Gosu::screen_height(Window* window)
31
31
  #ifdef GOSU_IS_MAC
32
32
  #import <AppKit/AppKit.h>
33
33
 
34
- static NSSize max_window_size(Gosu::Window* window)
34
+ static SDL_Rect max_window_size(Gosu::Window* window)
35
35
  {
36
- // Keep in sync with SDL_cocoawindow.m.
37
- auto style = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
36
+ // The extra size that a window needs depends on its style.
37
+ // This logic must be kept in sync with SDL_cocoawindow.m to be 100% accurate.
38
+ NSUInteger style;
39
+ if (window && window->borderless()) {
40
+ style = NSWindowStyleMaskBorderless;
41
+ }
42
+ else {
43
+ style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable;
44
+ }
45
+ if (window && window->resizable()) {
46
+ style |= NSWindowStyleMaskResizable;
47
+ }
38
48
 
39
49
  auto index = window ? SDL_GetWindowDisplayIndex(Gosu::shared_window()) : 0;
40
- auto screen_frame = NSScreen.screens[index].visibleFrame;
41
- return [NSWindow contentRectForFrameRect:screen_frame styleMask:style].size;
42
- }
43
-
44
- unsigned Gosu::available_width(Window* window)
45
- {
46
- return max_window_size(window).width;
47
- }
48
-
49
- unsigned Gosu::available_height(Window* window)
50
- {
51
- return max_window_size(window).height;
50
+ NSRect screen_frame = NSScreen.screens[index].visibleFrame;
51
+ NSRect content_rect = [NSWindow contentRectForFrameRect:screen_frame styleMask:style];
52
+
53
+ SDL_Rect result;
54
+ result.x = 0;
55
+ result.y = 0;
56
+ result.w = content_rect.size.width;
57
+ result.h = content_rect.size.height;
58
+ return result;
52
59
  }
53
60
  #endif
54
61
 
62
+ // TODO: Remove this implementation and remove ifdef for GOSU_IS_X once WIN_GetWindowBordersSize is patched
55
63
  #ifdef GOSU_IS_WIN
56
64
  #include <windows.h>
57
65
  #include <SDL_syswm.h>
66
+ #include <dwmapi.h>
67
+ #pragma comment (lib, "Dwmapi.lib")
58
68
 
59
- static SIZE max_window_size(Gosu::Window* window)
69
+ static SDL_Rect max_window_size(Gosu::Window* window)
60
70
  {
61
- RECT work_area;
62
-
63
- if (window == nullptr) {
64
- // Easy case: Return the work area of the primary monitor.
65
- SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0);
66
- }
67
- else {
68
- // Return the work area of the monitor the window is on.
69
- SDL_SysWMinfo wm_info;
70
- SDL_VERSION(&wm_info.version);
71
- SDL_GetWindowWMInfo(Gosu::shared_window(), &wm_info);
72
- HMONITOR monitor = MonitorFromWindow(wm_info.info.win.window, MONITOR_DEFAULTTONEAREST);
73
-
74
- MONITORINFO monitor_info;
75
- monitor_info.cbSize = sizeof(monitor_info);
76
- GetMonitorInfo(monitor, &monitor_info);
77
- work_area = monitor_info.rcWork;
71
+ // Replicate SDL's WIN_GetWindowBordersSize implementation (https://github.com/libsdl-org/SDL/blob/9f71a809e9bd6fbb5fa401a45c1537fc26abc1b4/src/video/windows/SDL_windowswindow.c#L514-L554)
72
+ // until it's patched to ignore the window drop shadow (window border is 1px but with drop shadow it's reported as 8px)
73
+ // REF: https://github.com/libsdl-org/SDL/issues/3835
74
+
75
+ static struct VideoSubsystem {
76
+ VideoSubsystem() { SDL_InitSubSystem(SDL_INIT_VIDEO); };
77
+ ~VideoSubsystem() { SDL_QuitSubSystem(SDL_INIT_VIDEO); };
78
+ } subsystem;
79
+
80
+ int index = window ? SDL_GetWindowDisplayIndex(Gosu::shared_window()) : 0;
81
+ SDL_Rect rect;
82
+ SDL_GetDisplayUsableBounds(index, &rect);
83
+
84
+ if (window) {
85
+ SDL_SysWMinfo info;
86
+ SDL_VERSION(&info.version);
87
+ SDL_GetWindowWMInfo(Gosu::shared_window(), &info);
88
+ HWND hwnd = info.info.win.window;
89
+
90
+ RECT rcClient, rcWindow;
91
+ POINT ptDiff;
92
+ int top = 0, left = 0, bottom = 0, right = 0;
93
+
94
+ /* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left
95
+ * screen position; so the top/left values of rcClient are always {0,0} and bottom/right are {height,width} */
96
+ GetClientRect(hwnd, &rcClient);
97
+ DwmGetWindowAttribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &rcWindow, sizeof(rcWindow));
98
+
99
+ /* convert the top/left values to make them relative to
100
+ * the window; they will end up being slightly negative */
101
+ ptDiff.y = rcWindow.top;
102
+ ptDiff.x = rcWindow.left;
103
+
104
+ ScreenToClient(hwnd, &ptDiff);
105
+
106
+ rcWindow.top = ptDiff.y;
107
+ rcWindow.left = ptDiff.x;
108
+
109
+ /* convert the bottom/right values to make them relative to the window,
110
+ * these will be slightly bigger than the inner width/height */
111
+ ptDiff.y = rcWindow.bottom;
112
+ ptDiff.x = rcWindow.right;
113
+
114
+ ScreenToClient(hwnd, &ptDiff);
115
+
116
+ rcWindow.bottom = ptDiff.y;
117
+ rcWindow.right = ptDiff.x;
118
+
119
+ /* Now that both the inner and outer rects use the same coordinate system we can substract them to get the border size.
120
+ * Keep in mind that the top/left coordinates of rcWindow are negative because the border lies slightly before {0,0},
121
+ * so switch them around because SDL2 wants them in positive. */
122
+ top = rcClient.top - rcWindow.top;
123
+ left = rcClient.left - rcWindow.left;
124
+ bottom = rcWindow.bottom - rcClient.bottom;
125
+ right = rcWindow.right - rcClient.right;
126
+
127
+ rect.w -= left + right;
128
+ rect.h -= top + bottom;
78
129
  }
79
-
80
- RECT window_size = work_area;
81
- // Keep in sync with STYLE_NORMAL in SDL_windowswindow.c.
82
- DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
83
- AdjustWindowRectEx(&window_size, style, FALSE, 0);
84
-
85
- // Because AdjustWindowRectEx will make our rect larger, not smaller, we need to perform some
86
- // unintuitive math here.
87
- SIZE size;
88
- size.cx = 2 * (work_area.right - work_area.left) - (window_size.right - window_size.left);
89
- size.cy = 2 * (work_area.bottom - work_area.top) - (window_size.bottom - window_size.top);
90
- return size;
91
- }
92
130
 
93
- unsigned Gosu::available_width(Window* window)
94
- {
95
- return max_window_size(window).cx;
131
+ // Return a rect to have one less Gosu::available_width/height implementation.
132
+ return rect;
96
133
  }
134
+ #endif
97
135
 
98
- unsigned Gosu::available_height(Window* window)
136
+ #ifdef GOSU_IS_X
137
+ static SDL_Rect max_window_size(Gosu::Window* window)
99
138
  {
100
- return max_window_size(window).cy;
139
+ static struct VideoSubsystem {
140
+ VideoSubsystem() { SDL_InitSubSystem(SDL_INIT_VIDEO); };
141
+ ~VideoSubsystem() { SDL_QuitSubSystem(SDL_INIT_VIDEO); };
142
+ } subsystem;
143
+
144
+ int index = window ? SDL_GetWindowDisplayIndex(Gosu::shared_window()) : 0;
145
+ SDL_Rect rect;
146
+ int top, left, bottom, right;
147
+ SDL_GetDisplayUsableBounds(index, &rect);
148
+ SDL_GetWindowBordersSize(Gosu::shared_window(), &top, &left, &bottom, &right);
149
+
150
+ rect.w -= left + right;
151
+ rect.h -= top + bottom;
152
+
153
+ return rect;
101
154
  }
102
155
  #endif
103
156
 
104
- #ifdef GOSU_IS_X
105
- // Pessimistic fallback implementation for available_width / available_height.
106
- // TODO: Look at this NET_WORKAREA based implementation: https://github.com/glfw/glfw/pull/989/files
107
- unsigned Gosu::available_width(Window* window)
157
+ int Gosu::available_width(Window* window)
108
158
  {
109
- return static_cast<unsigned>(Gosu::screen_width(window) * 0.9);
159
+ return max_window_size(window).w;
110
160
  }
111
161
 
112
- unsigned Gosu::available_height(Window* window)
162
+ int Gosu::available_height(Window* window)
113
163
  {
114
- return static_cast<unsigned>(Gosu::screen_height(window) * 0.8);
164
+ return max_window_size(window).h;
115
165
  }
116
166
  #endif
117
-
118
- #endif
data/src/RubyGosu.cxx CHANGED
@@ -3300,7 +3300,7 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
3300
3300
  }
3301
3301
 
3302
3302
 
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) {
3303
+ SwigDirector_Window::SwigDirector_Window(VALUE self,int width,int height,unsigned int window_flags,double update_interval): Gosu::Window(width, height, window_flags, update_interval), Swig::Director(self) {
3304
3304
 
3305
3305
  }
3306
3306
 
@@ -9198,44 +9198,41 @@ _wrap_Window_allocate(int argc, VALUE *argv, VALUE self)
9198
9198
  SWIGINTERN VALUE
9199
9199
  _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
9200
9200
  VALUE arg1 = (VALUE) 0 ;
9201
- unsigned int arg2 ;
9202
- unsigned int arg3 ;
9203
- bool arg4 = (bool) false ;
9201
+ int arg2 ;
9202
+ int arg3 ;
9203
+ unsigned int arg4 = (unsigned int) Gosu::WF_WINDOWED ;
9204
9204
  double arg5 = (double) 16.666666 ;
9205
- bool arg6 = (bool) false ;
9206
- unsigned int val2 ;
9205
+ int val2 ;
9207
9206
  int ecode2 = 0 ;
9208
- unsigned int val3 ;
9207
+ int val3 ;
9209
9208
  int ecode3 = 0 ;
9210
- bool val4 ;
9209
+ unsigned int val4 ;
9211
9210
  int ecode4 = 0 ;
9212
9211
  double val5 ;
9213
9212
  int ecode5 = 0 ;
9214
- bool val6 ;
9215
- int ecode6 = 0 ;
9216
9213
  const char *classname SWIGUNUSED = "Gosu::Window";
9217
9214
  Gosu::Window *result = 0 ;
9218
9215
 
9219
- if ((argc < 2) || (argc > 5)) {
9216
+ if ((argc < 2) || (argc > 4)) {
9220
9217
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
9221
9218
  }
9222
9219
  arg1 = self;
9223
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
9220
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
9224
9221
  if (!SWIG_IsOK(ecode2)) {
9225
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Window", 2, argv[0] ));
9222
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Window", 2, argv[0] ));
9226
9223
  }
9227
- arg2 = static_cast< unsigned int >(val2);
9228
- ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
9224
+ arg2 = static_cast< int >(val2);
9225
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
9229
9226
  if (!SWIG_IsOK(ecode3)) {
9230
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","Window", 3, argv[1] ));
9227
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Window", 3, argv[1] ));
9231
9228
  }
9232
- arg3 = static_cast< unsigned int >(val3);
9229
+ arg3 = static_cast< int >(val3);
9233
9230
  if (argc > 2) {
9234
- ecode4 = SWIG_AsVal_bool(argv[2], &val4);
9231
+ ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
9235
9232
  if (!SWIG_IsOK(ecode4)) {
9236
- SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","Window", 4, argv[2] ));
9233
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Window", 4, argv[2] ));
9237
9234
  }
9238
- arg4 = static_cast< bool >(val4);
9235
+ arg4 = static_cast< unsigned int >(val4);
9239
9236
  }
9240
9237
  if (argc > 3) {
9241
9238
  ecode5 = SWIG_AsVal_double(argv[3], &val5);
@@ -9244,20 +9241,13 @@ _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
9244
9241
  }
9245
9242
  arg5 = static_cast< double >(val5);
9246
9243
  }
9247
- if (argc > 4) {
9248
- ecode6 = SWIG_AsVal_bool(argv[4], &val6);
9249
- if (!SWIG_IsOK(ecode6)) {
9250
- SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "bool","Window", 6, argv[4] ));
9251
- }
9252
- arg6 = static_cast< bool >(val6);
9253
- }
9254
9244
  {
9255
9245
  try {
9256
9246
  if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
9257
9247
  /* subclassed */
9258
- result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5,arg6);
9248
+ result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5);
9259
9249
  } else {
9260
- result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5,arg6);
9250
+ result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5);
9261
9251
  }
9262
9252
 
9263
9253
  DATA_PTR(self) = result;
@@ -9285,7 +9275,7 @@ _wrap_Window_width(int argc, VALUE *argv, VALUE self) {
9285
9275
  Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9286
9276
  void *argp1 = 0 ;
9287
9277
  int res1 = 0 ;
9288
- unsigned int result;
9278
+ int result;
9289
9279
  VALUE vresult = Qnil;
9290
9280
 
9291
9281
  if ((argc < 0) || (argc > 0)) {
@@ -9298,13 +9288,13 @@ _wrap_Window_width(int argc, VALUE *argv, VALUE self) {
9298
9288
  arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9299
9289
  {
9300
9290
  try {
9301
- result = (unsigned int)((Gosu::Window const *)arg1)->width();
9291
+ result = (int)((Gosu::Window const *)arg1)->width();
9302
9292
  }
9303
9293
  catch (const std::exception& e) {
9304
9294
  SWIG_exception(SWIG_RuntimeError, e.what());
9305
9295
  }
9306
9296
  }
9307
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
9297
+ vresult = SWIG_From_int(static_cast< int >(result));
9308
9298
  return vresult;
9309
9299
  fail:
9310
9300
  return Qnil;
@@ -9316,7 +9306,7 @@ _wrap_Window_height(int argc, VALUE *argv, VALUE self) {
9316
9306
  Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9317
9307
  void *argp1 = 0 ;
9318
9308
  int res1 = 0 ;
9319
- unsigned int result;
9309
+ int result;
9320
9310
  VALUE vresult = Qnil;
9321
9311
 
9322
9312
  if ((argc < 0) || (argc > 0)) {
@@ -9329,13 +9319,13 @@ _wrap_Window_height(int argc, VALUE *argv, VALUE self) {
9329
9319
  arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9330
9320
  {
9331
9321
  try {
9332
- result = (unsigned int)((Gosu::Window const *)arg1)->height();
9322
+ result = (int)((Gosu::Window const *)arg1)->height();
9333
9323
  }
9334
9324
  catch (const std::exception& e) {
9335
9325
  SWIG_exception(SWIG_RuntimeError, e.what());
9336
9326
  }
9337
9327
  }
9338
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
9328
+ vresult = SWIG_From_int(static_cast< int >(result));
9339
9329
  return vresult;
9340
9330
  fail:
9341
9331
  return Qnil;
@@ -9404,6 +9394,109 @@ fail:
9404
9394
  }
9405
9395
 
9406
9396
 
9397
+ SWIGINTERN VALUE
9398
+ _wrap_Window_resizablee___(int argc, VALUE *argv, VALUE self) {
9399
+ Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9400
+ bool arg2 ;
9401
+ void *argp1 = 0 ;
9402
+ int res1 = 0 ;
9403
+ bool val2 ;
9404
+ int ecode2 = 0 ;
9405
+
9406
+ if ((argc < 1) || (argc > 1)) {
9407
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
9408
+ }
9409
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
9410
+ if (!SWIG_IsOK(res1)) {
9411
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_resizable", 1, self ));
9412
+ }
9413
+ arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9414
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
9415
+ if (!SWIG_IsOK(ecode2)) {
9416
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_resizable", 2, argv[0] ));
9417
+ }
9418
+ arg2 = static_cast< bool >(val2);
9419
+ {
9420
+ try {
9421
+ (arg1)->set_resizable(arg2);
9422
+ }
9423
+ catch (const std::exception& e) {
9424
+ SWIG_exception(SWIG_RuntimeError, e.what());
9425
+ }
9426
+ }
9427
+ return Qnil;
9428
+ fail:
9429
+ return Qnil;
9430
+ }
9431
+
9432
+
9433
+ SWIGINTERN VALUE
9434
+ _wrap_Window_borderlessq___(int argc, VALUE *argv, VALUE self) {
9435
+ Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9436
+ void *argp1 = 0 ;
9437
+ int res1 = 0 ;
9438
+ bool result;
9439
+ VALUE vresult = Qnil;
9440
+
9441
+ if ((argc < 0) || (argc > 0)) {
9442
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
9443
+ }
9444
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
9445
+ if (!SWIG_IsOK(res1)) {
9446
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","borderless", 1, self ));
9447
+ }
9448
+ arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9449
+ {
9450
+ try {
9451
+ result = (bool)((Gosu::Window const *)arg1)->borderless();
9452
+ }
9453
+ catch (const std::exception& e) {
9454
+ SWIG_exception(SWIG_RuntimeError, e.what());
9455
+ }
9456
+ }
9457
+ vresult = SWIG_From_bool(static_cast< bool >(result));
9458
+ return vresult;
9459
+ fail:
9460
+ return Qnil;
9461
+ }
9462
+
9463
+
9464
+ SWIGINTERN VALUE
9465
+ _wrap_Window_borderlesse___(int argc, VALUE *argv, VALUE self) {
9466
+ Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9467
+ bool arg2 ;
9468
+ void *argp1 = 0 ;
9469
+ int res1 = 0 ;
9470
+ bool val2 ;
9471
+ int ecode2 = 0 ;
9472
+
9473
+ if ((argc < 1) || (argc > 1)) {
9474
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
9475
+ }
9476
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
9477
+ if (!SWIG_IsOK(res1)) {
9478
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_borderless", 1, self ));
9479
+ }
9480
+ arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9481
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
9482
+ if (!SWIG_IsOK(ecode2)) {
9483
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_borderless", 2, argv[0] ));
9484
+ }
9485
+ arg2 = static_cast< bool >(val2);
9486
+ {
9487
+ try {
9488
+ (arg1)->set_borderless(arg2);
9489
+ }
9490
+ catch (const std::exception& e) {
9491
+ SWIG_exception(SWIG_RuntimeError, e.what());
9492
+ }
9493
+ }
9494
+ return Qnil;
9495
+ fail:
9496
+ return Qnil;
9497
+ }
9498
+
9499
+
9407
9500
  SWIGINTERN VALUE
9408
9501
  _wrap_Window_update_interval(int argc, VALUE *argv, VALUE self) {
9409
9502
  Gosu::Window *arg1 = (Gosu::Window *) 0 ;
@@ -10584,7 +10677,7 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
10584
10677
  Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
10585
10678
  void *argp1 = 0 ;
10586
10679
  int res1 = 0 ;
10587
- unsigned int result;
10680
+ int result;
10588
10681
  VALUE vresult = Qnil;
10589
10682
 
10590
10683
  if ((argc < 0) || (argc > 1)) {
@@ -10599,13 +10692,13 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
10599
10692
  }
10600
10693
  {
10601
10694
  try {
10602
- result = (unsigned int)Gosu::screen_width(arg1);
10695
+ result = (int)Gosu::screen_width(arg1);
10603
10696
  }
10604
10697
  catch (const std::exception& e) {
10605
10698
  SWIG_exception(SWIG_RuntimeError, e.what());
10606
10699
  }
10607
10700
  }
10608
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
10701
+ vresult = SWIG_From_int(static_cast< int >(result));
10609
10702
  return vresult;
10610
10703
  fail:
10611
10704
  return Qnil;
@@ -10617,7 +10710,7 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
10617
10710
  Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
10618
10711
  void *argp1 = 0 ;
10619
10712
  int res1 = 0 ;
10620
- unsigned int result;
10713
+ int result;
10621
10714
  VALUE vresult = Qnil;
10622
10715
 
10623
10716
  if ((argc < 0) || (argc > 1)) {
@@ -10632,13 +10725,13 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
10632
10725
  }
10633
10726
  {
10634
10727
  try {
10635
- result = (unsigned int)Gosu::screen_height(arg1);
10728
+ result = (int)Gosu::screen_height(arg1);
10636
10729
  }
10637
10730
  catch (const std::exception& e) {
10638
10731
  SWIG_exception(SWIG_RuntimeError, e.what());
10639
10732
  }
10640
10733
  }
10641
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
10734
+ vresult = SWIG_From_int(static_cast< int >(result));
10642
10735
  return vresult;
10643
10736
  fail:
10644
10737
  return Qnil;
@@ -10650,7 +10743,7 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
10650
10743
  Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
10651
10744
  void *argp1 = 0 ;
10652
10745
  int res1 = 0 ;
10653
- unsigned int result;
10746
+ int result;
10654
10747
  VALUE vresult = Qnil;
10655
10748
 
10656
10749
  if ((argc < 0) || (argc > 1)) {
@@ -10665,13 +10758,13 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
10665
10758
  }
10666
10759
  {
10667
10760
  try {
10668
- result = (unsigned int)Gosu::available_width(arg1);
10761
+ result = (int)Gosu::available_width(arg1);
10669
10762
  }
10670
10763
  catch (const std::exception& e) {
10671
10764
  SWIG_exception(SWIG_RuntimeError, e.what());
10672
10765
  }
10673
10766
  }
10674
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
10767
+ vresult = SWIG_From_int(static_cast< int >(result));
10675
10768
  return vresult;
10676
10769
  fail:
10677
10770
  return Qnil;
@@ -10683,7 +10776,7 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
10683
10776
  Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
10684
10777
  void *argp1 = 0 ;
10685
10778
  int res1 = 0 ;
10686
- unsigned int result;
10779
+ int result;
10687
10780
  VALUE vresult = Qnil;
10688
10781
 
10689
10782
  if ((argc < 0) || (argc > 1)) {
@@ -10698,13 +10791,13 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
10698
10791
  }
10699
10792
  {
10700
10793
  try {
10701
- result = (unsigned int)Gosu::available_height(arg1);
10794
+ result = (int)Gosu::available_height(arg1);
10702
10795
  }
10703
10796
  catch (const std::exception& e) {
10704
10797
  SWIG_exception(SWIG_RuntimeError, e.what());
10705
10798
  }
10706
10799
  }
10707
- vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
10800
+ vresult = SWIG_From_int(static_cast< int >(result));
10708
10801
  return vresult;
10709
10802
  fail:
10710
10803
  return Qnil;
@@ -12425,7 +12518,7 @@ SWIGEXPORT void Init_gosu(void) {
12425
12518
  rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
12426
12519
  rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
12427
12520
  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 >(0)));
12521
+ rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(1)));
12429
12522
  rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
12430
12523
  rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
12431
12524
  rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
@@ -12881,6 +12974,9 @@ SWIGEXPORT void Init_gosu(void) {
12881
12974
  rb_define_method(SwigClassWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1);
12882
12975
  rb_define_method(SwigClassWindow.klass, "fullscreen?", VALUEFUNC(_wrap_Window_fullscreenq___), -1);
12883
12976
  rb_define_method(SwigClassWindow.klass, "resizable?", VALUEFUNC(_wrap_Window_resizableq___), -1);
12977
+ rb_define_method(SwigClassWindow.klass, "resizable=", VALUEFUNC(_wrap_Window_resizablee___), -1);
12978
+ rb_define_method(SwigClassWindow.klass, "borderless?", VALUEFUNC(_wrap_Window_borderlessq___), -1);
12979
+ rb_define_method(SwigClassWindow.klass, "borderless=", VALUEFUNC(_wrap_Window_borderlesse___), -1);
12884
12980
  rb_define_method(SwigClassWindow.klass, "update_interval", VALUEFUNC(_wrap_Window_update_interval), -1);
12885
12981
  rb_define_method(SwigClassWindow.klass, "update_interval=", VALUEFUNC(_wrap_Window_update_intervale___), -1);
12886
12982
  rb_define_method(SwigClassWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1);