Skip to content

Conversation

@RunDevelopment
Copy link
Collaborator

This PR makes the Encoder API easier to use with 2 changes:

  • Automatic mipmap generation is now enabled by default. (breaking change)
  • Encoder::new_image is a new factory method to create an encoder for an image without going through the Header API.

Together, the most common use case (saving a single DDS image with optional mipmaps) has become 3 lines of code:

let mut encoder = Encoder::new_image(writer, image.size, format, mipmaps)?;
encoder.write_surface(image)?;
encoder.finish()?;

This also makes it easier to teach how to use the Encoder API. I can do more progressive disclosure, since the common case no longer involves manually creating a Header and automatic mipmap generation just does the right thing by default. If users need more control, they can dive deeper into the API at their own pace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant