From d813ee2fde40adc0af600fd1c4edeb2b79baf080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 4 Aug 2018 15:20:21 +0200 Subject: [PATCH] doc: fix broken Shaders code snippets. This is not how it should be. --- doc/snippets/MagnumShaders.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/snippets/MagnumShaders.cpp b/doc/snippets/MagnumShaders.cpp index 79d1e6484..1f17352ef 100644 --- a/doc/snippets/MagnumShaders.cpp +++ b/doc/snippets/MagnumShaders.cpp @@ -232,9 +232,8 @@ mesh.draw(shader); /* [MeshVisualizer-usage-geom2] */ /* [MeshVisualizer-usage-no-geom-old1] */ -constexpr std::size_t vertexCount = Containers::arraySize(data); -Float vertexIndex[vertexCount]; -std::iota(vertexIndex, vertexIndex + vertexCount, 0.0f); +Containers::Array vertexIndex{Containers::arraySize(data)}; +std::iota(vertexIndex.begin(), vertexIndex.end(), 0.0f); GL::Buffer vertexIndices; vertexIndices.setData(vertexIndex, GL::BufferUsage::StaticDraw); @@ -353,13 +352,13 @@ mesh.draw(shader); #endif { -GL::Texture2D ambientAlphaTexture, diffuseAlphaTexture; +GL::Texture2D diffuseAlphaTexture; Color3 diffuseRgb, specularRgb; /* [Phong-usage-alpha] */ Shaders::Phong shader{Shaders::Phong::Flag::AmbientTexture| Shaders::Phong::Flag::DiffuseTexture}; -shader.bindTextures(&ambientAlphaTexture, &diffuseAlphaTexture, nullptr) - .setAmbientColor(0x000000ff_rgbf) +shader.bindTextures(&diffuseAlphaTexture, &diffuseAlphaTexture, nullptr) + .setAmbientColor(0x000000ff_rgbaf) .setDiffuseColor(Color4{diffuseRgb, 0.0f}) .setSpecularColor(Color4{specularRgb, 0.0f}); /* [Phong-usage-alpha] */