Browse Source

Fixed access to nonexistent MagnumShaders resources in utilities.

pull/71/head
Vladimír Vondruš 12 years ago
parent
commit
f0793d6aea
  1. 4
      src/Magnum/Shaders/DistanceFieldVector.cpp
  2. 4
      src/Magnum/Shaders/Flat.cpp
  3. 4
      src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h
  4. 6
      src/Magnum/Shaders/MeshVisualizer.cpp
  5. 4
      src/Magnum/Shaders/Phong.cpp
  6. 4
      src/Magnum/Shaders/Vector.cpp
  7. 4
      src/Magnum/Shaders/VertexColor.cpp
  8. 4
      src/Magnum/TextureTools/DistanceField.cpp

4
src/Magnum/Shaders/DistanceFieldVector.cpp

@ -50,8 +50,8 @@ template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldV
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
frag.addSource(rs.get("generic.glsl"))
.addSource(rs.get(vertexShaderName<dimensions>()));

4
src/Magnum/Shaders/Flat.cpp

@ -53,8 +53,8 @@ template<UnsignedInt dimensions> Flat<dimensions>::Flat(const Flags flags): tran
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
vert.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "")
.addSource(rs.get("generic.glsl"))

4
src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h

@ -33,7 +33,7 @@
namespace Magnum { namespace Shaders { namespace Implementation {
inline Shader createCompatibilityShader(Version version, Shader::Type type) {
inline Shader createCompatibilityShader(const Utility::Resource& rs, Version version, Shader::Type type) {
Shader shader(version, type);
#ifndef MAGNUM_TARGET_GLES
@ -52,7 +52,7 @@ inline Shader createCompatibilityShader(Version version, Shader::Type type) {
shader.addSource("#ifndef GL_ES\n#define GL_ES 1\n#endif\n");
#endif
shader.addSource(Utility::Resource("MagnumShaders").get("compatibility.glsl"));
shader.addSource(rs.get("compatibility.glsl"));
return shader;
}

6
src/Magnum/Shaders/MeshVisualizer.cpp

@ -56,8 +56,8 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
vert.addSource(flags & Flag::Wireframe ? "#define WIREFRAME_RENDERING\n" : "")
.addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "")
@ -76,7 +76,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
#ifndef MAGNUM_TARGET_GLES
std::optional<Shader> geom;
if(flags & Flag::Wireframe && !(flags & Flag::NoGeometryShader)) {
geom = Implementation::createCompatibilityShader(version, Shader::Type::Geometry);
geom = Implementation::createCompatibilityShader(rs, version, Shader::Type::Geometry);
geom->addSource(rs.get("MeshVisualizer.geom"));
}
#endif

4
src/Magnum/Shaders/Phong.cpp

@ -53,8 +53,8 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
vert.addSource(flags ? "#define TEXTURED\n" : "")
.addSource(rs.get("generic.glsl"))

4
src/Magnum/Shaders/Vector.cpp

@ -50,8 +50,8 @@ template<UnsignedInt dimensions> Vector<dimensions>::Vector(): transformationPro
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
vert.addSource(rs.get("generic.glsl"))
.addSource(rs.get(vertexShaderName<dimensions>()));

4
src/Magnum/Shaders/VertexColor.cpp

@ -50,8 +50,8 @@ template<UnsignedInt dimensions> VertexColor<dimensions>::VertexColor(): transfo
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment);
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment);
vert.addSource(rs.get("generic.glsl"))
.addSource(rs.get(vertexShaderName<dimensions>()));

4
src/Magnum/TextureTools/DistanceField.cpp

@ -85,8 +85,8 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
const Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Shaders::Implementation::createCompatibilityShader(v, Shader::Type::Vertex);
Shader frag = Shaders::Implementation::createCompatibilityShader(v, Shader::Type::Fragment);
Shader vert = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Vertex);
Shader frag = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Fragment);
vert.addSource(rs.get("FullScreenTriangle.glsl"))
.addSource(rs.get("DistanceFieldShader.vert"));

Loading…
Cancel
Save