summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/util/warp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
commitf8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch)
tree26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/util/warp.c
parentInitial commit. (diff)
downloadvirtualbox-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.c24
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;
+}