From 4e17745be06f7d424c97cfda82862f972c0a257e Mon Sep 17 00:00:00 2001 From: Flamefire Date: Sat, 4 Oct 2014 08:59:53 +0200 Subject: [PATCH] Fix wrong centering of window --- Vocaluxe/Lib/Draw/COpenGL.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 1981f2f7..c4e6982b 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -99,7 +99,8 @@ namespace Vocaluxe.Lib.Draw public COpenGL() { - _Form = new CFormHook(); + _Form = new CFormHook {ClientSize = new Size(CConfig.ScreenW, CConfig.ScreenH)}; + //OpenGL needs that here but D3D needs it in the constructor, so do NOT unify! //Check AA Mode CConfig.AAMode = (EAntiAliasingModes)_CheckAntiAliasingMode((int)CConfig.AAMode); @@ -124,6 +125,7 @@ namespace Vocaluxe.Lib.Draw _Control.VSync = CConfig.VSync == EOffOn.TR_CONFIG_ON; _Form.Controls.Add(_Control); + _Control.ClientSize = _Form.ClientSize; _Control.KeyDown += _OnKeyDown; _Control.PreviewKeyDown += _OnPreviewKeyDown; @@ -229,9 +231,6 @@ namespace Vocaluxe.Lib.Draw if (!base.Init()) return false; - //OpenGL needs that here but D3D needs it in the constructor, so do NOT unify! - _Form.ClientSize = new Size(CConfig.ScreenW, CConfig.ScreenH); - // Init Texturing GL.Enable(EnableCap.Texture2D);