Vixen
02b45cc4
csharp
public readonly struct Int2

A two-component integer vector: pixel and texel coordinates, texture and window sizes, grid cells — the places where a Vector2 would invite a rounding decision that has no right answer.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (8)

  • public readonly int X

    The X component.

  • public readonly int Y

    The Y component.

  • public static Int2 Zero

    All components zero.

  • public static Int2 One

    All components one.

  • public static Int2 UnitX

    The X axis.

  • public static Int2 UnitY

    The Y axis.

  • public int this[int index]

    The component at .

  • public long Area

    The product of the components — the area of a size, the texel count of an extent.

Methods (22)

  • public Int2(int x, int y)

    Builds a vector from its components.

  • public Int2(int value)

    Builds a vector with every component set to .

  • public static Int2 Min(Int2 left, Int2 right)

    The component-wise minimum.

  • public static Int2 Max(Int2 left, Int2 right)

    The component-wise maximum.

  • public static Int2 Clamp(Int2 value, Int2 min, Int2 max)

    Constrains each component to the matching interval.

  • public static Int2 operator +(Int2 left, Int2 right)

    Adds two vectors.

  • public static Int2 operator -(Int2 left, Int2 right)

    Subtracts one vector from another.

  • public static Int2 operator -(Int2 value)

    Negates a vector.

  • public static Int2 operator *(Int2 left, Int2 right)

    Multiplies component by component.

  • public static Int2 operator *(Int2 value, int scale)

    Scales a vector.

  • public static Int2 operator *(int scale, Int2 value)

    Scales a vector.

  • public static Int2 operator /(Int2 left, Int2 right)

    Divides component by component, truncating toward zero.

  • public static Int2 operator /(Int2 value, int divisor)

    Divides by a scalar, truncating toward zero.

  • public static bool operator ==(Int2 left, Int2 right)

    Component-wise equality.

  • public static bool operator !=(Int2 left, Int2 right)

    The negation of op_Equality.

  • public static implicit operator Vector2(Int2 value)

    Widens to a float vector, which is always exact for these magnitudes.

  • public void Deconstruct(out int x, out int y)

    Splits the vector into its components.

  • public bool Equals(Int2 other)

    Indicates whether the current object is equal to another object of the same type.

  • public override bool Equals(object? obj)

    Indicates whether this instance and a specified object are equal.

  • public override int GetHashCode()

    Returns the hash code for this instance.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

  • public string ToString(string? format, IFormatProvider? formatProvider)

    Formats the value of the current instance using the specified format.

Used by (223, showing 40)

  • PbrShowcaseGamePbrShowcase
  • ProgramHelloUi
  • TriangleGameHelloTriangle
  • UiHostHelloUi
  • VideoGameVideoPlayback
  • VirtualGeometryGameVirtualGeometry
  • AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
  • AdaptiveProbeTestsVixen.Rendering.ScreenProbes.Tests
  • AmbientOcclusionRendererVixen.Rendering.PostFx
  • AppGraphicsVixen.App.Hosting
  • AtlasConventionTestsVixen.Rendering.ScreenProbes.Tests
  • AutoExposureRendererVixen.Rendering.PostFx
  • AutoExposureTestsVixen.Rendering.PostFx.Tests
  • BinVixen.Rendering
  • BloomRendererVixen.Rendering.PostFx
  • BloomTestsVixen.Rendering.PostFx.Tests
  • CardRadiosityVixen.Rendering.SurfaceCache
  • CellVixen.Rendering
  • ClipboardImageVixen.Platform
  • ClusterAttributeTestsVixen.Rendering.Tests
  • ClusterAttributesVixen.Rendering
  • ClusterSoftwareRasterConstantsVixen.Rendering
  • ClusterSoftwareRasterKeysVixen.Rendering
  • CompositorFrameVixen.Rendering
  • CornellBoxTestsVixen.Rendering.SurfaceCache.Tests
  • DesktopDisplaysVixen.Platform.Desktop
  • DesktopPlatformVixen.Platform.Desktop
  • DesktopPlatformTestsVixen.Platform.Desktop.Tests
  • DesktopSurfaceVixen.Platform.Desktop
  • DesktopWindowVixen.Platform.Desktop
  • DibImageVixen.Platform.Windows
  • DibImageTestsVixen.Platform.Windows.Tests
  • DisplayModeVixen.Platform
  • DistanceFieldAoRendererVixen.Rendering.PostFx
  • EffectLoaderVixen.Shaders
  • EglAttributeTestsVixen.Graphics.OpenGL.Tests
  • EglAttributesVixen.Graphics.OpenGL
  • EglContextVixen.Graphics.OpenGL
  • EglContextOptionsVixen.Graphics.OpenGL
  • EglContextTestsVixen.Graphics.OpenGL.Tests