MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / check_texture

Function check_texture

tests/mesh/test-texture-manager.cpp:66–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void check_texture(
67 geode::AttributeManager& attributes, geode::TextureStorage2D& storage )
68{
69 const geode::TextureManager2D manager{ attributes, storage };
70 const auto& texture = manager.find_texture( "texture" );
71 for( const auto i : geode::Range{ 42 } )
72 {
73 const geode::Point2D coord{ { i * 2., i * 3. } };
74 geode::OpenGeodeMeshException::test(
75 texture.texture_coordinates( { i, 0 } ) == coord,
76 "Wrong texture coordinates" );
77 }
78 const auto& image = texture.image();
79 for( const auto i : geode::LRange{ 100 } )
80 {
81 const geode::RGBColor color{ i, i, i };
82 geode::OpenGeodeMeshException::test(
83 image.color( i ) == color, "Wrong color image" );
84 }
85}
86
87void save( const geode::TextureStorage2D& storage, std::string_view filename )
88{

Callers 1

testFunction · 0.85

Calls 1

testFunction · 0.70

Tested by

no test coverage detected