Updated code to use simple opengl calls for textures