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

Fixed missing "border" parameter in TexImage2D & TexImage2DAsync (WebGLContext) #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrTP
Copy link

@MrTP MrTP commented Mar 7, 2020

Fixes Issue #50
The current implementation of texImage2D throws an exception on call because its missing the "border" parameter.
Since border is specified to always be 0 it could be set by default but I did not want to deviate from the parameter count used in standard WebGL.

@2ndwolf
Copy link

2ndwolf commented Apr 2, 2020

I'm getting
WASM: Microsoft.JSInterop.JSException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': parameter 9 is not of type 'ArrayBufferView'.

Now from using your branch, even though I'm using byte[] in parameter 9. Tried float[] but it gives me a webgl error instead.

Using an int[] instead of byte and changing line 94 of CanvasContextManager.ts to returning an Uint8Array solved it. But using an int takes up memory. Trying to make the typescript file output an ArrayBufferView but haven't succeded yet.

@thomas-mathers
Copy link

could someone please merge this already?

@jefflomax
Copy link

2ndwolf : In my case, I was using a byte[] for the data, which was passed as a string to CompanyContextManager.ts deserialize. I added else if (typeof (object) === "string" &&
(method === "bufferData" || method === "bufferSubData" || method === "texImage2D")) {
and that got past that issue, still working thru other rendering setup.

@BenMakesGames
Copy link

I'm experiencing the same issue as @2ndwolf. I would also really like this missing parameter issue sorted, but I think more work is needed than what's in this PR.

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.

5 participants