Package org.lwjgl.sdl

Class SDL_DisplayMode

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_DisplayMode extends Struct<SDL_DisplayMode> implements NativeResource

 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;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • DISPLAYID

      public static final int DISPLAYID
      The struct member offsets.
    • FORMAT

      public static final int FORMAT
      The struct member offsets.
    • W

      public static final int W
      The struct member offsets.
    • H

      public static final int H
      The struct member offsets.
    • PIXEL_DENSITY

      public static final int PIXEL_DENSITY
      The struct member offsets.
    • REFRESH_RATE

      public static final int REFRESH_RATE
      The struct member offsets.
    • REFRESH_RATE_NUMERATOR

      public static final int REFRESH_RATE_NUMERATOR
      The struct member offsets.
    • REFRESH_RATE_DENOMINATOR

      public static final int REFRESH_RATE_DENOMINATOR
      The struct member offsets.
    • INTERNAL

      public static final int INTERNAL
      The struct member offsets.
  • Constructor Details

    • SDL_DisplayMode

      public SDL_DisplayMode(ByteBuffer container)
      Creates a SDL_DisplayMode instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SDL_DisplayMode>
    • displayID

      public int displayID()
      Returns:
      the value of the displayID field.
    • format

      public int format()
      Returns:
      the value of the format field.
    • w

      public int w()
      Returns:
      the value of the w field.
    • h

      public int h()
      Returns:
      the value of the h field.
    • pixel_density

      public float pixel_density()
      Returns:
      the value of the pixel_density field.
    • refresh_rate

      public float refresh_rate()
      Returns:
      the value of the refresh_rate field.
    • refresh_rate_numerator

      public int refresh_rate_numerator()
      Returns:
      the value of the refresh_rate_numerator field.
    • refresh_rate_denominator

      public int refresh_rate_denominator()
      Returns:
      the value of the refresh_rate_denominator field.
    • internal

      public long internal()
      Returns:
      the value of the internal field.
    • displayID

      public SDL_DisplayMode displayID(int value)
      Sets the specified value to the displayID field.
    • format

      public SDL_DisplayMode format(int value)
      Sets the specified value to the format field.
    • w

      public SDL_DisplayMode w(int value)
      Sets the specified value to the w field.
    • h

      public SDL_DisplayMode h(int value)
      Sets the specified value to the h field.
    • pixel_density

      public SDL_DisplayMode pixel_density(float value)
      Sets the specified value to the pixel_density field.
    • refresh_rate

      public SDL_DisplayMode refresh_rate(float value)
      Sets the specified value to the refresh_rate field.
    • refresh_rate_numerator

      public SDL_DisplayMode refresh_rate_numerator(int value)
      Sets the specified value to the refresh_rate_numerator field.
    • refresh_rate_denominator

      public SDL_DisplayMode refresh_rate_denominator(int value)
      Sets the specified value to the refresh_rate_denominator field.
    • internal

      public SDL_DisplayMode internal(long value)
      Sets the specified value to the internal field.
    • set

      public SDL_DisplayMode set(int displayID, int format, int w, int h, float pixel_density, float refresh_rate, int refresh_rate_numerator, int refresh_rate_denominator, long internal)
      Initializes this struct with the specified values.
    • set

      public SDL_DisplayMode set(SDL_DisplayMode src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static SDL_DisplayMode malloc()
      Returns a new SDL_DisplayMode instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static SDL_DisplayMode calloc()
      Returns a new SDL_DisplayMode instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static SDL_DisplayMode create()
      Returns a new SDL_DisplayMode instance allocated with BufferUtils.
    • create

      public static SDL_DisplayMode create(long address)
      Returns a new SDL_DisplayMode instance for the specified memory address.
    • createSafe

      public static @Nullable SDL_DisplayMode createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_DisplayMode.Buffer malloc(int capacity)
      Returns a new SDL_DisplayMode.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SDL_DisplayMode.Buffer calloc(int capacity)
      Returns a new SDL_DisplayMode.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_DisplayMode.Buffer create(int capacity)
      Returns a new SDL_DisplayMode.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_DisplayMode.Buffer create(long address, int capacity)
      Create a SDL_DisplayMode.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SDL_DisplayMode.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_DisplayMode malloc(MemoryStack stack)
      Returns a new SDL_DisplayMode instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static SDL_DisplayMode calloc(MemoryStack stack)
      Returns a new SDL_DisplayMode instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SDL_DisplayMode.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SDL_DisplayMode.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SDL_DisplayMode.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SDL_DisplayMode.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ndisplayID

      public static int ndisplayID(long struct)
      Unsafe version of displayID().
    • nformat

      public static int nformat(long struct)
      Unsafe version of format().
    • nw

      public static int nw(long struct)
      Unsafe version of w().
    • nh

      public static int nh(long struct)
      Unsafe version of h().
    • npixel_density

      public static float npixel_density(long struct)
      Unsafe version of pixel_density().
    • nrefresh_rate

      public static float nrefresh_rate(long struct)
      Unsafe version of refresh_rate().
    • nrefresh_rate_numerator

      public static int nrefresh_rate_numerator(long struct)
      Unsafe version of refresh_rate_numerator().
    • nrefresh_rate_denominator

      public static int nrefresh_rate_denominator(long struct)
      Unsafe version of refresh_rate_denominator().
    • ninternal

      public static long ninternal(long struct)
      Unsafe version of internal().
    • ndisplayID

      public static void ndisplayID(long struct, int value)
      Unsafe version of displayID.
    • nformat

      public static void nformat(long struct, int value)
      Unsafe version of format.
    • nw

      public static void nw(long struct, int value)
      Unsafe version of w.
    • nh

      public static void nh(long struct, int value)
      Unsafe version of h.
    • npixel_density

      public static void npixel_density(long struct, float value)
      Unsafe version of pixel_density.
    • nrefresh_rate

      public static void nrefresh_rate(long struct, float value)
      Unsafe version of refresh_rate.
    • nrefresh_rate_numerator

      public static void nrefresh_rate_numerator(long struct, int value)
      Unsafe version of refresh_rate_numerator.
    • nrefresh_rate_denominator

      public static void nrefresh_rate_denominator(long struct, int value)
      Unsafe version of refresh_rate_denominator.
    • ninternal

      public static void ninternal(long struct, long value)
      Unsafe version of internal.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate