Fix texture loading

This commit is contained in:
2024-01-24 05:39:47 -05:00
parent a188a963df
commit 34ea4deb3d

View File

@@ -36,12 +36,12 @@ namespace fgl::engine
std::vector< unsigned char > data {};
data.resize( x * y * channels );
std::memcpy( data.data(), data_c, x * y * channels );
data.resize( x * y * 4 );
std::memcpy( data.data(), data_c, x * y * 4 );
stbi_image_free( data_c );
return { std::move( data ), x, y, channels };
return { std::move( data ), x, y, 4 };
}
Texture Texture::loadFromFile( const std::filesystem::path& path )