From 24626c671f52982e836aaba2f9256e3ed9c8c859 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 20 Apr 2012 20:01:16 +0000 Subject: [PATCH] tutorial: some refactoring in the tutorials. --- .gitignore | 8 +++-- test/tutorial/{tut01.cpp => 01_triangle.cpp} | 4 +-- test/tutorial/{tut02.cpp => 02_cube.cpp} | 2 +- test/tutorial/{tut03.cpp => 03_fractal.cpp} | 0 test/tutorial/Makefile.am | 32 ++++++++++---------- win32/{tut01.vcxproj => 01_triangle.vcxproj} | 0 win32/{tut02.vcxproj => 02_cube.vcxproj} | 0 win32/{tut03.vcxproj => 03_fractal.vcxproj} | 0 win32/lolengine.sln | 6 ++-- 9 files changed, 27 insertions(+), 25 deletions(-) rename test/tutorial/{tut01.cpp => 01_triangle.cpp} (95%) rename test/tutorial/{tut02.cpp => 02_cube.cpp} (99%) rename test/tutorial/{tut03.cpp => 03_fractal.cpp} (100%) rename win32/{tut01.vcxproj => 01_triangle.vcxproj} (100%) rename win32/{tut02.vcxproj => 02_cube.vcxproj} (100%) rename win32/{tut03.vcxproj => 03_fractal.vcxproj} (100%) diff --git a/.gitignore b/.gitignore index 1b380f13..52ed9159 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ patch-*.diff core core.* vgcore.* +callgrind.out.* +perf.data* # Editor cruft .*.swp *~ @@ -56,9 +58,9 @@ win32/*.XGD !contrib/*/*/*/*/*/*/* # Our binaries test/testsuite -test/tutorial/tut01 -test/tutorial/tut02 -test/tutorial/tut03 +test/tutorial/01_triangle +test/tutorial/02_cube +test/tutorial/03_fractal test/benchsuite test/quad test/sandbox/sample diff --git a/test/tutorial/tut01.cpp b/test/tutorial/01_triangle.cpp similarity index 95% rename from test/tutorial/tut01.cpp rename to test/tutorial/01_triangle.cpp index 15bffe21..4524c713 100644 --- a/test/tutorial/tut01.cpp +++ b/test/tutorial/01_triangle.cpp @@ -58,7 +58,7 @@ public: "#version 120\n" "void main(void) {" - " gl_FragColor = vec4(0.7, 0.5, 0.2, 1.0);" + " gl_FragColor = vec4(0.7, 0.2, 0.5, 1.0);" "}" #else "void main(float2 in_Position : POSITION," @@ -67,7 +67,7 @@ public: "}", "void main(out float4 out_FragColor : COLOR) {" - " out_FragColor = float4(0.7, 0.5, 0.2, 1.0);" + " out_FragColor = float4(0.7, 0.2, 0.5, 1.0);" "}" #endif ); diff --git a/test/tutorial/tut02.cpp b/test/tutorial/02_cube.cpp similarity index 99% rename from test/tutorial/tut02.cpp rename to test/tutorial/02_cube.cpp index 91d77936..3e81ac27 100644 --- a/test/tutorial/tut02.cpp +++ b/test/tutorial/02_cube.cpp @@ -81,7 +81,7 @@ public: m_angle += deltams / 1000.0f * 45.0f; mat4 anim = mat4::rotate(m_angle, vec3(0, 1, 0)); - mat4 model = mat4::translate(vec3(0, 0, -4)); + mat4 model = mat4::translate(vec3(0, 0, -4.5)); mat4 view = mat4::lookat(vec3(0, 2, 0), vec3(0, 0, -4), vec3(0, 1, 0)); mat4 proj = mat4::perspective(45.0f, 640.0f, 480.0f, 0.1f, 10.0f); diff --git a/test/tutorial/tut03.cpp b/test/tutorial/03_fractal.cpp similarity index 100% rename from test/tutorial/tut03.cpp rename to test/tutorial/03_fractal.cpp diff --git a/test/tutorial/Makefile.am b/test/tutorial/Makefile.am index 1146eac8..717141fa 100644 --- a/test/tutorial/Makefile.am +++ b/test/tutorial/Makefile.am @@ -2,28 +2,28 @@ AM_CPPFLAGS = -I$(top_srcdir)/src all-local: $(noinst_PROGRAMS) - test x$(MAKE_FSELF) = xno || make_fself tut01$(EXEEXT) tut01.self - test x$(MAKE_FSELF) = xno || make_fself tut02$(EXEEXT) tut02.self - test x$(MAKE_FSELF) = xno || make_fself tut03$(EXEEXT) tut03.self + for x in $(noinst_PROGRAMS); do \ + test x$(MAKE_FSELF) = xno || make_fself $${x}$(EXEEXT) $${x}.self; \ + done CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) -noinst_PROGRAMS = tut01 tut02 tut03 +noinst_PROGRAMS = 01_triangle 02_cube 03_fractal -tut01_SOURCES = tut01.cpp -tut01_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ -tut01_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ -tut01_DEPENDENCIES = $(top_builddir)/src/liblol.a +01_triangle_SOURCES = 01_triangle.cpp +01_triangle_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ +01_triangle_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ +01_triangle_DEPENDENCIES = $(top_builddir)/src/liblol.a -tut02_SOURCES = tut02.cpp -tut02_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ -tut02_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ -tut02_DEPENDENCIES = $(top_builddir)/src/liblol.a +02_cube_SOURCES = 02_cube.cpp +02_cube_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ +02_cube_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ +02_cube_DEPENDENCIES = $(top_builddir)/src/liblol.a -tut03_SOURCES = tut03.cpp -tut03_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ -tut03_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ -tut03_DEPENDENCIES = $(top_builddir)/src/liblol.a +03_fractal_SOURCES = 03_fractal.cpp +03_fractal_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ +03_fractal_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ +03_fractal_DEPENDENCIES = $(top_builddir)/src/liblol.a diff --git a/win32/tut01.vcxproj b/win32/01_triangle.vcxproj similarity index 100% rename from win32/tut01.vcxproj rename to win32/01_triangle.vcxproj diff --git a/win32/tut02.vcxproj b/win32/02_cube.vcxproj similarity index 100% rename from win32/tut02.vcxproj rename to win32/02_cube.vcxproj diff --git a/win32/tut03.vcxproj b/win32/03_fractal.vcxproj similarity index 100% rename from win32/tut03.vcxproj rename to win32/03_fractal.vcxproj diff --git a/win32/lolengine.sln b/win32/lolengine.sln index 735f06b0..5711db12 100644 --- a/win32/lolengine.sln +++ b/win32/lolengine.sln @@ -41,17 +41,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite.vcxp EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tutorial", "Tutorial", "{E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut01", "tut01.vcxproj", "{B92ABADC-45BE-4CC5-B724-9426053123A1}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01_triangle", "01_triangle.vcxproj", "{B92ABADC-45BE-4CC5-B724-9426053123A1}" ProjectSection(ProjectDependencies) = postProject {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} = {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut02", "tut02.vcxproj", "{7B083DA2-FE08-4F6D-BFDD-195D5C2783EB}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02_cube", "02_cube.vcxproj", "{7B083DA2-FE08-4F6D-BFDD-195D5C2783EB}" ProjectSection(ProjectDependencies) = postProject {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} = {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut03", "tut03.vcxproj", "{6BF81B39-EDC2-4227-9992-C2D8ABEA95AF}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03_fractal", "03_fractal.vcxproj", "{6BF81B39-EDC2-4227-9992-C2D8ABEA95AF}" ProjectSection(ProjectDependencies) = postProject {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} = {9E62F2FE-3408-4EAE-8238-FD84238CEEDA} EndProjectSection