I´m coding my own webGL engine/framework, but something weird is happening:
I´m drawing a simple plane (2 triangles, just for testing) geometry with
gl.drawElements( drawMode , geometry.numItems , gl.UNSIGNED_SHORT , 0 ) ;
where drawmode is a variable with gl.TRIANGLES
stored,
and geometry.numItems
is the length of indices array.
All other buffers and stuff is properly set. In fact the object renders OK...
but cheking the debuging trace with webGL inspector in chrome I always see the error
" drawElements( TRIANGLES, 6 , UNSIGNED_SHORT , 0 ) " as INVALID_ENUM.
With this geometry and with any other.
screenshot from webGL inspector showing the problem
So I don't understand what is going so wrong here, and why if something is going so wrong the obejcts are rendering ok.
Any idea ?