Now I am fully confident that the problem is in my very weak video card. I wrote a small program for monitoring the GPU (It allowed me to monitor GPU utilization (screenshots are attached)) and launched glxgears. In the standard window size, it gave out ~800 fps. But as soon as I resized to fullscreen (1920x1080), the FPS dropped to 50! So I think I'm lucky that I get 36-38 frames in my application
Spoiler