Skip to content

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

Open
TP-repo wants to merge 1 commit into
BlazorExtensions:masterfrom
TP-repo:master
Open

Fixed missing "border" parameter in TexImage2D & TexImage2DAsync (WebGLContext)#60
TP-repo wants to merge 1 commit into
BlazorExtensions:masterfrom
TP-repo:master

Conversation

@TP-repo

@TP-repo TP-repo commented Mar 7, 2020

Copy link
Copy Markdown

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

2ndwolf commented Apr 2, 2020

Copy link
Copy Markdown

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
Copy Markdown

could someone please merge this already?

@jefflomax

Copy link
Copy Markdown

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
Copy Markdown

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