| 64 | } |
| 65 | |
| 66 | void 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 | |
| 87 | void save( const geode::TextureStorage2D& storage, std::string_view filename ) |
| 88 | { |