Browse Source

Shaders: minor tweaks.

Non-matching number of opening and closing braces confused editors with
code folding feature.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
127910d537
  1. 10
      src/Shaders/DistanceFieldVectorShader.cpp
  2. 10
      src/Shaders/FlatShader.cpp
  3. 10
      src/Shaders/PhongShader.cpp
  4. 10
      src/Shaders/VectorShader.cpp
  5. 10
      src/Shaders/VertexColorShader.cpp

10
src/Shaders/DistanceFieldVectorShader.cpp

@ -59,10 +59,11 @@ template<UnsignedInt dimensions> DistanceFieldVectorShader<dimensions>::Distance
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() || if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() ||
Context::current()->version() == Version::GL210) { Context::current()->version() == Version::GL210)
#else #else
if(!Context::current()->isVersionSupported(Version::GLES300)) { if(!Context::current()->isVersionSupported(Version::GLES300))
#endif #endif
{
AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::Position::Location, "position"); AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::Position::Location, "position");
AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::TextureCoordinates::Location, "textureCoordinates"); AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::TextureCoordinates::Location, "textureCoordinates");
} }
@ -70,10 +71,9 @@ template<UnsignedInt dimensions> DistanceFieldVectorShader<dimensions>::Distance
AbstractShaderProgram::link(); AbstractShaderProgram::link();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) { if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
{
#endif #endif
{
transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix"); transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix");
colorUniform = AbstractShaderProgram::uniformLocation("color"); colorUniform = AbstractShaderProgram::uniformLocation("color");
outlineColorUniform = AbstractShaderProgram::uniformLocation("outlineColor"); outlineColorUniform = AbstractShaderProgram::uniformLocation("outlineColor");

10
src/Shaders/FlatShader.cpp

@ -58,20 +58,20 @@ template<UnsignedInt dimensions> FlatShader<dimensions>::FlatShader(): transform
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() || if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() ||
Context::current()->version() == Version::GL210) { Context::current()->version() == Version::GL210)
#else #else
if(!Context::current()->isVersionSupported(Version::GLES300)) { if(!Context::current()->isVersionSupported(Version::GLES300))
#endif #endif
{
bindAttributeLocation(Position::Location, "position"); bindAttributeLocation(Position::Location, "position");
} }
link(); link();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) { if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
{
#endif #endif
{
transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix"); transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix");
colorUniform = uniformLocation("color"); colorUniform = uniformLocation("color");
} }

10
src/Shaders/PhongShader.cpp

@ -52,10 +52,11 @@ PhongShader::PhongShader(): transformationMatrixUniform(0), projectionMatrixUnif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() || if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() ||
Context::current()->version() == Version::GL210) { Context::current()->version() == Version::GL210)
#else #else
if(!Context::current()->isVersionSupported(Version::GLES300)) { if(!Context::current()->isVersionSupported(Version::GLES300))
#endif #endif
{
bindAttributeLocation(Position::Location, "position"); bindAttributeLocation(Position::Location, "position");
bindAttributeLocation(Normal::Location, "normal"); bindAttributeLocation(Normal::Location, "normal");
} }
@ -63,10 +64,9 @@ PhongShader::PhongShader(): transformationMatrixUniform(0), projectionMatrixUnif
link(); link();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) { if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
{
#endif #endif
{
transformationMatrixUniform = uniformLocation("transformationMatrix"); transformationMatrixUniform = uniformLocation("transformationMatrix");
projectionMatrixUniform = uniformLocation("projectionMatrix"); projectionMatrixUniform = uniformLocation("projectionMatrix");
normalMatrixUniform = uniformLocation("normalMatrix"); normalMatrixUniform = uniformLocation("normalMatrix");

10
src/Shaders/VectorShader.cpp

@ -59,10 +59,11 @@ template<UnsignedInt dimensions> VectorShader<dimensions>::VectorShader(): trans
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() || if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() ||
Context::current()->version() == Version::GL210) { Context::current()->version() == Version::GL210)
#else #else
if(!Context::current()->isVersionSupported(Version::GLES300)) { if(!Context::current()->isVersionSupported(Version::GLES300))
#endif #endif
{
AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::Position::Location, "position"); AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::Position::Location, "position");
AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::TextureCoordinates::Location, "textureCoordinates"); AbstractShaderProgram::bindAttributeLocation(AbstractVectorShader<dimensions>::TextureCoordinates::Location, "textureCoordinates");
} }
@ -70,10 +71,9 @@ template<UnsignedInt dimensions> VectorShader<dimensions>::VectorShader(): trans
AbstractShaderProgram::link(); AbstractShaderProgram::link();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) { if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
{
#endif #endif
{
transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix"); transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix");
colorUniform = AbstractShaderProgram::uniformLocation("color"); colorUniform = AbstractShaderProgram::uniformLocation("color");
} }

10
src/Shaders/VertexColorShader.cpp

@ -58,10 +58,11 @@ template<UnsignedInt dimensions> VertexColorShader<dimensions>::VertexColorShade
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() || if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>() ||
Context::current()->version() == Version::GL210) { Context::current()->version() == Version::GL210)
#else #else
if(!Context::current()->isVersionSupported(Version::GLES300)) { if(!Context::current()->isVersionSupported(Version::GLES300))
#endif #endif
{
bindAttributeLocation(Position::Location, "position"); bindAttributeLocation(Position::Location, "position");
bindAttributeLocation(Color::Location, "color"); bindAttributeLocation(Color::Location, "color");
} }
@ -69,10 +70,9 @@ template<UnsignedInt dimensions> VertexColorShader<dimensions>::VertexColorShade
link(); link();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) { if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
{
#endif #endif
{
transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix"); transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix");
} }
} }

Loading…
Cancel
Save