summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-08-05 10:44:49 -0400
committerAndrew Opalach <andrew@akon.city> 2025-08-05 10:44:49 -0400
commitf595bcadb2305d5bbc5ea945935a42bcfbf6bdb1 (patch)
treef580d588c0f6911335e56a8d108f080f2383477c /tests
parent01637283b33d7fe4921e9347ada867e44b29edba (diff)
downloadstela-f595bcadb2305d5bbc5ea945935a42bcfbf6bdb1.tar.gz
stela-f595bcadb2305d5bbc5ea945935a42bcfbf6bdb1.tar.bz2
stela-f595bcadb2305d5bbc5ea945935a42bcfbf6bdb1.zip
Interface for scaling scroll values at time of use
- Add MOVE cursor. - Build fixes. Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'tests')
-rw-r--r--tests/window.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/window.c b/tests/window.c
index e13f1fa..e1c5de1 100644
--- a/tests/window.c
+++ b/tests/window.c
@@ -3,11 +3,10 @@
#include <al/types.h>
#include <al/array.h>
#include <al/str.h>
+#include <al/math.h>
#include <stl/window.h>
#include <stl/gl.h>
#include <nnwt/common.h>
-#define _USE_MATH_DEFINES
-#include <math.h>
#define DEFAULT_WIDTH 720
#define DEFAULT_HEIGHT 480
@@ -23,13 +22,6 @@ static const GLfloat init_rotation[] = { -25.f, 35.f, 0.f };
static GLfloat rotation[] = { init_rotation[0], init_rotation[1], init_rotation[2] };
static GLfloat zoom = 0.5f;
-AL_IGNORE_WARNING("-Wunused-function")
-static inline GLfloat degrees_to_radians(GLfloat degrees)
-{
- return degrees * M_PI / 180.f;
-}
-AL_IGNORE_WARNING_END
-
static bool pointer_pos_callback(void *userdata, f64 x, f64 y)
{
(void)userdata;
@@ -60,7 +52,7 @@ static bool pointer_pos_callback(void *userdata, f64 x, f64 y)
static bool scroll_callback(void *userdata, f64 y)
{
(void)userdata;
- zoom += y / -2500.f;
+ zoom += (f32)stl_scale_scroll(y, 50.0);
if (zoom < 0.1f) zoom = 0.1f;
return true;
}