Record Class SDL_DisplayMode

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_DisplayMode
All Implemented Interfaces:
IPointer, ISDL_DisplayMode

@ValueBasedCandidate @UnsafeConstructor public record SDL_DisplayMode(@NotNull MemorySegment segment) extends Record implements ISDL_DisplayMode

The structure that defines a display mode.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_GetFullscreenDisplayModes
  • SDL_GetDesktopDisplayMode
  • SDL_GetCurrentDisplayMode
  • SDL_SetWindowFullscreenMode
  • SDL_GetWindowFullscreenMode

Structure

typedef struct SDL_DisplayMode {
    SDL_DisplayID displayID;
    SDL_PixelFormat format;
    int w;
    int h;
    float pixel_density;
    float refresh_rate;
    int refresh_rate_numerator;
    int refresh_rate_denominator;
    SDL_DisplayModeData* internal;
} SDL_DisplayMode;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$displayID

      public static final MemoryLayout.PathElement PATH$displayID
    • PATH$format

      public static final MemoryLayout.PathElement PATH$format
    • PATH$w

      public static final MemoryLayout.PathElement PATH$w
    • PATH$h

      public static final MemoryLayout.PathElement PATH$h
    • PATH$pixel_density

      public static final MemoryLayout.PathElement PATH$pixel_density
    • PATH$refresh_rate

      public static final MemoryLayout.PathElement PATH$refresh_rate
    • PATH$refresh_rate_numerator

      public static final MemoryLayout.PathElement PATH$refresh_rate_numerator
    • PATH$refresh_rate_denominator

      public static final MemoryLayout.PathElement PATH$refresh_rate_denominator
    • PATH$internal

      public static final MemoryLayout.PathElement PATH$internal
    • LAYOUT$displayID

      public static final ValueLayout.OfInt LAYOUT$displayID
    • LAYOUT$format

      public static final ValueLayout.OfInt LAYOUT$format
    • LAYOUT$w

      public static final ValueLayout.OfInt LAYOUT$w
    • LAYOUT$h

      public static final ValueLayout.OfInt LAYOUT$h
    • LAYOUT$pixel_density

      public static final ValueLayout.OfFloat LAYOUT$pixel_density
    • LAYOUT$refresh_rate

      public static final ValueLayout.OfFloat LAYOUT$refresh_rate
    • LAYOUT$refresh_rate_numerator

      public static final ValueLayout.OfInt LAYOUT$refresh_rate_numerator
    • LAYOUT$refresh_rate_denominator

      public static final ValueLayout.OfInt LAYOUT$refresh_rate_denominator
    • LAYOUT$internal

      public static final AddressLayout LAYOUT$internal
    • SIZE$displayID

      public static final long SIZE$displayID
    • SIZE$format

      public static final long SIZE$format
    • SIZE$w

      public static final long SIZE$w
    • SIZE$h

      public static final long SIZE$h
    • SIZE$pixel_density

      public static final long SIZE$pixel_density
    • SIZE$refresh_rate

      public static final long SIZE$refresh_rate
    • SIZE$refresh_rate_numerator

      public static final long SIZE$refresh_rate_numerator
    • SIZE$refresh_rate_denominator

      public static final long SIZE$refresh_rate_denominator
    • SIZE$internal

      public static final long SIZE$internal
    • OFFSET$displayID

      public static final long OFFSET$displayID
    • OFFSET$format

      public static final long OFFSET$format
    • OFFSET$w

      public static final long OFFSET$w
    • OFFSET$h

      public static final long OFFSET$h
    • OFFSET$pixel_density

      public static final long OFFSET$pixel_density
    • OFFSET$refresh_rate

      public static final long OFFSET$refresh_rate
    • OFFSET$refresh_rate_numerator

      public static final long OFFSET$refresh_rate_numerator
    • OFFSET$refresh_rate_denominator

      public static final long OFFSET$refresh_rate_denominator
    • OFFSET$internal

      public static final long OFFSET$internal
  • Constructor Details

    • SDL_DisplayMode

      public SDL_DisplayMode(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a SDL_DisplayMode record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details

    • allocate

      public static SDL_DisplayMode allocate(Arena arena)
    • allocate

      public static SDL_DisplayMode.Ptr allocate(Arena arena, long count)
    • clone

      public static SDL_DisplayMode clone(Arena arena, SDL_DisplayMode src)
    • displayID

      @NativeType("SDL_DisplayID") @Unsigned public int displayID()
    • displayID

      public SDL_DisplayMode displayID(@NativeType("SDL_DisplayID") @Unsigned int value)
    • format

      @EnumType(SDL_PixelFormat.class) public int format()
    • format

      public SDL_DisplayMode format(@EnumType(SDL_PixelFormat.class) int value)
    • w

      public int w()
    • w

      public SDL_DisplayMode w(int value)
    • h

      public int h()
    • h

      public SDL_DisplayMode h(int value)
    • pixel_density

      public float pixel_density()
    • pixel_density

      public SDL_DisplayMode pixel_density(float value)
    • refresh_rate

      public float refresh_rate()
    • refresh_rate

      public SDL_DisplayMode refresh_rate(float value)
    • refresh_rate_numerator

      public int refresh_rate_numerator()
    • refresh_rate_numerator

      public SDL_DisplayMode refresh_rate_numerator(int value)
    • refresh_rate_denominator

      public int refresh_rate_denominator()
    • refresh_rate_denominator

      public SDL_DisplayMode refresh_rate_denominator(int value)
    • internal

      @Nullable public @Nullable SDL_DisplayModeData internal()
    • internal

      public SDL_DisplayMode internal(@Nullable @Nullable SDL_DisplayModeData value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • segment

      @NotNull public @NotNull MemorySegment segment()
      Returns the value of the segment record component.
      Specified by:
      segment in interface IPointer
      Returns:
      the value of the segment record component