Adds GL namespace. Deprecates the `ccGLFunctionName` functions. New functions are `GL::functionName`
Also, converts the class `DrawPrimitives` into a namespace
Transition::ORIENTATION_XXX -> Transition::Orientation::XXX
Image::FORMAT_XXX -> Image::Format::XXX
Image::_function() -> Image::function() // private methods should not start with '_'
DrawPrimitives::drawColor() -> DrawPrimitives::setDrawColor()
And fixes Premultiplied Alpha in PVR v3 images
And tests are updated with the new functions
and other best pracitces like:
capacity and "index" are ints and not unsigned int (google's recomendation).
It is easier to detect underflow bugs like this
plus other minor improvements
As agreed previously, CC_PROPERTY_XXX and CC_SYNTHESIZE_XXX should
not be used in the code.
This patch removes some of them. There are still many more to remove
- Adds more `const` in getters
- Overriden methods have the `override` keyword
- Reorganizes the structure of the class:
# creators first, then constructor, destructors, init
# then overridden methods
# variables at the end
- removes Hungarian notation from parts of the code
Changes:
- creator (static) methods, and singleton methods (static) are always at the top of the class
- Constructors, destructros, and init methods comes next
- Then the instance methods for the class
- Then the overriden methods
- and finally the ivars
Also, overriden methos have the "override" context keyword
Once a Texture Atlas VAO has deallocated by glDeleteVertexArrays. The GLStateCache may have been recently set to that vaoID. When shortly after a new glGenVertexArrays gets the same vaoID but the glBindVertexArray is bypassed because of the GLStateCache is not aware the VAO was just invalidated, and new vertex are copied to the old freed address.
... instead of sharedXXX / purgeXXX.
They are more C++ friendly, and also easier to remember.
common files + Mac files + iOS files + tests/samples files were updated.
The old methods are deprecated now.