Functions | |
void | fltk::concat (float, float, float, float, float, float) |
void | fltk::load_identity () |
void | fltk::pop_matrix () |
void | fltk::push_matrix () |
void | fltk::rotate (float d) |
void | fltk::scale (float x) |
void | fltk::scale (float x, float y) |
void | fltk::transform (Rectangle &) |
void | fltk::transform (int &x, int &y) |
void | fltk::transform (float &x, float &y) |
void | fltk::transform_distance (float &x, float &y) |
void | fltk::translate (int x, int y) |
void | fltk::translate (float x, float y) |
Due to limited graphics capabilities of some systems, all drawing methods that take int values only translate the x and y values, and round them to the nearest integer. You should use functions that take floating-point coordinates if you want accurately scaled drawings.
|
Save the current transformation on a stack, so you can restore it with pop_matrix(). |
|
Put the transformation back to the way it was before the last push_matrix(). Calling this without a matching push_matrix will crash! |
|
Scale the current transformation by multiplying it by x 0 0 0 y 0 0 0 1 |
|
Scale the current transformation by multiplying it by x 0 0 0 x 0 0 0 1 |
|
Translate the current transformation by multiplying it by 1 0 0 0 1 0 x y 1 |
|
This integer version is provided because it is much faster than the floating-point version. However C++ will not "resolve" which one you want to call if you try passing doubles as arguments. To get it to compile, make sure you cast the arguments to float (add 'f' after floating-point constants). Use the 'f' versions (ie sinf(), cosf(), etc) of the math functions from <fltk/math.h> to produce floats and get maximum calculation speed. |
|
Rotate the current transformation counter-clockwise by d degrees (not radians!!). This is done by multiplying the matrix by: cos -sin 0 sin cos 0 0 0 1 |
|
Multiply the current transformation by a b 0 c d 0 x y 1 |
|
Replace the current transform with the identity transform, which puts 0,0 in the top-left corner of the window and each unit is 1 pixel in size. |
|
Replace x and y transformed into device coordinates. Device-specific code can use this to draw things using the fltk transformation matrix. |
|
Replace x and y with the tranformed coordinates, ignoring translation. This transforms a vector which is measuring a distance between two positions, rather than a position. |
|
Replace x and y with the transformed coordinates, rounded to the nearest integer. |
|
Replace the rectangle with a transformed version. Device-specific code can use this to get a rectangle that matches the current fltk transform. This only works correctly for 90 degree rotations, for other transforms this will produce an axis-aligned rectangle with the same area (this is useful for inscribing circles, and is about the best that can be done for device functions that don't handle rotation. |