Canvas icon indicating copy to clipboard operation
Canvas copied to clipboard

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

Open MrTP opened this issue 5 years ago • 4 comments

Fixes Issue https://github.com/BlazorExtensions/Canvas/issues/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.

MrTP avatar Mar 07 '20 17:03 MrTP

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.

2ndwolf avatar Apr 02 '20 03:04 2ndwolf

could someone please merge this already?

thomas-mathers avatar Jun 09 '20 17:06 thomas-mathers

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.

jefflomax avatar May 23 '21 01:05 jefflomax

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.

BenMakesGames avatar Aug 09 '21 14:08 BenMakesGames