gfx.c
changeset 298 0123c0489940
parent 193 0a7025304867
child 306 9ba288cacf0a
equal deleted inserted replaced
297:6c4ab6ff031f 298:0123c0489940
  1926 
  1926 
  1927 	_cur_resolution[0] = w;
  1927 	_cur_resolution[0] = w;
  1928 	_cur_resolution[1] = h;
  1928 	_cur_resolution[1] = h;
  1929 	return true;
  1929 	return true;
  1930 }
  1930 }
       
  1931 
       
  1932 void ToggleFullScreen(const bool full_screen)
       
  1933 {
       
  1934 	_fullscreen = full_screen;
       
  1935 	/* use preset resolutions, not _screen.height and _screen.width. On windows for example
       
  1936 	   if Desktop-size is 1280x1024, and gamesize is also 1280x1024, _screen.height will be 
       
  1937 		 only 1000 because of possible start-bar. For this reason you cannot switch to 
       
  1938 		 fullscreen mode from this resolution. Use of preset resolution will fix this */
       
  1939 	if (!_video_driver->change_resolution(_cur_resolution[0], _cur_resolution[1]))
       
  1940 		_fullscreen ^= true; // switching resolution failed, put back full_screen to original status
       
  1941 }