Check also if your window resolution is supported in fullscreen. If not, you can't switch it to fullscreen no matter how hard you program. If it stays a window, your fullscree resolution is not supported and you must use video_switch again to switch it back to a supported resolution.