cocos2d-html5 is not using the Texture2D abstraction internally... and although it might not needed it for "canvas" it is still very useful. Example:
In the future, when WebGL support is added
to be compatible with JSB.
Right now "anti aliasing" is supported in JSB, but in html5 is simply crashes because the method setAliasTexParams is not implemented, in the HTMLImage object.
This could be easily fixed if we use Texture2D as an abstraction of Image.
In canvas, the Texture2D object contains an HTMLImage, and in WebGL it contains a real texture object.
cocos2d-html5 is not using the Texture2D abstraction internally... and although it might not needed it for "canvas" it is still very useful. Example:
Right now "anti aliasing" is supported in JSB, but in html5 is simply crashes because the method
setAliasTexParams
is not implemented, in the HTMLImage object.This could be easily fixed if we use Texture2D as an abstraction of Image.
In canvas, the
Texture2D
object contains an HTMLImage, and in WebGL it contains a real texture object.