예제 #1
0
 public void HandleLoadedTexture(HTMLImageElement image)
 {
     gl.PixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
     gl.BindTexture(gl.TEXTURE_2D, this.texture);
     gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
     gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
     gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
     gl.GenerateMipmap(gl.TEXTURE_2D);
     gl.BindTexture(gl.TEXTURE_2D, null);
 }