diff --git a/tests/hellosurface/.gitignore b/tests/hellosurface/.gitignore new file mode 100644 index 0000000..3035e0b --- /dev/null +++ b/tests/hellosurface/.gitignore @@ -0,0 +1,2 @@ +hellosurface + diff --git a/tests/hellosurface/Makefile b/tests/hellosurface/Makefile new file mode 100644 index 0000000..75c5430 --- /dev/null +++ b/tests/hellosurface/Makefile @@ -0,0 +1,21 @@ +# This is the default target, which will be built when +# you invoke make +.PHONY: all +all: hellosurface + +# This rule tells make how to build hellosurface from hellosurface.cpp +hellosurface: hellosurface.cpp + g++ -g -o hellosurface hellosurface.cpp + +# This rule tells make to copy hellosurface to the binaries subdirectory, +# creating it if necessary +.PHONY: install +install: + mkdir -p binaries + cp -p hellosurface binaries + +# This rule tells make to delete hellosurface and hellosurface.o +.PHONY: clean +clean: + rm -f hellosurface hellosurface.o + diff --git a/tests/hellosurface/README b/tests/hellosurface/README new file mode 100644 index 0000000..8cc2921 --- /dev/null +++ b/tests/hellosurface/README @@ -0,0 +1 @@ +Simple program to test a 3d surface. diff --git a/tests/hellosurface/hellosurface.cpp b/tests/hellosurface/hellosurface.cpp new file mode 100644 index 0000000..38238ae --- /dev/null +++ b/tests/hellosurface/hellosurface.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +int main (void) { + + float xyz[] = { + 0.0, 0.0, 3.0, + 1.0, 4.0, 0.0, + 0.0, 1.0, 0.0, + 4.0, 0.0, 3.0, + 1.0, 4.0, 7.0, + 0.0, 6.0, 0.0 + }; + + int npoints = sizeof(xyz) / (3 * sizeof(float)); + + printf("Hello surface!\n"); + printf("# points = %d\n", npoints); + + for (int i=0,j=0; i