//
// Generated by Brutal.Glfw.Generate; do not edit by hand.
#nullable enable
namespace Brutal.GlfwApi
{
public static unsafe partial class Glfw
{
///
/// Returns the primary monitor.
///
/// The primary monitor, or if no monitors were found or if an
/// error occurred.
///
/// This function returns the primary monitor. This is usually the monitor where elements like the task bar or
/// global menu bar are located.
///
/// The primary monitor is always first in the array returned by .
///
///
///
///
///
///
/// This function must only be called from the main thread.
///
///
/// Retrieving
/// monitors
public static GlfwMonitor PrimaryMonitor
{
get => PInvoke.GetPrimaryMonitor();
}
///
/// Returns the currently connected monitors.
///
/// An array of monitor handles, or null if no monitors were found or if an error
/// occurred.
///
/// This function returns an array of handles for all currently connected monitors. The primary monitor is
/// always first in the returned array. If no monitors were found, this function returns null.
///
///
///
///
///
/// This function must only be called from the main thread.
///
///
/// Retrieving
/// monitors
/// Monitor
/// configuration changes
public static ReadOnlySpan GetMonitors()
{
int count;
return new ReadOnlySpan(PInvoke.GetMonitors(out count), count);
}
}
public readonly unsafe partial struct GlfwMonitor
{
///
/// Returns the name of the monitor.
///
/// The name of the monitor, or null if an error occurred.
///
/// This function returns a human-readable name of the monitor. The name typically reflects the make and model
/// of the monitor and is not guaranteed to be unique among the connected monitors.
///
///
///
///
///
/// This function must only be called from the main thread.
///
/// Monitor
/// properties
public string? Name
{
get => Glfw.PInvoke.GetMonitorName(this);
}
///
/// Gets/Sets the user pointer of the monitor.
///
///
/// This function sets the user-defined pointer of the monitor. The current value is retained until the
/// monitor is disconnected. The initial value is null.
///
/// This function may be called from the monitor callback, even for a monitor that is being disconnected.
///
///
///
///
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// User pointer
public void* UserPointer
{
get => Glfw.PInvoke.GetMonitorUserPointer(this);
set => Glfw.PInvoke.SetMonitorUserPointer(this, value);
}
///
/// Returns the position of the monitor's viewport on the virtual screen.
///
///
/// This function returns the position, in screen coordinates, of the upper-left corner of the monitor.
///
/// If an error occurs, the position is set to (0, 0).
///
///
///
/// ,
///
///
/// This function must only be called from the main thread.
///
/// Monitor
/// properties
public int2 Position
{
get
{
int xPos;
int yPos;
Glfw.PInvoke.GetMonitorPos(this, out xPos, out yPos);
return new int2(xPos, yPos);
}
}
///
/// Returns the physical size of the monitor.
///
///
/// This function returns the size, in millimetres, of the display area of the monitor.
///
/// Some systems do not provide accurate monitor size information, either because the monitor EDID data is
/// incorrect or because the driver does not report it accurately.
///
///
/// Any or all of the size arguments may be null. If an error occurs, all values will be set to zero.
///
///
///
/// ,
///
///
/// This function must only be called from the main thread.
///
/// Monitor
/// properties
public int2 PhysicalSize
{
get
{
int widthMillimeters;
int heightMillimeters;
Glfw.PInvoke.GetMonitorPhysicalSize(this, out widthMillimeters, out heightMillimeters);
return new int2(widthMillimeters, heightMillimeters);
}
}
///
/// Retrieves the content scale for the monitor.
///
///
/// This function retrieves the content scale for the monitor. The content scale is the ratio between the
/// current DPI and the platform's default DPI. This is especially important for text and any UI elements. If
/// the pixel dimensions of your UI scaled by this look appropriate on your machine then it should appear at a
/// reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system
/// DPI and scaling settings being somewhat correct.
///
/// The content scale may depend on both the monitor resolution and pixel density and on user settings. It
/// may be very different from the raw DPI calculated from the physical size and current resolution.
///
///
///
/// ,
///
///
/// This function must only be called from the main thread.
///
///
/// Content scale
public float2 ContentScale
{
get
{
float xScale;
float yScale;
Glfw.PInvoke.GetMonitorContentScale(this, out xScale, out yScale);
return new float2(xScale, yScale);
}
}
///
/// Returns the available video modes for the monitor.
///
///
/// This function returns an array of all video modes supported by the monitor. The returned array is sorted
/// in ascending order, first by color bit depth (the sum of all channel depths), then by resolution area (the
/// product of width and height), then resolution width and finally by refresh rate.
///
/// On macOS the array holds the non-HiDPI modes plus the desktop mode at the time the array was created,
/// which is usually a HiDPI mode. A request matching the mode in place before GLFW changed it restores that
/// exact mode; otherwise a request matching the current mode with an explicit refresh rate keeps it.
///
///
///
///
///
///
/// This function must only be called from the main thread.
///
/// VideoMode
/// Video modes
public ReadOnlySpan VideoModes
{
get
{
int count;
return new ReadOnlySpan(Glfw.PInvoke.GetVideoModes(this, out count), count);
}
}
///
/// Generates a gamma ramp and sets it for the monitor.
///
///
/// This function generates an appropriately sized gamma ramp from the specified exponent and then calls
/// glfwSetGammaRamp with it. The value must be a finite number greater than zero.
///
/// The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today
/// is usually an approximation of sRGB gamma. This means that setting a perfectly linear ramp, or gamma
/// 1.0, will produce the default (usually sRGB-like) behavior.
///
///
/// For gamma correct rendering with OpenGL or OpenGL ES, see the GLFW_SRGB_CAPABLE hint.
///
///
///
///
///
///
/// Gamma ramp
public void SetGamma(float gamma) => Glfw.PInvoke.SetGamma(this, gamma);
}
}