Class: GLFW::Monitor

Inherits:
Object
  • Object
show all
Defined in:
lib/glfw/stubs/monitor.rb

Overview

Represents a handle to a physical monitor.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_positionPoint (readonly)

The position, in screen coordinates, of the upper-left corner of the work area. The work area is defined as the area of the monitor not occluded by the operating system task bar where present. If no task bar exists then the work area is the monitor resolution in screen coordinates.

Returns:

  • (Point)

    the location of the monitor's work area.



82
83
84
# File 'lib/glfw/stubs/monitor.rb', line 82

def client_position
  @client_position
end

#client_sizeSize (readonly)

The size of the "non-system" area of the monitor, in screen coordinates. The work area is defined as the area of the monitor not occluded by the operating system task bar where present. If no task bar exists then the work area is the monitor resolution in screen coordinates.

Returns:

  • (Size)

    the size of the monitor's work area.



90
91
92
# File 'lib/glfw/stubs/monitor.rb', line 90

def client_size
  @client_size
end

#content_scaleVec2 (readonly)

etrieves the content scale for the specified 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.

Returns:

  • (Vec2)

    the current content scale of the monitor.



113
114
115
# File 'lib/glfw/stubs/monitor.rb', line 113

def content_scale
  @content_scale
end

#gamma_rampArray<Array<Integer>, Array<Integer> Array<Integer>>

Note:

It is strongly recommended to use #gamma instead of this method.

Note:

On Windows, the maximum size of a gamma ramp is 256.

Sets teh gamma ramp of the monitor. The ramp is an array of 3 equally sized arrays of integers that range from 0 to 65535. Each child array represents the ramp for a single color component, in RGB order.

Returns:

  • (Array<Array<Integer>, Array<Integer> Array<Integer>>)

    the gamma ramp.



59
60
61
# File 'lib/glfw/stubs/monitor.rb', line 59

def gamma_ramp
  @gamma_ramp
end

#nameString (readonly)

The human-readable name of the specified monitor. The name typically reflects the make and model of the monitor and is not guaranteed to be unique among the connected monitors.

Returns:

  • (String)

    the monitor name.



66
67
68
# File 'lib/glfw/stubs/monitor.rb', line 66

def name
  @name
end

#physical_sizeSize (readonly)

Returns the physical dimensions of the monitor, in millimeter units.

Returns:

  • (Size)

    the physical dimensions of the monitor, in millimeter units.



70
71
72
# File 'lib/glfw/stubs/monitor.rb', line 70

def physical_size
  @physical_size
end

#sizeSize (readonly)

Returns the dimensions of the monitor, in screen coordinates.

Returns:

  • (Size)

    the dimensions of the monitor, in screen coordinates.



74
75
76
# File 'lib/glfw/stubs/monitor.rb', line 74

def size
  @size
end

#video_modeVideoMode (readonly)

Returns the current video mode for the monitor.

Returns:

  • (VideoMode)

    the current video mode for the monitor.



94
95
96
# File 'lib/glfw/stubs/monitor.rb', line 94

def video_mode
  @video_mode
end

#video_modesArray<VideoMode> (readonly)

Returns an array of all video modes available to the monitor.

Returns:

  • (Array<VideoMode>)

    an array of all video modes available to the monitor.



98
99
100
# File 'lib/glfw/stubs/monitor.rb', line 98

def video_modes
  @video_modes
end

Class Method Details

.availableArray<Monitor>

Retrieves an array of all connected monitors.

Returns:

  • (Array<Monitor>)

    an array of monitors.

See Also:



12
13
# File 'lib/glfw/stubs/monitor.rb', line 12

def self.available
end

.self.on_connection {|connected| ... } ⇒ Proc? .self.on_connectionProc?

Returns the previous callback that was set, or nil if none existed.

Overloads:

  • .self.on_connection {|connected| ... } ⇒ Proc?

    When called with a block, sets a callback to be invoked when the connection state of a monitor is changed.

    Yield Parameters:

    • connected (Boolean)

      true if device was connected, otherwise false if disconectted.

  • .self.on_connectionProc?

    When called without a block, clears any callback that is set.

Returns:

  • (Proc?)

    the previous callback that was set, or nil if none existed.



31
32
# File 'lib/glfw/stubs/monitor.rb', line 31

def self.on_connection
end

.primaryMonitor

Returns the primary or "default" monitor.

Returns:

  • (Monitor)

    the primary or "default" monitor.

See Also:



18
19
# File 'lib/glfw/stubs/monitor.rb', line 18

def self.primary
end

Instance Method Details

#gamma(exponent) ⇒ void

This method returns an undefined value.

Generates an appropriately sized gamma ramp from the specified exponent and then sets the #gamma_ramp 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.

Parameters:

  • the (Float)

    desired exponent value, must be greater than 0.0 and finite.



47
48
# File 'lib/glfw/stubs/monitor.rb', line 47

def gamma(exponent)
end