fixed client size on secondary screens in d3d
This commit is contained in:
1 parent
9361c8b375
commit
807d9f0e8b
1 file changed
+11
-2
@@ -263,7 +263,16 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
//Real fullscreen could be gained setting _PresentParameters.Windowed = true
|
//Real fullscreen could be gained setting _PresentParameters.Windowed = true
|
||||||
//And calling Reset() and Init() after
|
//And calling Reset() and Init() after
|
||||||
_OldSize = this.ClientSize;
|
_OldSize = this.ClientSize;
|
||||||
this.ClientSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
|
|
||||||
|
int ScreenNr = 0;
|
||||||
|
for (int i = 0; i < Screen.AllScreens.Length; i++)
|
||||||
|
{
|
||||||
|
Screen scr = Screen.AllScreens[i];
|
||||||
|
if (scr.Bounds.Top <= this.Top && scr.Bounds.Left <= this.Left)
|
||||||
|
ScreenNr = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ClientSize = new Size(Screen.AllScreens[ScreenNr].Bounds.Width, Screen.AllScreens[ScreenNr].Bounds.Height);
|
||||||
this.FormBorderStyle = FormBorderStyle.None;
|
this.FormBorderStyle = FormBorderStyle.None;
|
||||||
CenterToScreen();
|
CenterToScreen();
|
||||||
_fullscreen = true;
|
_fullscreen = true;
|
||||||
@@ -462,7 +471,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
if (CTime.IsRunning())
|
if (CTime.IsRunning())
|
||||||
delay = (int)Math.Floor(CConfig.CalcCycleTime() - CTime.GetMilliseconds());
|
delay = (int)Math.Floor(CConfig.CalcCycleTime() - CTime.GetMilliseconds());
|
||||||
|
|
||||||
if (delay >= 1)
|
if (delay >= 1 && CConfig.VSync == EOffOn.TR_CONFIG_OFF)
|
||||||
System.Threading.Thread.Sleep(delay);
|
System.Threading.Thread.Sleep(delay);
|
||||||
//Calculate the FPS Rate and restart the timer after a frame
|
//Calculate the FPS Rate and restart the timer after a frame
|
||||||
CTime.CalculateFPS();
|
CTime.CalculateFPS();
|
||||||
|
|||||||
Reference in new issue
Block a user