[Public WebGL] readPixels overloads?

Boris Zbarsky [email protected]
Fri Apr 20 20:12:41 PDT 2012


Thinking about readPixels some more, would it make sense to add an 
overload like this to the spec:

   void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
                   ArrayBufferView? pixels)

which assumes format=RGBA and type=UNSIGNED_BYTE?  If one really wanted, 
one could even make it take a Uint8Array; I think the current behavior 
of allowing passing in the wrong array types but "silently" not writing 
data to them is sorta hostile as APIs go.

This would not break existing code (or future code if more modes/formats 
ever get added), since the old overload would still be there, but would 
allow simpler code to be written in the meantime.

-Boris

-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------





More information about the public_webgl mailing list