I've fixed the problem. Looking at the ufoai log I've found out that the Mesa OpenGL driver was used. This was because I have two graphics adapters in my laptop, one from Intel and one from nvidia. After some googleing I found that I had to install bumblebee and run with the command "optirun ufo", and now my graphics are as they should be.