Class: GLFW::Monitor
- Inherits:
-
Object
- Object
- GLFW::Monitor
- Defined in:
- lib/glfw/stubs/monitor.rb
Overview
Represents a handle to a physical monitor.
Instance Attribute Summary collapse
-
#client_position ⇒ Point
readonly
The position, in screen coordinates, of the upper-left corner of the work area.
-
#client_size ⇒ Size
readonly
The size of the "non-system" area of the monitor, in screen coordinates.
-
#content_scale ⇒ Vec2
readonly
etrieves the content scale for the specified monitor.
-
#gamma_ramp ⇒ Array<Array<Integer>, Array<Integer> Array<Integer>>
Sets teh gamma ramp of the monitor.
-
#name ⇒ String
readonly
The human-readable name of the specified monitor.
-
#physical_size ⇒ Size
readonly
The physical dimensions of the monitor, in millimeter units.
-
#size ⇒ Size
readonly
The dimensions of the monitor, in screen coordinates.
-
#video_mode ⇒ VideoMode
readonly
The current video mode for the monitor.
-
#video_modes ⇒ Array<VideoMode>
readonly
An array of all video modes available to the monitor.
Class Method Summary collapse
-
.available ⇒ Array<Monitor>
Retrieves an array of all connected monitors.
-
.on_connection ⇒ Proc?
The previous callback that was set, or
nil
if none existed. -
.primary ⇒ Monitor
The primary or "default" monitor.
Instance Method Summary collapse
-
#gamma(exponent) ⇒ void
Generates an appropriately sized gamma ramp from the specified exponent and then sets the #gamma_ramp with it.
Instance Attribute Details
#client_position ⇒ Point (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.
82 83 84 |
# File 'lib/glfw/stubs/monitor.rb', line 82 def client_position @client_position end |
#client_size ⇒ Size (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.
90 91 92 |
# File 'lib/glfw/stubs/monitor.rb', line 90 def client_size @client_size end |
#content_scale ⇒ Vec2 (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.
113 114 115 |
# File 'lib/glfw/stubs/monitor.rb', line 113 def content_scale @content_scale end |
#gamma_ramp ⇒ Array<Array<Integer>, Array<Integer> Array<Integer>>
It is strongly recommended to use #gamma instead of this method.
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.
59 60 61 |
# File 'lib/glfw/stubs/monitor.rb', line 59 def gamma_ramp @gamma_ramp end |
#name ⇒ String (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.
66 67 68 |
# File 'lib/glfw/stubs/monitor.rb', line 66 def name @name end |
#physical_size ⇒ Size (readonly)
Returns 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 |
#size ⇒ Size (readonly)
Returns the dimensions of the monitor, in screen coordinates.
74 75 76 |
# File 'lib/glfw/stubs/monitor.rb', line 74 def size @size end |
#video_mode ⇒ VideoMode (readonly)
Returns 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_modes ⇒ Array<VideoMode> (readonly)
Returns 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
.available ⇒ Array<Monitor>
Retrieves an array of all connected monitors.
12 13 |
# File 'lib/glfw/stubs/monitor.rb', line 12 def self.available end |
.self.on_connection {|connected| ... } ⇒ Proc? .self.on_connection ⇒ Proc?
Returns 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 |
.primary ⇒ Monitor
Returns the primary or "default" monitor.
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.
47 48 |
# File 'lib/glfw/stubs/monitor.rb', line 47 def gamma(exponent) end |