Results 1 to 2 of 2

Thread: readPixels returning undefined

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    1

    readPixels returning undefined

    Both:

    var pixel = gl.readPixels(1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE);

    and:

    var pixel;
    gl.readPixels(1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, pixel);

    evaluate pixel to "undefined"

    I am trying to implement color-based picking. This occurs on both Webkit Nightly and Chrome.

    Anyone got any information on this? Or if I need to use it differently?

  2. #2
    Junior Member
    Join Date
    Apr 2011
    Posts
    3

    Re: readPixels returning undefined

    pixel needs to be an allocated array-object:
    Code :
    var pixel = new Uint8Array(4);
    that should work

Similar Threads

  1. get_global_id is undefined
    By mtpurger in forum OpenCL
    Replies: 4
    Last Post: 04-13-2013, 08:59 AM
  2. Getting undefined reference Errors
    By moulir in forum OpenCL
    Replies: 1
    Last Post: 05-07-2012, 11:38 PM

Posting Permissions

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