Vector2I
Generated from engine/math/vector2i.h at aceb130. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
Audience: game code.
#include "engine/math/vector2i.h" · namespace labrador
struct Vector2I
Section titled “struct Vector2I”int x = 0;int y = 0;Vector2I · operator=
Section titled “Vector2I · operator=”Vector2I(const Vector2I&) = default;Vector2I& operator=(const Vector2I&) = default;Vector2I
Section titled “Vector2I”constexpr and defined here so zero is constant-initialised. See Vector2F's constants for what the dynamic alternative risks.
Vector2I
Section titled “Vector2I”Each component truncates toward zero, as static_cast<int> does: (2.9, -2.9) becomes (2, -2). Throws std::invalid_argument for non-finite input and std::out_of_range if a truncated component cannot be represented as int.
operator== · operator!=
Section titled “operator== · operator!=”bool operator!=(const Vector2I& other) const;operator+= · operator-= · operator*=
Section titled “operator+= · operator-= · operator*=”Vector2I& operator-=(const Vector2I& other);Vector2I& operator*=(const Vector2I& other);Vector2I& operator*=(int other);operator/=
Section titled “operator/=”Vector2I& operator/=(int other);Division is int division per component, truncating toward zero: (7, -7) / 2 is (3, -3). Throws std::invalid_argument for a zero divisor and std::overflow_error for INT_MIN / -1. Failure leaves both components unchanged.
offset · scale · set
Section titled “offset · scale · set”void offset(int horizontal_amount, int vertical_amount);void scale(int horizontal_amount, int vertical_amount);void set(int x, int y);operator+ · operator- · operator*
Section titled “operator+ · operator- · operator*”Vector2I operator- (const Vector2I& a, const Vector2I& b);Vector2I operator* (const Vector2I& a, const Vector2I& b);Vector2I operator* (const Vector2I& a, int scale);Vector2I operator* (int scale, const Vector2I& a);operator/
Section titled “operator/”Vector2I operator/ (const Vector2I& a, int scale);Per component, truncating toward zero with the checked contract of operator/=.
Related types
Section titled “Related types”Named in the public declarations above: Vector2F.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
samples/components/animation_preview_content_tests.cpp,gallery_binding_tests.cpp,gallery_pointer_tests.cpp,gallery_state.cpp,gallery_text_tests.cpp,pointer_capture.h,pointer_capture_tests.cppsamples/linesweeper/presentation/touch_controls.htests/app/application_loop_tests.cpp,application_options_tests.cpp,application_resize_tests.cpp,startup_child.cpptests/assets/grid_sheet_loader_tests.cpp,sprite_sheet_loader_tests.cpp,sprite_sheet_resource_tests.cpptests/input/mouse_tests.cpp,touch_tests.cpptests/linesweeper/touch_controls_tests.cpp,touch_pause_tests.cpptests/math/constant_initialisation_tests.cpp,integer_geometry_tests.cpptests/render/camera_tests.cpp,resolution_manager_tests.cpp,viewport_manager_tests.cpp
Explained in
Section titled “Explained in”Development documentation (unreleased). Built from Labrador aceb130 of 2026-11-20.