From 24949b8218a149b8030a85129c6c82c5427ef640 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Oct 2020 17:35:26 +0200 Subject: Move cube vertex data to the file where it is actually used --- examples/cube_view.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'examples/cube_view.h') diff --git a/examples/cube_view.h b/examples/cube_view.h index 8a81f48..cf930a4 100644 --- a/examples/cube_view.h +++ b/examples/cube_view.h @@ -20,6 +20,55 @@ #include "pugl/gl.h" +// clang-format off + +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 +}; + +// clang-format on + static inline void reshapeCube(const float width, const float height) { -- cgit v1.2.1