Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image#setMultiSample incorrectly throws exceptions #2250

Closed
codex128 opened this issue May 2, 2024 · 0 comments · Fixed by #2251
Closed

Image#setMultiSample incorrectly throws exceptions #2250

codex128 opened this issue May 2, 2024 · 0 comments · Fixed by #2251
Assignees
Labels
defect Something that is supposed to work, but doesn't. Less severe than a "bug"

Comments

@codex128
Copy link
Contributor

codex128 commented May 2, 2024

/**
* @param multiSamples Set the number of samples to use for this image,
* setting this to a value higher than 1 turns this image/texture
* into a multisample texture (on OpenGL3.1 and higher).
*/
public void setMultiSamples(int multiSamples) {
if (multiSamples <= 0)
throw new IllegalArgumentException("multiSamples must be > 0");
if (getData(0) != null)
throw new IllegalArgumentException("Cannot upload data as multisample texture");
if (hasMipmaps())
throw new IllegalArgumentException("Multisample textures do not support mipmaps");
this.multiSamples = multiSamples;
}

If the argument is 1, that is supposed to make the image not multisampled according to the documentation, but exceptions can still be thrown as if the image was multisampled.

@stephengold stephengold self-assigned this May 4, 2024
stephengold added a commit that referenced this issue May 4, 2024
stephengold added a commit that referenced this issue May 4, 2024
@stephengold stephengold added the defect Something that is supposed to work, but doesn't. Less severe than a "bug" label May 4, 2024
stephengold added a commit that referenced this issue May 6, 2024
stephengold added a commit that referenced this issue May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something that is supposed to work, but doesn't. Less severe than a "bug"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants