Max API  8.0.2
Monitors and Displays

Functions for finding our information about the environment. More...

Functions

long jmonitor_getnumdisplays (void)
 Return the number of monitors on which can be displayed. More...
 
void jmonitor_getdisplayrect (long workarea, long displayindex, t_rect *rect)
 Return the t_rect for a given display. More...
 
void jmonitor_getdisplayrect_foralldisplays (long workarea, t_rect *rect)
 Return a union of all display rects. More...
 
void jmonitor_getdisplayrect_forpoint (long workarea, t_pt pt, t_rect *rect)
 Return the t_rect for the display on which a point exists. More...
 
double jmonitor_getdisplayscalefactor (long displayindex)
 Return the scale factor for the display on which a point exists. More...
 
double jmonitor_getdisplayscalefactor_forpoint (t_pt pt)
 Return the scale factor for the display on which a point exists. More...
 
t_pt jmonitor_scale_pt (t_pt unscaled_pt)
 take an unscaled point and convert it to a scaled point note – most APIs take scaled coordinates so drawing doesn't need to consider scale factor for each monitor More...
 
t_pt jmonitor_unscale_pt (t_pt scaled_pt)
 take an unscaled point and convert it to a scaled point note – most APIs take scaled coordinates so drawing doesn't need to consider scale factor for each monitor More...
 

Detailed Description

Functions for finding our information about the environment.

Function Documentation

◆ jmonitor_getdisplayrect()

void jmonitor_getdisplayrect ( long  workarea,
long  displayindex,
t_rect rect 
)

Return the t_rect for a given display.

Parameters
workareaSet workarea non-zero to clip out things like dock / task bar.
displayindexThe index number for a monitor. The primary monitor has an index of 0.
rectThe address of a valid t_rect whose values will be filled-in upon return.

◆ jmonitor_getdisplayrect_foralldisplays()

void jmonitor_getdisplayrect_foralldisplays ( long  workarea,
t_rect rect 
)

Return a union of all display rects.

Parameters
workareaSet workarea non-zero to clip out things like dock / task bar.
rectThe address of a valid t_rect whose values will be filled-in upon return.

◆ jmonitor_getdisplayrect_forpoint()

void jmonitor_getdisplayrect_forpoint ( long  workarea,
t_pt  pt,
t_rect rect 
)

Return the t_rect for the display on which a point exists.

Parameters
workareaSet workarea non-zero to clip out things like dock / task bar.
ptA point, for which the monitor will be determined and the rect recturned.
rectThe address of a valid t_rect whose values will be filled-in upon return.

◆ jmonitor_getdisplayscalefactor()

double jmonitor_getdisplayscalefactor ( long  displayindex)

Return the scale factor for the display on which a point exists.

Parameters
displayindexIndex of the monitor whose scale factor will be returned.

◆ jmonitor_getdisplayscalefactor_forpoint()

double jmonitor_getdisplayscalefactor_forpoint ( t_pt  pt)

Return the scale factor for the display on which a point exists.

Parameters
ptA point, for which the monitor will be determined and the scale factor recturned.

◆ jmonitor_getnumdisplays()

long jmonitor_getnumdisplays ( void  )

Return the number of monitors on which can be displayed.

Returns
The number of monitors.

◆ jmonitor_scale_pt()

t_pt jmonitor_scale_pt ( t_pt  unscaled_pt)

take an unscaled point and convert it to a scaled point note – most APIs take scaled coordinates so drawing doesn't need to consider scale factor for each monitor

Parameters
unscaled_ptthe point to be scaled, should be in pixels on the global "virtual" screen consisting of all monitors
Returns
pointer to receive the scaled point, scaled to normalize based on various scale factors and monitor arrangement

◆ jmonitor_unscale_pt()

t_pt jmonitor_unscale_pt ( t_pt  scaled_pt)

take an unscaled point and convert it to a scaled point note – most APIs take scaled coordinates so drawing doesn't need to consider scale factor for each monitor

Parameters
scaled_ptthe point to be unscaled, should be in normalized coordinates, scaled based on scale factors and monitor arrangement
Returns
pointer to receive the unscaled point, which will be pixel-based coordinates relative to the main monitor origin