Window resizing finally. Also fixed some opengl errors