Bläddra i källkod

tutorial: some refactoring in the tutorials.

legacy
Sam Hocevar sam 12 år sedan
förälder
incheckning
24626c671f
9 ändrade filer med 27 tillägg och 25 borttagningar
  1. +5
    -3
      .gitignore
  2. +2
    -2
      test/tutorial/01_triangle.cpp
  3. +1
    -1
      test/tutorial/02_cube.cpp
  4. +0
    -0
      test/tutorial/03_fractal.cpp
  5. +16
    -16
      test/tutorial/Makefile.am
  6. +0
    -0
      win32/01_triangle.vcxproj
  7. +0
    -0
      win32/02_cube.vcxproj
  8. +0
    -0
      win32/03_fractal.vcxproj
  9. +3
    -3
      win32/lolengine.sln

+ 5
- 3
.gitignore Visa fil

@@ -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


test/tutorial/tut01.cpp → test/tutorial/01_triangle.cpp Visa fil

@@ -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
);

test/tutorial/tut02.cpp → test/tutorial/02_cube.cpp Visa fil

@@ -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);


test/tutorial/tut03.cpp → test/tutorial/03_fractal.cpp Visa fil


+ 16
- 16
test/tutorial/Makefile.am Visa fil

@@ -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


win32/tut01.vcxproj → win32/01_triangle.vcxproj Visa fil


win32/tut02.vcxproj → win32/02_cube.vcxproj Visa fil


win32/tut03.vcxproj → win32/03_fractal.vcxproj Visa fil


+ 3
- 3
win32/lolengine.sln Visa fil

@@ -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


Laddar…
Avbryt
Spara