draw function moved to texture, fixed compiling issues