Heap corruption fixed and texture mapping seems ok but vertex drawing is misaligned now