@ -31,6 +31,7 @@
# include <Corrade/Utility/DebugStl.h>
# include <Corrade/Utility/DebugStl.h>
# include <Corrade/Utility/String.h>
# include <Corrade/Utility/String.h>
# include "Magnum/Math/Color.h"
# include "Magnum/Math/Matrix3.h"
# include "Magnum/Math/Matrix3.h"
# include "Magnum/Trade/MaterialData.h"
# include "Magnum/Trade/MaterialData.h"
# include "Magnum/Trade/PhongMaterialData.h"
# include "Magnum/Trade/PhongMaterialData.h"
@ -73,6 +74,7 @@ class MaterialDataTest: public TestSuite::Tester {
void constructCopy ( ) ;
void constructCopy ( ) ;
void constructMove ( ) ;
void constructMove ( ) ;
void access ( ) ;
void accessOptional ( ) ;
void accessOptional ( ) ;
void accessOutOfBounds ( ) ;
void accessOutOfBounds ( ) ;
void accessInvalidAttributeName ( ) ;
void accessInvalidAttributeName ( ) ;
@ -81,29 +83,38 @@ class MaterialDataTest: public TestSuite::Tester {
void release ( ) ;
void release ( ) ;
void constructPhong ( ) ;
# ifdef MAGNUM_BUILD_DEPRECATED
void constructPhongTextur ed ( ) ;
void constructPhongDeprecat ed ( ) ;
void constructPhongTexturedTextureTransform ( ) ;
void constructPhongDeprecatedTextured ( ) ;
void constructPhongTexturedCoordinates ( ) ;
void constructPhongDeprecatedTexturedTextureTransform ( ) ;
void constructPhongTextureTransformNoTextur es ( ) ;
void constructPhongDeprecatedTexturedCoordinat es ( ) ;
void constructPhongNoTextureTransformationFlag ( ) ;
void constructPhongDeprecatedTextureTransformNoTextures ( ) ;
void constructPhongNoTextureCoordinates Flag ( ) ;
void constructPhongDeprecatedNoTextureTransformation Flag ( ) ;
void constructPhongCopy ( ) ;
void constructPhongDeprecatedNoTextureCoordinatesFlag ( ) ;
void constructPhongMove ( ) ;
# endif
void accessInvalidTextures ( ) ;
void phongAccess ( ) ;
void phongAccessDefaults ( ) ;
void phongAccessTextured ( ) ;
void phongAccessTexturedDefaults ( ) ;
void phongAccessTexturedSingleMatrixCoordinates ( ) ;
void phongAccessInvalidTextures ( ) ;
void debugAttribute ( ) ;
void debugAttribute ( ) ;
void debugAttributeType ( ) ;
void debugAttributeType ( ) ;
void debugType ( ) ;
void debugType ( ) ;
void debugTypes ( ) ;
void debugTypes ( ) ;
# ifdef MAGNUM_BUILD_DEPRECATED
void debugFlag ( ) ;
void debugFlag ( ) ;
void debugFlags ( ) ;
void debugFlags ( ) ;
# endif
void debugAlphaMode ( ) ;
void debugAlphaMode ( ) ;
# ifdef MAGNUM_BUILD_DEPRECATED
void debugPhongFlag ( ) ;
void debugPhongFlag ( ) ;
void debugPhongFlags ( ) ;
void debugPhongFlags ( ) ;
# endif
} ;
} ;
MaterialDataTest : : MaterialDataTest ( ) {
MaterialDataTest : : MaterialDataTest ( ) {
@ -163,6 +174,7 @@ MaterialDataTest::MaterialDataTest() {
& MaterialDataTest : : constructCopy ,
& MaterialDataTest : : constructCopy ,
& MaterialDataTest : : constructMove ,
& MaterialDataTest : : constructMove ,
& MaterialDataTest : : access ,
& MaterialDataTest : : accessOptional ,
& MaterialDataTest : : accessOptional ,
& MaterialDataTest : : accessOutOfBounds ,
& MaterialDataTest : : accessOutOfBounds ,
& MaterialDataTest : : accessInvalidAttributeName ,
& MaterialDataTest : : accessInvalidAttributeName ,
@ -171,29 +183,39 @@ MaterialDataTest::MaterialDataTest() {
& MaterialDataTest : : release ,
& MaterialDataTest : : release ,
& MaterialDataTest : : constructPhong ,
# ifdef MAGNUM_BUILD_DEPRECATED
& MaterialDataTest : : constructPhongTextured ,
& MaterialDataTest : : constructPhongDeprecated ,
& MaterialDataTest : : constructPhongTexturedTextureTransform ,
& MaterialDataTest : : constructPhongDeprecatedTextured ,
& MaterialDataTest : : constructPhongTexturedCoordinates ,
& MaterialDataTest : : constructPhongDeprecatedTexturedTextureTransform ,
& MaterialDataTest : : constructPhongTextureTransformNoTextures ,
& MaterialDataTest : : constructPhongDeprecatedTexturedCoordinates ,
& MaterialDataTest : : constructPhongNoTextureTransformationFlag ,
& MaterialDataTest : : constructPhongDeprecatedTextureTransformNoTextures ,
& MaterialDataTest : : constructPhongNoTextureCoordinatesFlag ,
& MaterialDataTest : : constructPhongDeprecatedNoTextureTransformationFlag ,
& MaterialDataTest : : constructPhongCopy ,
& MaterialDataTest : : constructPhongDeprecatedNoTextureCoordinatesFlag ,
& MaterialDataTest : : constructPhongMove ,
# endif
& MaterialDataTest : : accessInvalidTextures ,
& MaterialDataTest : : phongAccess ,
& MaterialDataTest : : phongAccessDefaults ,
& MaterialDataTest : : phongAccessTextured ,
& MaterialDataTest : : phongAccessTexturedDefaults ,
& MaterialDataTest : : phongAccessTexturedSingleMatrixCoordinates ,
& MaterialDataTest : : phongAccessInvalidTextures ,
& MaterialDataTest : : debugAttribute ,
& MaterialDataTest : : debugAttribute ,
& MaterialDataTest : : debugAttributeType ,
& MaterialDataTest : : debugAttributeType ,
& MaterialDataTest : : debugType ,
& MaterialDataTest : : debugType ,
& MaterialDataTest : : debugTypes ,
& MaterialDataTest : : debugTypes ,
# ifdef MAGNUM_BUILD_DEPRECATED
& MaterialDataTest : : debugFlag ,
& MaterialDataTest : : debugFlag ,
& MaterialDataTest : : debugFlags ,
& MaterialDataTest : : debugFlags ,
# endif
& MaterialDataTest : : debugAlphaMode ,
& MaterialDataTest : : debugAlphaMode ,
# ifdef MAGNUM_BUILD_DEPRECATED
& MaterialDataTest : : debugPhongFlag ,
& MaterialDataTest : : debugPhongFlag ,
& MaterialDataTest : : debugPhongFlags } ) ;
& MaterialDataTest : : debugPhongFlags
# endif
} ) ;
}
}
using namespace Containers : : Literals ;
using namespace Containers : : Literals ;
@ -674,6 +696,32 @@ void MaterialDataTest::constructMove() {
CORRADE_VERIFY ( std : : is_nothrow_move_assignable < MaterialData > : : value ) ;
CORRADE_VERIFY ( std : : is_nothrow_move_assignable < MaterialData > : : value ) ;
}
}
void MaterialDataTest : : access ( ) {
MaterialData a { { } , {
{ MaterialAttribute : : DoubleSided , false } ,
{ MaterialAttribute : : AlphaBlend , true } ,
{ MaterialAttribute : : AlphaMask , 0.9f }
} } ;
CORRADE_VERIFY ( ! a . isDoubleSided ( ) ) ;
CORRADE_COMPARE ( a . alphaMode ( ) , MaterialAlphaMode : : Blend ) ;
CORRADE_COMPARE ( a . alphaMask ( ) , 0.9f ) ;
MaterialData b { { } , {
{ MaterialAttribute : : AlphaBlend , false } ,
{ MaterialAttribute : : AlphaMask , 0.3f }
} } ;
CORRADE_VERIFY ( ! b . isDoubleSided ( ) ) ;
CORRADE_COMPARE ( b . alphaMode ( ) , MaterialAlphaMode : : Mask ) ;
CORRADE_COMPARE ( b . alphaMask ( ) , 0.3f ) ;
MaterialData c { { } , {
{ MaterialAttribute : : DoubleSided , true } ,
} } ;
CORRADE_VERIFY ( c . isDoubleSided ( ) ) ;
CORRADE_COMPARE ( c . alphaMode ( ) , MaterialAlphaMode : : Opaque ) ;
CORRADE_COMPARE ( c . alphaMask ( ) , 0.5f ) ;
}
void MaterialDataTest : : accessOptional ( ) {
void MaterialDataTest : : accessOptional ( ) {
MaterialData data { { } , {
MaterialData data { { } , {
{ MaterialAttribute : : AlphaMask , 0.5f } ,
{ MaterialAttribute : : AlphaMask , 0.5f } ,
@ -835,18 +883,22 @@ void MaterialDataTest::release() {
CORRADE_COMPARE ( data . attributeCount ( ) , 0 ) ;
CORRADE_COMPARE ( data . attributeCount ( ) , 0 ) ;
}
}
void MaterialDataTest : : constructPhong ( ) {
# ifdef MAGNUM_BUILD_DEPRECATED
using namespace Math : : Literals ;
void MaterialDataTest : : constructPhongDeprecated ( ) {
const int a { } ;
const int a { } ;
PhongMaterialData data { { } ,
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData data { PhongMaterialData : : Flag : : DoubleSided ,
0xccffbb _rgbf , { } ,
0xccffbb _rgbf , { } ,
0xebefbf _rgbf , { } ,
0xebefbf _rgbf , { } ,
0xacabad _rgbf , { } , { } , { } ,
0xacabad _rgbf , { } , { } , { } ,
MaterialAlphaMode : : Mask , 0.3f , 80.0f , & a } ;
MaterialAlphaMode : : Mask , 0.3f , 80.0f , & a } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . types ( ) , MaterialType : : Phong ) ;
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flags { } ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : DoubleSided ) ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . ambientColor ( ) , 0xccffbb _rgbf ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0xccffbb _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xebefbf _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xebefbf _rgbf ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
@ -857,19 +909,22 @@ void MaterialDataTest::constructPhong() {
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
}
}
void MaterialDataTest : : constructPhongTextured ( ) {
void MaterialDataTest : : constructPhongDeprecatedTextured ( ) {
using namespace Math : : Literals ;
const int a { } ;
const int a { } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData data {
PhongMaterialData data {
PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture ,
PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture ,
0x111111 _rgbf , 42 ,
0x111111 _rgbf , 42 ,
0xeebbff _rgbf , { } ,
0xeebbff _rgbf , { } ,
0xacabad _rgbf , 17 , { } , { } ,
0xacabad _rgbf , 17 , { } , { } ,
MaterialAlphaMode : : Blend , 0.37f , 96.0f , & a } ;
MaterialAlphaMode : : Blend , 0.37f , 96.0f , & a } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . types ( ) , MaterialType : : Phong ) ;
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture ) ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 0 ) ;
@ -884,207 +939,290 @@ void MaterialDataTest::constructPhongTextured() {
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
}
}
void MaterialDataTest : : constructPhongTexturedTextureTransform ( ) {
void MaterialDataTest : : constructPhongDeprecatedTexturedTextureTransform ( ) {
using namespace Math : : Literals ;
const int a { } ;
const int a { } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData data {
PhongMaterialData data {
PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation ,
PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation ,
0x111111 _rgbf , { } ,
0x111111 _rgbf , { } ,
0xeebbff _rgbf , 42 ,
0xeebbff _rgbf , 42 ,
0xacabad _rgbf , { } , 17 ,
0xacabad _rgbf , { } , 17 ,
Matrix3 : : rotation ( 90.0 _degf ) ,
Matrix3 : : rotation ( 90.0 _degf ) ,
MaterialAlphaMode : : Opaque , 0.5f , 96.0f , & a } ;
MaterialAlphaMode : : Mask , 0.5f , 96.0f , & a } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . types ( ) , MaterialType : : Phong ) ;
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation ) ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( data . diffuseTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . diffuseTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . normalTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . normalTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 : : rotation ( 90.0 _degf ) ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 : : rotation ( 90.0 _degf ) ) ;
CORRADE_COMPARE ( data . alphaMode ( ) , MaterialAlphaMode : : Opaque ) ;
CORRADE_COMPARE ( data . alphaMode ( ) , MaterialAlphaMode : : Mask ) ;
CORRADE_COMPARE ( data . alphaMask ( ) , 0.5f ) ;
CORRADE_COMPARE ( data . alphaMask ( ) , 0.5f ) ;
CORRADE_COMPARE ( data . shininess ( ) , 96.0f ) ;
CORRADE_COMPARE ( data . shininess ( ) , 96.0f ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
}
}
void MaterialDataTest : : constructPhongTexturedCoordinates ( ) {
void MaterialDataTest : : constructPhongDeprecatedTexturedCoordinates ( ) {
using namespace Math : : Literals ;
const int a { } ;
const int a { } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData data {
PhongMaterialData data {
PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : TextureCoordinates ,
PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : Normal Texture | PhongMaterialData : : Flag : : TextureCoordinates ,
0x111111 _rgbf , 42 , 3 ,
0x111111 _rgbf , 42 , 3 ,
0xeebbff _rgbf , { } , 0 ,
0xeebbff _rgbf , { } , 6 ,
0xacabad _rgbf , 17 , 1 ,
0xacabad _rgbf , 17 , 1 ,
{ } , 0 , { } ,
0 , 8 , { } ,
MaterialAlphaMode : : Blend , 0.37f , 96.0f , & a } ;
MaterialAlphaMode : : Blend , 0.37f , 96.0f , & a } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . types ( ) , MaterialType : : Phong ) ;
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : TextureCoordinates ) ;
CORRADE_COMPARE ( data . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureCoordinates ) ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 3 ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 3 ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( data . diffuseTextureCoordinates ( ) , 6 ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . specularTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . specularTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . specularTextureCoordinates ( ) , 1 ) ;
CORRADE_COMPARE ( data . specularTextureCoordinates ( ) , 1 ) ;
CORRADE_COMPARE ( data . normalTexture ( ) , 0 ) ;
CORRADE_COMPARE ( data . normalTextureCoordinates ( ) , 8 ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 3 ) ;
CORRADE_COMPARE ( data . alphaMode ( ) , MaterialAlphaMode : : Blend ) ;
CORRADE_COMPARE ( data . alphaMode ( ) , MaterialAlphaMode : : Blend ) ;
CORRADE_COMPARE ( data . alphaMask ( ) , 0.37f ) ;
CORRADE_COMPARE ( data . alphaMask ( ) , 0.37f ) ;
CORRADE_COMPARE ( data . shininess ( ) , 96.0f ) ;
CORRADE_COMPARE ( data . shininess ( ) , 96.0f ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
CORRADE_COMPARE ( data . importerState ( ) , & a ) ;
}
}
void MaterialDataTest : : constructPhongTextureTransformNoTextures ( ) {
void MaterialDataTest : : constructPhongDeprecated TextureTransformNoTextures ( ) {
# ifdef CORRADE_NO_ASSERT
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
# endif
std : : ostringstream out ;
std : : ostringstream out ;
Error redirectError { & out } ;
Error redirectError { & out } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData a { PhongMaterialData : : Flag : : TextureTransformation ,
PhongMaterialData a { PhongMaterialData : : Flag : : TextureTransformation ,
{ } , { } ,
{ } , { } ,
{ } , { } ,
{ } , { } ,
{ } , { } , { } , { } ,
{ } , { } , { } , { } ,
{ } , 0.5f , 80.0f } ;
{ } , 0.5f , 80.0f } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
" Trade::PhongMaterialData: texture transformation enabled but the material has no textures \n " ) ;
" Trade::PhongMaterialData: texture transformation enabled but the material has no textures \n " ) ;
}
}
void MaterialDataTest : : constructPhongNoTextureTransformationFlag ( ) {
void MaterialDataTest : : constructPhongDeprecated NoTextureTransformationFlag ( ) {
# ifdef CORRADE_NO_ASSERT
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
# endif
std : : ostringstream out ;
std : : ostringstream out ;
Error redirectError { & out } ;
Error redirectError { & out } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData a { { } ,
PhongMaterialData a { { } ,
{ } , { } ,
{ } , { } ,
{ } , { } ,
{ } , { } ,
{ } , { } , { } , Matrix3 : : rotation ( 90.0 _degf ) ,
{ } , { } , { } , Matrix3 : : rotation ( 90.0 _degf ) ,
{ } , 0.5f , 80.0f } ;
{ } , 0.5f , 80.0f } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
" PhongMaterialData::PhongMaterialData: non-default texture matrix requires Flag::TextureTransformation to be enabled \n " ) ;
" PhongMaterialData::PhongMaterialData: non-default texture matrix requires Flag::TextureTransformation to be enabled \n " ) ;
}
}
void MaterialDataTest : : constructPhongNoTextureCoordinatesFlag ( ) {
void MaterialDataTest : : constructPhongDeprecated NoTextureCoordinatesFlag ( ) {
# ifdef CORRADE_NO_ASSERT
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
# endif
std : : ostringstream out ;
std : : ostringstream out ;
Error redirectError { & out } ;
Error redirectError { & out } ;
CORRADE_IGNORE_DEPRECATED_PUSH
PhongMaterialData a { { } ,
PhongMaterialData a { { } ,
{ } , { } , 1 ,
{ } , { } , 1 ,
{ } , { } , 2 ,
{ } , { } , 2 ,
{ } , { } , 3 , { } , 4 , { } ,
{ } , { } , 3 , { } , 4 , { } ,
{ } , 0.5f , 80.0f } ;
{ } , 0.5f , 80.0f } ;
CORRADE_IGNORE_DEPRECATED_POP
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
" PhongMaterialData::PhongMaterialData: non-zero texture coordinate sets require Flag::TextureCoordinates to be enabled \n " ) ;
" PhongMaterialData::PhongMaterialData: non-zero texture coordinate sets require Flag::TextureCoordinates to be enabled \n " ) ;
}
}
# endif
void MaterialDataTest : : phongAccess ( ) {
MaterialData base { MaterialType : : Phong , {
{ MaterialAttribute : : AmbientColor , 0xccffbbff _rgbaf } ,
{ MaterialAttribute : : DiffuseColor , 0xebefbfff _rgbaf } ,
{ MaterialAttribute : : SpecularColor , 0xacabadff _rgbaf } ,
{ MaterialAttribute : : Shininess , 96.0f }
} } ;
CORRADE_COMPARE ( base . types ( ) , MaterialType : : Phong ) ;
const PhongMaterialData & data = static_cast < const PhongMaterialData & > ( base ) ;
void MaterialDataTest : : constructPhongCopy ( ) {
CORRADE_VERIFY ( ! data . hasTextureTransformation ( ) ) ;
CORRADE_VERIFY ( ! ( std : : is_constructible < AbstractMaterialData , const AbstractMaterialData & > { } ) ) ;
CORRADE_VERIFY ( ! data . hasTextureCoordinates ( ) ) ;
CORRADE_VERIFY ( ! ( std : : is_constructible < PhongMaterialData , const PhongMaterialData & > { } ) ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0xccffbb _rgbf ) ;
CORRADE_VERIFY ( ! ( std : : is_assignable < AbstractMaterialData , const AbstractMaterialData & > { } ) ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xebefbf _rgbf ) ;
CORRADE_VERIFY ( ! ( std : : is_assignable < PhongMaterialData , const PhongMaterialData & > { } ) ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . shininess ( ) , 96.0f ) ;
}
}
void MaterialDataTest : : constructPhongMove ( ) {
void MaterialDataTest : : phongAccessDefaults ( ) {
using namespace Math : : Literals ;
MaterialData base { { } , { } } ;
const int a { } ;
CORRADE_COMPARE ( base . types ( ) , MaterialTypes { } ) ;
PhongMaterialData data {
/* Casting is fine even if the type doesn't include Phong */
PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation | PhongMaterialData : : Flag : : TextureCoordinates ,
const PhongMaterialData & data = static_cast < const PhongMaterialData & > ( base ) ;
0x111111 _rgbf , 1 , 0 ,
0xeebbff _rgbf , 42 , 1 ,
CORRADE_VERIFY ( ! data . hasTextureTransformation ( ) ) ;
0xacabad _rgbf , 24 , 2 , 17 , 3 ,
CORRADE_VERIFY ( ! data . hasTextureCoordinates ( ) ) ;
Matrix3 : : rotation ( 90.0 _degf ) ,
CORRADE_COMPARE ( data . ambientColor ( ) , 0x000000 _rgbf ) ;
MaterialAlphaMode : : Blend , 0.55f , 13.0f , & a } ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xffffff _rgbf ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xffffff _rgbf ) ;
PhongMaterialData b { std : : move ( data ) } ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( b . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . textureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( b . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation | PhongMaterialData : : Flag : : TextureCoordinates ) ;
CORRADE_COMPARE ( data . shininess ( ) , 80.0f ) ;
CORRADE_COMPARE ( b . ambientColor ( ) , 0x111111 _rgbf ) ;
}
CORRADE_COMPARE ( b . ambientTexture ( ) , 1 ) ;
CORRADE_COMPARE ( b . ambientTextureCoordinates ( ) , 0 ) ;
void MaterialDataTest : : phongAccessTextured ( ) {
CORRADE_COMPARE ( b . diffuseColor ( ) , 0xeebbff _rgbf ) ;
PhongMaterialData data { { } , {
CORRADE_COMPARE ( b . diffuseTexture ( ) , 42 ) ;
{ MaterialAttribute : : AmbientColor , 0x111111ff _rgbaf } ,
CORRADE_COMPARE ( b . diffuseTextureCoordinates ( ) , 1 ) ;
{ MaterialAttribute : : AmbientTexture , 42u } ,
CORRADE_COMPARE ( b . specularColor ( ) , 0xacabad _rgbf ) ;
{ MaterialAttribute : : AmbientTextureMatrix , Matrix3 : : scaling ( { 0.5f , 1.0f } ) } ,
CORRADE_COMPARE ( b . specularTexture ( ) , 24 ) ;
{ MaterialAttribute : : AmbientTextureCoordinates , 2u } ,
CORRADE_COMPARE ( b . specularTextureCoordinates ( ) , 2 ) ;
{ MaterialAttribute : : DiffuseTexture , 33u } ,
CORRADE_COMPARE ( b . normalTexture ( ) , 17 ) ;
{ MaterialAttribute : : DiffuseColor , 0xeebbffff _rgbaf } ,
CORRADE_COMPARE ( b . normalTextureCoordinates ( ) , 3 ) ;
{ MaterialAttribute : : DiffuseTextureMatrix , Matrix3 : : scaling ( { 0.5f , 0.5f } ) } ,
CORRADE_COMPARE ( b . textureMatrix ( ) , Matrix3 : : rotation ( 90.0 _degf ) ) ;
{ MaterialAttribute : : DiffuseTextureCoordinates , 3u } ,
CORRADE_COMPARE ( b . alphaMode ( ) , MaterialAlphaMode : : Blend ) ;
{ MaterialAttribute : : SpecularColor , 0xacabadff _rgbaf } ,
CORRADE_COMPARE ( b . alphaMask ( ) , 0.55f ) ;
{ MaterialAttribute : : SpecularTexture , 17u } ,
CORRADE_COMPARE ( b . shininess ( ) , 13.0f ) ;
{ MaterialAttribute : : SpecularTextureMatrix , Matrix3 : : scaling ( { 1.0f , 1.0f } ) } ,
CORRADE_COMPARE ( b . importerState ( ) , & a ) ;
{ MaterialAttribute : : SpecularTextureCoordinates , 4u } ,
{ MaterialAttribute : : NormalTexture , 0u } ,
const int c { } ;
{ MaterialAttribute : : NormalTextureMatrix , Matrix3 : : scaling ( { 1.0f , 0.5f } ) } ,
PhongMaterialData d { { } ,
{ MaterialAttribute : : NormalTextureCoordinates , 5u }
0xccffbb _rgbf , { } ,
} } ;
0xebefbf _rgbf , { } ,
0xacabad _rgbf , { } , { } , { } ,
CORRADE_VERIFY ( data . hasTextureTransformation ( ) ) ;
MaterialAlphaMode : : Mask , 0.3f , 80.0f , & c } ;
CORRADE_VERIFY ( data . hasTextureCoordinates ( ) ) ;
d = std : : move ( b ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( d . type ( ) , MaterialType : : Phong ) ;
CORRADE_COMPARE ( data . ambientTextureMatrix ( ) , Matrix3 : : scaling ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( d . flags ( ) , PhongMaterialData : : Flag : : AmbientTexture | PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture | PhongMaterialData : : Flag : : NormalTexture | PhongMaterialData : : Flag : : TextureTransformation | PhongMaterialData : : Flag : : TextureCoordinates ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( d . ambientColor ( ) , 0x111111 _rgbf ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( d . ambientTexture ( ) , 1 ) ;
CORRADE_COMPARE ( data . diffuseTexture ( ) , 33 ) ;
CORRADE_COMPARE ( d . ambientTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . diffuseTextureMatrix ( ) , Matrix3 : : scaling ( { 0.5f , 0.5f } ) ) ;
CORRADE_COMPARE ( d . diffuseColor ( ) , 0xeebbff _rgbf ) ;
CORRADE_COMPARE ( data . diffuseTextureCoordinates ( ) , 3 ) ;
CORRADE_COMPARE ( d . diffuseTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( d . diffuseTextureCoordinates ( ) , 1 ) ;
CORRADE_COMPARE ( data . specularTexture ( ) , 17 ) ;
CORRADE_COMPARE ( d . specularColor ( ) , 0xacabad _rgbf ) ;
CORRADE_COMPARE ( data . specularTextureMatrix ( ) , Matrix3 : : scaling ( { 1.0f , 1.0f } ) ) ;
CORRADE_COMPARE ( d . specularTexture ( ) , 24 ) ;
CORRADE_COMPARE ( data . specularTextureCoordinates ( ) , 4 ) ;
CORRADE_COMPARE ( d . specularTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( data . normalTexture ( ) , 0 ) ;
CORRADE_COMPARE ( d . normalTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . normalTextureMatrix ( ) , Matrix3 : : scaling ( { 1.0f , 0.5f } ) ) ;
CORRADE_COMPARE ( d . normalTextureCoordinates ( ) , 3 ) ;
CORRADE_COMPARE ( data . normalTextureCoordinates ( ) , 5 ) ;
CORRADE_COMPARE ( d . textureMatrix ( ) , Matrix3 : : rotation ( 90.0 _degf ) ) ;
CORRADE_COMPARE ( d . alphaMode ( ) , MaterialAlphaMode : : Blend ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( d . alphaMask ( ) , 0.55f ) ;
CORRADE_COMPARE ( data . textureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( d . shininess ( ) , 13.0f ) ;
}
CORRADE_COMPARE ( d . importerState ( ) , & a ) ;
void MaterialDataTest : : phongAccessTexturedDefaults ( ) {
CORRADE_VERIFY ( std : : is_nothrow_move_constructible < PhongMaterialData > : : value ) ;
PhongMaterialData data { { } , {
CORRADE_VERIFY ( std : : is_nothrow_move_assignable < PhongMaterialData > : : value ) ;
{ MaterialAttribute : : AmbientTexture , 42u } ,
{ MaterialAttribute : : DiffuseTexture , 33u } ,
{ MaterialAttribute : : SpecularTexture , 17u } ,
{ MaterialAttribute : : NormalTexture , 1u }
} } ;
CORRADE_VERIFY ( ! data . hasTextureTransformation ( ) ) ;
CORRADE_VERIFY ( ! data . hasTextureCoordinates ( ) ) ;
CORRADE_COMPARE ( data . ambientColor ( ) , 0xffffffff _rgbaf ) ;
CORRADE_COMPARE ( data . ambientTexture ( ) , 42 ) ;
CORRADE_COMPARE ( data . ambientTextureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . diffuseColor ( ) , 0xffffffff _rgbaf ) ;
CORRADE_COMPARE ( data . diffuseTexture ( ) , 33 ) ;
CORRADE_COMPARE ( data . diffuseTextureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . diffuseTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . specularColor ( ) , 0xffffffff _rgbaf ) ;
CORRADE_COMPARE ( data . specularTexture ( ) , 17 ) ;
CORRADE_COMPARE ( data . specularTextureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . specularTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . normalTexture ( ) , 1 ) ;
CORRADE_COMPARE ( data . normalTextureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . normalTextureCoordinates ( ) , 0 ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 { } ) ;
CORRADE_COMPARE ( data . textureCoordinates ( ) , 0 ) ;
}
}
void MaterialDataTest : : accessInvalidTextures ( ) {
void MaterialDataTest : : phongAccessTexturedSingleMatrixCoordinates ( ) {
PhongMaterialData data { { } , {
{ MaterialAttribute : : AmbientTexture , 42u } ,
{ MaterialAttribute : : DiffuseTexture , 33u } ,
{ MaterialAttribute : : SpecularTexture , 17u } ,
{ MaterialAttribute : : NormalTexture , 0u } ,
{ MaterialAttribute : : TextureMatrix , Matrix3 : : translation ( { 0.5f , 1.0f } ) } ,
{ MaterialAttribute : : TextureCoordinates , 2u }
} } ;
CORRADE_VERIFY ( data . hasTextureTransformation ( ) ) ;
CORRADE_VERIFY ( data . hasTextureCoordinates ( ) ) ;
CORRADE_COMPARE ( data . ambientTextureMatrix ( ) , Matrix3 : : translation ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( data . ambientTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( data . diffuseTextureMatrix ( ) , Matrix3 : : translation ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( data . diffuseTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( data . specularTextureMatrix ( ) , Matrix3 : : translation ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( data . specularTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( data . normalTextureMatrix ( ) , Matrix3 : : translation ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( data . normalTextureCoordinates ( ) , 2 ) ;
CORRADE_COMPARE ( data . textureMatrix ( ) , Matrix3 : : translation ( { 0.5f , 1.0f } ) ) ;
CORRADE_COMPARE ( data . textureCoordinates ( ) , 2 ) ;
}
void MaterialDataTest : : phongAccessInvalidTextures ( ) {
# ifdef CORRADE_NO_ASSERT
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
# endif
PhongMaterialData a { { } ,
PhongMaterialData data { { } , { } } ;
{ } , { } ,
{ } , { } ,
{ } , { } , { } , { } ,
{ } , 0.5f , 80.0f } ;
std : : ostringstream out ;
std : : ostringstream out ;
Error redirectError { & out } ;
Error redirectError { & out } ;
a . ambientTexture ( ) ;
data . ambientTexture ( ) ;
a . ambientTextureCoordinates ( ) ;
data . ambientTextureMatrix ( ) ;
a . diffuseTexture ( ) ;
data . ambientTextureCoordinates ( ) ;
a . diffuseTextureCoordinates ( ) ;
data . diffuseTexture ( ) ;
a . specularTexture ( ) ;
data . diffuseTextureMatrix ( ) ;
a . specularTextureCoordinates ( ) ;
data . diffuseTextureCoordinates ( ) ;
a . normalTexture ( ) ;
data . specularTexture ( ) ;
a . normalTextureCoordinates ( ) ;
data . specularTextureMatrix ( ) ;
data . specularTextureCoordinates ( ) ;
data . normalTexture ( ) ;
data . normalTextureMatrix ( ) ;
data . normalTextureCoordinates ( ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
" Trade::PhongMaterialData::ambientTexture(): the material doesn't have an ambient texture \n "
" Trade::MaterialData::attribute(): attribute AmbientTexture not found \n "
" Trade::PhongMaterialData::ambientTextureMatrix(): the material doesn't have an ambient texture \n "
" Trade::PhongMaterialData::ambientTextureCoordinates(): the material doesn't have an ambient texture \n "
" Trade::PhongMaterialData::ambientTextureCoordinates(): the material doesn't have an ambient texture \n "
" Trade::PhongMaterialData::diffuseTexture(): the material doesn't have a diffuse texture \n "
" Trade::MaterialData::attribute(): attribute DiffuseTexture not found \n "
" Trade::PhongMaterialData::diffuseTextureMatrix(): the material doesn't have a diffuse texture \n "
" Trade::PhongMaterialData::diffuseTextureCoordinates(): the material doesn't have a diffuse texture \n "
" Trade::PhongMaterialData::diffuseTextureCoordinates(): the material doesn't have a diffuse texture \n "
" Trade::PhongMaterialData::specularTexture(): the material doesn't have a specular texture \n "
" Trade::MaterialData::attribute(): attribute SpecularTexture not found \n "
" Trade::PhongMaterialData::specularTextureMatrix(): the material doesn't have a specular texture \n "
" Trade::PhongMaterialData::specularTextureCoordinates(): the material doesn't have a specular texture \n "
" Trade::PhongMaterialData::specularTextureCoordinates(): the material doesn't have a specular texture \n "
" Trade::PhongMaterialData::normalTexture(): the material doesn't have a normal texture \n "
" Trade::MaterialData::attribute(): attribute NormalTexture not found \n "
" Trade::PhongMaterialData::normalTextureMatrix(): the material doesn't have a normal texture \n "
" Trade::PhongMaterialData::normalTextureCoordinates(): the material doesn't have a normal texture \n " ) ;
" Trade::PhongMaterialData::normalTextureCoordinates(): the material doesn't have a normal texture \n " ) ;
}
}
@ -1116,19 +1254,23 @@ void MaterialDataTest::debugTypes() {
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialType::Phong|Trade::MaterialType(0xe0) Trade::MaterialTypes{} \n " ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialType::Phong|Trade::MaterialType(0xe0) Trade::MaterialTypes{} \n " ) ;
}
}
# ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_IGNORE_DEPRECATED_PUSH
void MaterialDataTest : : debugFlag ( ) {
void MaterialDataTest : : debugFlag ( ) {
std : : ostringstream out ;
std : : ostringstream out ;
Debug { & out } < < Abstract MaterialData: : Flag : : DoubleSided < < Abstract MaterialData: : Flag ( 0xf0 ) ;
Debug { & out } < < MaterialData : : Flag : : DoubleSided < < MaterialData : : Flag ( 0xf0 ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::Abstract MaterialData::Flag::DoubleSided Trade::Abstract MaterialData::Flag(0xf0) \n " ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialData::Flag::DoubleSided Trade::MaterialData::Flag(0xf0) \n " ) ;
}
}
void MaterialDataTest : : debugFlags ( ) {
void MaterialDataTest : : debugFlags ( ) {
std : : ostringstream out ;
std : : ostringstream out ;
Debug { & out } < < Abstract MaterialData: : Flag : : DoubleSided < < Abstract MaterialData: : Flags { } ;
Debug { & out } < < MaterialData : : Flag : : DoubleSided < < MaterialData : : Flags { } ;
CORRADE_COMPARE ( out . str ( ) , " Trade::Abstract MaterialData::Flag::DoubleSided Trade::Abstract MaterialData::Flags{} \n " ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialData::Flag::DoubleSided Trade::MaterialData::Flags{} \n " ) ;
}
}
CORRADE_IGNORE_DEPRECATED_POP
# endif
void MaterialDataTest : : debugAlphaMode ( ) {
void MaterialDataTest : : debugAlphaMode ( ) {
std : : ostringstream out ;
std : : ostringstream out ;
@ -1137,6 +1279,8 @@ void MaterialDataTest::debugAlphaMode() {
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialAlphaMode::Opaque Trade::MaterialAlphaMode(0xee) \n " ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::MaterialAlphaMode::Opaque Trade::MaterialAlphaMode(0xee) \n " ) ;
}
}
# ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_IGNORE_DEPRECATED_PUSH
void MaterialDataTest : : debugPhongFlag ( ) {
void MaterialDataTest : : debugPhongFlag ( ) {
std : : ostringstream out ;
std : : ostringstream out ;
@ -1150,6 +1294,8 @@ void MaterialDataTest::debugPhongFlags() {
Debug { & out } < < ( PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture ) < < PhongMaterialData : : Flags { } ;
Debug { & out } < < ( PhongMaterialData : : Flag : : DiffuseTexture | PhongMaterialData : : Flag : : SpecularTexture ) < < PhongMaterialData : : Flags { } ;
CORRADE_COMPARE ( out . str ( ) , " Trade::PhongMaterialData::Flag::DiffuseTexture|Trade::PhongMaterialData::Flag::SpecularTexture Trade::PhongMaterialData::Flags{} \n " ) ;
CORRADE_COMPARE ( out . str ( ) , " Trade::PhongMaterialData::Flag::DiffuseTexture|Trade::PhongMaterialData::Flag::SpecularTexture Trade::PhongMaterialData::Flags{} \n " ) ;
}
}
CORRADE_IGNORE_DEPRECATED_POP
# endif
} } } }
} } } }