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

Inconsistency between texImage2D variants #293

Open
Azq2 opened this issue Jul 29, 2024 · 0 comments
Open

Inconsistency between texImage2D variants #293

Azq2 opened this issue Jul 29, 2024 · 0 comments

Comments

@Azq2
Copy link

Azq2 commented Jul 29, 2024

  1. texImage2D(target, level, internalformat, width, height, border, format, type, pixels) wants pixels as UInt8Array.
  2. texImage2D(target, level, internalformat, format, type, pixels) wants pixels as ImageData.

For example:

gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, image.width, image.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, image.data);

I think the second variant of texImage2D should accept ImageData too.

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

No branches or pull requests

1 participant