From e5481cb32b6e63881670c885fb659ef5e0b4a7bf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 23 Jul 2019 19:58:10 +0200 Subject: Make pugl_test use a nested view and test focus and movement --- test/test_utils.h | 91 ++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 48 deletions(-) (limited to 'test/test_utils.h') diff --git a/test/test_utils.h b/test/test_utils.h index 12dbfaa..bf058ac 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -24,54 +24,49 @@ typedef struct { double lastReportTime; } PuglFpsPrinter; -static const float cubeVertices[] = { - -1.0f, -1.0f, -1.0f, - -1.0f, -1.0f, 1.0f, - -1.0f, 1.0f, 1.0f, - - 1.0f, 1.0f, -1.0f, - -1.0f, -1.0f, -1.0f, - -1.0f, 1.0f, -1.0f, - - 1.0f, -1.0f, 1.0f, - -1.0f, -1.0f, -1.0f, - 1.0f, -1.0f, -1.0f, - - 1.0f, 1.0f, -1.0f, - 1.0f, -1.0f, -1.0f, - -1.0f, -1.0f, -1.0f, - - -1.0f, -1.0f, -1.0f, - -1.0f, 1.0f, 1.0f, - -1.0f, 1.0f, -1.0f, - - 1.0f, -1.0f, 1.0f, - -1.0f, -1.0f, 1.0f, - -1.0f, -1.0f, -1.0f, - - -1.0f, 1.0f, 1.0f, - -1.0f, -1.0f, 1.0f, - 1.0f, -1.0f, 1.0f, - - 1.0f, 1.0f, 1.0f, - 1.0f, -1.0f, -1.0f, - 1.0f, 1.0f, -1.0f, - - 1.0f, -1.0f, -1.0f, - 1.0f, 1.0f, 1.0f, - 1.0f, -1.0f, 1.0f, - - 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, -1.0f, - -1.0f, 1.0f, -1.0f, - - 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f, -1.0f, - -1.0f, 1.0f, 1.0f, - - 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f, 1.0f, - 1.0f, -1.0f, 1.0f +static const float cubeStripVertices[] = { + -1.0f, 1.0f, 1.0f, // Front top left + 1.0f, 1.0f, 1.0f, // Front top right + -1.0f, -1.0f, 1.0f, // Front bottom left + 1.0f, -1.0f, 1.0f, // Front bottom right + 1.0f, -1.0f, -1.0f, // Back bottom right + 1.0f, 1.0f, 1.0f, // Front top right + 1.0f, 1.0f, -1.0f, // Back top right + -1.0f, 1.0f, 1.0f, // Front top left + -1.0f, 1.0f, -1.0f, // Back top left + -1.0f, -1.0f, 1.0f, // Front bottom left + -1.0f, -1.0f, -1.0f, // Back bottom left + 1.0f, -1.0f, -1.0f, // Back bottom right + -1.0f, 1.0f, -1.0f, // Back top left + 1.0f, 1.0f, -1.0f // Back top right +}; + +static const float cubeFrontLineLoop[] = { + -1.0f, 1.0f, 1.0f, // Front top left + 1.0f, 1.0f, 1.0f, // Front top right + 1.0f, -1.0f, 1.0f, // Front bottom right + -1.0f, -1.0f, 1.0f, // Front bottom left +}; + +static const float cubeBackLineLoop[] = { + -1.0f, 1.0f, -1.0f, // Back top left + 1.0f, 1.0f, -1.0f, // Back top right + 1.0f, -1.0f, -1.0f, // Back bottom right + -1.0f, -1.0f, -1.0f, // Back bottom left +}; + +static const float cubeSideLines[] = { + -1.0f, 1.0f, 1.0f, // Front top left + -1.0f, 1.0f, -1.0f, // Back top left + + -1.0f, -1.0f, 1.0f, // Front bottom left + -1.0f, -1.0f, -1.0f, // Back bottom left + + 1.0f, 1.0f, 1.0f, // Front top right + 1.0f, 1.0f, -1.0f, // Back top right + + 1.0f, -1.0f, 1.0f, // Front bottom right + 1.0f, -1.0f, -1.0f, // Back bottom right }; /** Calculate a projection matrix for a given perspective. */ -- cgit v1.2.1