Fix rendering bug.

In CoreTexture2D the createTexture method in the constructor was making
use of the CoreGL instance before it was assigned from the constructor.
The solution is very simple, move the assignment of the CoreGL instance
above the createTexture method, so nothing in this class can use it
before it's assigned. The stacktrace printing in LoggerShortFormat
revealed the source of this problem easily.