Results 1 to 2 of 2

Thread: image.onload - returns 1282 glError

  1. #1

    image.onload - returns 1282 glError

    Hi All,
    Im trying to load a texture with below function, but Im sometimes getting:
    - in minefield glError (alert in the code) error 1282. Mostly when I refresh the page
    - in chrome error 1281: Only when I go to my page from another page. If I refresh or if I open the same link which is already opened (the same page) I get 0.

    In most cases Im getting 0, but why I get sometimes 1282 or 1281? I can think that the problem can be somewhere else, but it is difficult to find where.

    Code :
    function loadTexture(src) {
        // Create and initialize the WebGLTexture object.
        var DEMtexture = gl.createTexture();
        DEMtexture.image = new Image();
     
        DEMtexture.image.onload = function() {
            alert(gl.getError());
            gl.bindTexture(gl.TEXTURE_2D, DEMtexture);
            gl.texImage2D(gl.TEXTURE_2D, 0, DEMtexture.image, true);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
            gl.bindTexture(gl.TEXTURE_2D, null);
     
        };
        // Start downloading the image by setting its source.
        DEMtexture.image.src = src;
        // Return the WebGLTexture object 
        return DEMtexture;
    }

  2. #2

    Re: image.onload - returns 1282 glError

    -solved-
    problem was in some other code

Similar Threads

  1. glLineWidth(0) set glError to GL_INVALID_VALUE
    By Tryumk in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 2
    Last Post: 02-15-2010, 09:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •