• @Gordon looking at converting the callback to a graphics array then. If I switch the callback to be a buffer array, when I debug out the contents of the buffer, I have an array as follows:

    [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2­,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1­,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1­,1,1,1,1]
    

    If I format this a little, you'll see it is meant to print out an E with the E in red, and the background yellow:

    [
    1,1,1,1,1,1,1,1,
    1,1,1,1,1,1,1,1,
    1,1,2,2,2,2,2,2,
    1,1,1,1,1,1,1,1,
    1,1,1,1,1,1,1,1,
    1,1,2,2,2,2,2,2,
    1,1,1,1,1,1,1,1,
    1,1,1,1,1,1,1,1
    ]
    

    So, if I look at what was previously being sent down the line, it needs an array with the buffer:

    [0,0,255,0,255,252,255,0,255,0,255,252,2­55,0,255,0,255]
    

    Which should be the buffer of:

    new Uint16Array([65280,65280,65532,65280,652­80,65532,65280,65280])
    

    But with an extra 0 in position 0.

    Converting the Uint16 array to binary, we can see that it is:

    1111111100000000
    1111111100000000 
    1111111111111100 
    1111111100000000 
    1111111100000000 
    1111111111111100 
    1111111100000000 
    1111111100000000 
    

    (Not sure whether the E being backwards is something I've done, or just the way it is, but I'll figure that bit out later).

    So, should I loop through the buffer array and construct a Uint16Array (handling each entry one at a time, kinda like the drawPixel method currently but all in one go at the point of render) and then do what I'm currently doing to create the array buffer with the extra 0 at position 0 with the code:

    var tmp = new Uint8Array(17);
    tmp.set(new Uint8Array(displaybuffer.buffer), 1);
    

    With all of this though, I'm not sure where the interleaved colour handling you were talking about in buffer array comes into play as I can't see it? Am I missing something there?

    Matt

About