diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
commit | f8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch) | |
tree | 26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/util/warp.c | |
parent | Initial commit. (diff) | |
download | virtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.tar.xz virtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.zip |
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/util/warp.c')
-rw-r--r-- | src/VBox/GuestHost/OpenGL/util/warp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/util/warp.c b/src/VBox/GuestHost/OpenGL/util/warp.c new file mode 100644 index 00000000..0e008db9 --- /dev/null +++ b/src/VBox/GuestHost/OpenGL/util/warp.c @@ -0,0 +1,24 @@ +/* Copyright (c) 2001, Stanford University + * All rights reserved + * + * See the file LICENSE.txt for information on redistributing this software. + */ + +#include "cr_error.h" +#include "cr_warp.h" + +void +crWarpPoint(const float *align, const float *point, float *result) +{ + float w, x, y; + + x = align[0] * point[0] + align[1] * point[1] + align[2]; + y = align[3] * point[0] + align[4] * point[1] + align[5]; + w = align[6] * point[0] + align[7] * point[1] + align[8]; + + if (w == 0) + crError("Crud in alignment matrix --> w == 0. bleh!"); + + result[0] = x / w; + result[1] = y / w; +} |