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

8 is not a valid argument count for any overload. #106

Open
nurbat opened this issue Mar 9, 2021 · 3 comments
Open

8 is not a valid argument count for any overload. #106

nurbat opened this issue Mar 9, 2021 · 3 comments

Comments

@nurbat
Copy link

nurbat commented Mar 9, 2021

изображение

изображение

@JacobClinton
Copy link

JacobClinton commented Apr 12, 2021

I'm pretty sure TexImage2DAsync is currently not functional. At least, if it is, I haven't been able to figure out how to use it. The only workaround I could find was to create and call a js function that gets the canvas and runs texImage2D.

function addTextureToCanvas(imgId) {
    canvas = document.getElementsByTagName("canvas");
    var gl = canvas[0].getContext("webgl");

    var image = document.getElementById(imgId);
    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
    //gl.generateMipmap(gl.TEXTURE_2D);
}

I hope that helps.

@nurbat
Copy link
Author

nurbat commented Apr 12, 2021

it is no longer relevant, but thanks to your sources.. I was able to write an image generation based on byte []
await _context.DrawImageAsync(imagePngBytes, ImageFormat.PNG, OffsetX, OffSetY, (int)maxX, (int)maxY);

@erictuvesson
Copy link

The border is missing, more information here.

Duplicate Issues

Sample

await context.TexImage2DAsync(Texture2DType.TEXTURE_2D, 0, PixelFormat.RGBA, data.Width, data.Height, PixelFormat.RGBA, PixelType.UNSIGNED_BYTE, data.Pixels);
glpMipmapViewer.prototype.texImage2D = function(original, args) {
  if (!this.textureExists(this.activeTexture)) {
    return;
  }

  if(args.length == 9 && args[8] == this.mipmapPixels && args[1] == this.currentLevel) {
    return;
  }
  // figure out which function type it's using
  var textureObj = this.textureUsage[this.activeTexture.__uuid];
  var level = args[1];
  if (args.length == 6) {
    textureObj.imageLevels.splice(level, 0, {
      functionType : this.texImage2DFcnType.TEX_IMAGE_2D_6,
      arguments : args });
  } else if (args.length == 9) {
    textureObj.imageLevels.splice(level, 0, {
      functionType : this.texImage2DFcnType.TEX_IMAGE_2D_9,
      arguments : args });
  } else {
    console.error("texImage2D function args is not valid");
    return;
  }

  textureObj.fcnUsages.push( { fcn : original, args: args } );
}

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

3 participants