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

Function load

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

Source from the content-addressed store, hash-verified

100}
101
102geode::TextureStorage2D load( std::string_view filename )
103{
104 std::ifstream file{ geode::to_string( filename ), std::ifstream::binary };
105 geode::TContext context{};
106 geode::register_basic_deserialize_pcontext( std::get< 0 >( context ) );
107 geode::register_geometry_deserialize_pcontext( std::get< 0 >( context ) );
108 geode::register_image_deserialize_pcontext( std::get< 0 >( context ) );
109 geode::register_mesh_deserialize_pcontext( std::get< 0 >( context ) );
110 geode::Deserializer archive{ context, file };
111 geode::TextureStorage2D storage;
112 archive.object( storage );
113 const auto& adapter = archive.adapter();
114 geode::OpenGeodeMeshException::test(
115 adapter.error() == bitsery::ReaderError::NoError
116 && adapter.isCompletedSuccessfully()
117 && std::get< 1 >( context ).isValid(),
118 "[Bitsery::read] Error while reading file: ", filename );
119 return storage;
120}
121
122void test()
123{

Callers 1

testFunction · 0.85

Calls 7

to_stringFunction · 0.85
testFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected