Tnx, I found this the problem. Its this line:
video_window(vector(0,0,0),vector(1024,768,0), 16+32, "Cubic-World by RP-Interactive, René Pol");

Change it to:
video_window(NULL,NULL, 16+32, "Cubic-World by RP-Interactive, René Pol");

I am not sure why that was the problem, maybe because you change the resolution twice in the same frame or something like that.