Game Development Community

Enabling/disabling vsync in the middle of a game

by Ian Omroth Hardingham · in Torque 3D Professional · 01/04/2011 (11:49 am) · 3 replies

Hey guys.

Anyone know what syntax it would be from, say, the Canvas, to change the D3D vsync status at an arbitary time?

Thanks,
Ian

#1
01/04/2011 (2:07 pm)
@Ian,
not quite sure what you are trying to achieve,
but wont something like this work??

pseudo code:
function ToggleVSync(%val)
{
	if(%val)
    !$pref::Video::disableVerticalSync;
   else
     $pref::Video::disableVerticalSync;
}
#2
01/04/2011 (2:20 pm)
Hi deepscratch.

The script preference is only applied at startup, so that won't actually change the vsync setting of D3D.

Thanks,
Ian
#3
01/04/2011 (3:39 pm)
You could go down the pref route and then pass the Apply() function.