Skip to content

Commit 2887ea3

Browse files
committed
vector2 -> vec2, matrix4 -> mat4, etc.
1 parent 3b8ca09 commit 2887ea3

15 files changed

Lines changed: 77 additions & 77 deletions

File tree

src/ruisapp/glue/android/application.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public:
5151
return this->cur_win_rect;
5252
}
5353

54-
ruis::vector2 android_win_coords_to_ruisapp_win_rect_coords(const ruis::vector2& p)
54+
ruis::vec2 android_win_coords_to_ruisapp_win_rect_coords(const ruis::vec2& p)
5555
{
5656
// utki::logcat_debug("p = ", p, '\n');
5757
// utki::logcat_debug("this->get_win_rect() = ", this->get_win_rect(), '\n');
58-
ruis::vector2 ret = p - this->get_win_rect().p;
58+
ruis::vec2 ret = p - this->get_win_rect().p;
5959
using std::round;
6060
return round(ret);
6161
}

src/ruisapp/glue/android/globals.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ struct globals_wrapper final {
7272

7373
AInputQueue* input_queue = nullptr;
7474

75-
ruis::vector2 cur_window_dims{0, 0};
75+
ruis::vec2 cur_window_dims{0, 0};
7676

7777
// Array of current pointer positions, needed to detect which pointers have
7878
// actually moved.
79-
std::array<ruis::vector2, 10> pointers;
79+
std::array<ruis::vec2, 10> pointers;
8080

8181
// Application object constructor needs accessing the stuff from globals_wrapper,
8282
// so we need to postpone application object construction to be done after the

src/ruisapp/glue/android/glue.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void handle_input_events()
224224
o << "Action down, ptr id = " << pointer_id << std::endl;
225225
});
226226

227-
ruis::vector2 p(
227+
ruis::vec2 p(
228228
AMotionEvent_getX(event, pointer_index),
229229
AMotionEvent_getY(event, pointer_index)
230230
);
@@ -261,7 +261,7 @@ void handle_input_events()
261261
o << "Action up, ptr id = " << pointer_id << std::endl;
262262
});
263263

264-
ruis::vector2 p(
264+
ruis::vec2 p(
265265
AMotionEvent_getX(event, pointer_index),
266266
AMotionEvent_getY(event, pointer_index)
267267
);
@@ -292,7 +292,7 @@ void handle_input_events()
292292
}
293293

294294
// notify root container only if there was actual movement
295-
ruis::vector2 p(
295+
ruis::vec2 p(
296296
AMotionEvent_getX(event, pointer_num),
297297
AMotionEvent_getY(event, pointer_num)
298298
);

src/ruisapp/glue/ios/window.cxx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2424
#include "application.hxx"
2525

2626
namespace {
27-
void handle_mouse_button(bool is_down, const ruis::vector2& pos, ruis::mouse_button button, unsigned pointer_id)
27+
void handle_mouse_button(bool is_down, const ruis::vec2& pos, ruis::mouse_button button, unsigned pointer_id)
2828
{
2929
auto& glue = get_glue();
3030

@@ -44,7 +44,7 @@ void handle_mouse_button(bool is_down, const ruis::vector2& pos, ruis::mouse_but
4444

4545
namespace {
4646
void handle_mouse_move(
47-
const ruis::vector2& pos, //
47+
const ruis::vec2& pos, //
4848
unsigned pointer_id
4949
)
5050
{
@@ -176,7 +176,7 @@ void handle_mouse_move(
176176
using std::round;
177177
handle_mouse_button(
178178
true, // is_down
179-
round(ruis::vector2(p.x * scale, p.y * scale)), // pos
179+
round(ruis::vec2(p.x * scale, p.y * scale)), // pos
180180
ruis::mouse_button::left,
181181
0 // TODO: pointer id
182182
);
@@ -192,7 +192,7 @@ void handle_mouse_move(
192192

193193
using std::round;
194194
handle_mouse_move(
195-
round(ruis::vector2(p.x * scale, p.y * scale)), // pos
195+
round(ruis::vec2(p.x * scale, p.y * scale)), // pos
196196
0 // TODO: pointer id
197197
);
198198
}
@@ -208,7 +208,7 @@ void handle_mouse_move(
208208
using std::round;
209209
handle_mouse_button(
210210
false, // is_down
211-
round(ruis::vector2(p.x * scale, p.y * scale)), // pos
211+
round(ruis::vec2(p.x * scale, p.y * scale)), // pos
212212
ruis::mouse_button::left,
213213
0 // TODO: pointer id
214214
);
@@ -349,8 +349,8 @@ void native_window::set_fullscreen_internal(bool enable)
349349
// TODO: this was setting the viewport, is something still needed here?
350350
// update_window_rect(
351351
// ruis::rect(
352-
// ruis::vector2(0),
353-
// ruis::vector2(
352+
// ruis::vec2(0),
353+
// ruis::vec2(
354354
// round(this->ios_window.window.frame.size.width * scale),
355355
// round(this->ios_window.window.frame.size.height * scale)
356356
// )
@@ -371,8 +371,8 @@ void native_window::set_fullscreen_internal(bool enable)
371371
// TODO: this was setting the viewport, is something still needed here?
372372
// update_window_rect(
373373
// ruis::rect(
374-
// ruis::vector2(0),
375-
// ruis::vector2(
374+
// ruis::vec2(0),
375+
// ruis::vec2(
376376
// round(this->ios_window.window.frame.size.width * scale),
377377
// round((this->ios_window.window.frame.size.height - statusBarSize.height) * scale)
378378
// )
@@ -391,15 +391,15 @@ ruis::rect native_window::get_content_rect() const
391391

392392
if (this->is_fullscreen()) {
393393
return ruis::rect(
394-
ruis::vector2(0),
395-
ruis::vector2(round(w.frame.size.width * scale), round(w.frame.size.height * scale))
394+
ruis::vec2(0),
395+
ruis::vec2(round(w.frame.size.width * scale), round(w.frame.size.height * scale))
396396
);
397397
} else {
398398
CGSize statusBarSize = [[UIApplication sharedApplication] statusBarFrame].size;
399399

400400
return ruis::rect(
401-
ruis::vector2(0),
402-
ruis::vector2(
401+
ruis::vec2(0),
402+
ruis::vec2(
403403
round(w.frame.size.width * scale),
404404
round((w.frame.size.height - statusBarSize.height) * scale)
405405
)

src/ruisapp/glue/linux/wayland/wayland_pointer.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void wayland_pointer_wrapper::wl_pointer_enter(
133133
true, //
134134
0
135135
);
136-
self.cur_pointer_pos = ruis::vector2(
136+
self.cur_pointer_pos = ruis::vec2(
137137
wl_fixed_to_int(x), //
138138
wl_fixed_to_int(y)
139139
);
@@ -292,7 +292,7 @@ void wayland_pointer_wrapper::wl_pointer_motion(
292292

293293
auto& win = *window;
294294

295-
ruis::vector2 pos( //
295+
ruis::vec2 pos( //
296296
ruis::real(wl_fixed_to_double(x)),
297297
ruis::real(wl_fixed_to_double(y))
298298
);

src/ruisapp/glue/linux/wayland/wayland_pointer.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct wayland_pointer_wrapper {
3434
wayland_surface_wrapper cursor_wayland_surface;
3535

3636
// Current pointer position within current surface.
37-
ruis::vector2 cur_pointer_pos{0, 0};
37+
ruis::vec2 cur_pointer_pos{0, 0};
3838

3939
void connect(wl_seat* seat);
4040
void disconnect() noexcept;

src/ruisapp/glue/linux/wayland/wayland_touch.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void wayland_touch_wrapper::wl_touch_down(
5454

5555
utki::assert(!utki::contains(self.touch_points, id), SL);
5656

57-
ruis::vector2 pos( //
57+
ruis::vec2 pos( //
5858
ruis::real(wl_fixed_to_double(x)),
5959
ruis::real(wl_fixed_to_double(y))
6060
);
@@ -140,7 +140,7 @@ void wayland_touch_wrapper::wl_touch_motion(
140140

141141
auto& glue = get_glue();
142142
if (auto window = glue.get_window(tp.surface)) {
143-
ruis::vector2 pos( //
143+
ruis::vec2 pos( //
144144
ruis::real(wl_fixed_to_double(x)),
145145
ruis::real(wl_fixed_to_double(y))
146146
);

src/ruisapp/glue/linux/xorg/glue.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class app_window : public ruisapp::window
7373
);
7474
}
7575

76-
ruis::vector2 new_win_dims{-1, -1};
76+
ruis::vec2 new_win_dims{-1, -1};
7777
};
7878
} // namespace
7979

@@ -495,22 +495,22 @@ int main(int argc, const char** argv)
495495
case ButtonPress:
496496
w.gui.send_mouse_button(
497497
true, //
498-
ruis::vector2(event.xbutton.x, event.xbutton.y),
498+
ruis::vec2(event.xbutton.x, event.xbutton.y),
499499
button_number_to_enum(event.xbutton.button),
500500
0
501501
);
502502
break;
503503
case ButtonRelease:
504504
w.gui.send_mouse_button(
505505
false, //
506-
ruis::vector2(event.xbutton.x, event.xbutton.y),
506+
ruis::vec2(event.xbutton.x, event.xbutton.y),
507507
button_number_to_enum(event.xbutton.button),
508508
0
509509
);
510510
break;
511511
case MotionNotify:
512512
w.gui.send_mouse_move(
513-
ruis::vector2(
513+
ruis::vec2(
514514
event.xmotion.x, //
515515
event.xmotion.y
516516
), //

src/ruisapp/glue/macos/window.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void handle_mouse_button(
3535
{
3636
NSPoint win_pos = [e locationInWindow];
3737
using std::round;
38-
auto pos = round(ruis::vector2(win_pos.x, win_pos.y));
38+
auto pos = round(ruis::vec2(win_pos.x, win_pos.y));
3939

4040
auto& natwin = w.ruis_native_window.get();
4141

@@ -61,7 +61,7 @@ void handle_mouse_move(
6161
NSPoint win_pos = [e locationInWindow];
6262

6363
using std::round;
64-
auto pos = round(ruis::vector2(win_pos.x, win_pos.y));
64+
auto pos = round(ruis::vec2(win_pos.x, win_pos.y));
6565

6666
auto& natwin = w.ruis_native_window.get();
6767

src/ruisapp/glue/sdl/application.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public:
5353
);
5454
}
5555

56-
ruis::vector2 new_win_dims{-1, -1};
56+
ruis::vec2 new_win_dims{-1, -1};
5757
};
5858
} // namespace
5959

0 commit comments

Comments
 (0)