Screen/canvas conversions and queries.
[The CRT X-Y library (libcrtxy)]


Functions

XY_fixed XY_screenx_to_canvasx (int sx)
 Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).
XY_fixed XY_screeny_to_canvasy (int sy)
 Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).
void XY_screen_to_canvas (int sx, int sy, XY_fixed *cx, XY_fixed *cy)
 Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).
XY_fixed XY_canvasx_to_screenx (int cx)
 Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).
XY_fixed XY_canvasy_to_screeny (int cy)
 Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).
void XY_canvas_to_screen (XY_fixed cx, XY_fixed cy, int *sx, int *sy)
 Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).
int XY_get_screenw (void)
 Returns the screen's current width, in pixels (integer).
int XY_get_screenh (void)
 Returns the screen's current height, in pixels (integer).

Function Documentation

XY_fixed XY_screenx_to_canvasx ( int  sx  ) 

Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).

Parameters:
sx is a screen X coordinate.
Returns:
the screen X coordinate scaled to a corresponding coordinate in canvas units.

XY_fixed XY_screeny_to_canvasy ( int  sy  ) 

Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).

Parameters:
sy is a screen Y coordinate.
Returns:
the screen Y coordinate scaled to a corresponding coordinate in canvas units.

void XY_screen_to_canvas ( int  sx,
int  sy,
XY_fixed cx,
XY_fixed cy 
)

Convert a screen coordinate (an integer; eg, where the mouse was clicked) into canvas virtual world units (fixed point).

Parameters:
sx is a screen X coordinate.
sy is a screen Y coordinate.
cx is a pointer to a variable into which the screen X coordinate, scaled to a corresponding coordinate in canvas units, is to be placed.
cy is a pointer to a variable into which the screen Y coordinate, scaled to a corresponding coordinate in canvas units, is to be placed.

XY_fixed XY_canvasx_to_screenx ( int  cx  ) 

Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).

Parameters:
cx is an X coordinate in canvas units.
Returns:
the screen X coordinate most closely corresponding to cx.

XY_fixed XY_canvasy_to_screeny ( int  cy  ) 

Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).

Parameters:
cy is an Y coordinate in canvas units.
Returns:
the screen Y coordinate most closely corresponding to cy.

void XY_canvas_to_screen ( XY_fixed  cx,
XY_fixed  cy,
int *  sx,
int *  sy 
)

Convert a canvas virtual world coordinate (fixed point) into the nearest screen coordinate (an integer).

Parameters:
cx is an X coordinate in canvas units.
cy is an Y coordinate in canvas units.
sx is a pointer to a variable into which a screen X coordinate most closely corresponding to cx is to be placed.
sy is a pointer to a variable into which a screen Y coordinate most closely corresponding to cy is to be placed.

int XY_get_screenw ( void   ) 

Returns the screen's current width, in pixels (integer).

Returns:
screen width, in pixels.

int XY_get_screenh ( void   ) 

Returns the screen's current height, in pixels (integer).

Returns:
screen height, in pixels.


Generated on Tue Sep 2 23:45:36 2008 for libcrtxy by  doxygen 1.5.5