diff --git a/BizHawk.Client.EmuHawk/RenderPanel.cs b/BizHawk.Client.EmuHawk/RenderPanel.cs index 097b1c5429..cbf863c0b0 100644 --- a/BizHawk.Client.EmuHawk/RenderPanel.cs +++ b/BizHawk.Client.EmuHawk/RenderPanel.cs @@ -49,6 +49,12 @@ namespace BizHawk.Client.EmuHawk //gl shouldnt be disposed! it should be a global resource! probably managed elsewhere } + private void HandleFullscreenToggle(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + GlobalWin.MainForm.ToggleFullscreen(); + } + class FontWrapper : IBlitterFont { public FontWrapper(StringRenderer font) @@ -67,6 +73,11 @@ namespace BizHawk.Client.EmuHawk GraphicsControl = gl.CreateGraphicsControl(); Renderer = new GuiRenderer(gl); + //pass through these events to the form. we might need a more scalable solution for mousedown etc. for zapper and whatnot. + //http://stackoverflow.com/questions/547172/pass-through-mouse-events-to-parent-control (HTTRANSPARENT) + GraphicsControl.Control.MouseDoubleClick += (o, e) => HandleFullscreenToggle(o, e); + GraphicsControl.Control.MouseClick += (o, e) => GlobalWin.MainForm.MainForm_MouseClick(o, e); + using (var xml = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Client.EmuHawk.Resources.courier16px.fnt")) using (var tex = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Client.EmuHawk.Resources.courier16px_0.png")) TheOneFont = new StringRenderer(gl,xml,tex); diff --git a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs index 81932e3f2d..742d7092fc 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL.OpenTK/IGL_TK.cs @@ -10,6 +10,7 @@ //http://www.opentk.com/node/437 (AGG#, codes on Tao forums) using System; +using System.Reflection; using System.Threading; using System.IO; using System.Collections.Generic; @@ -121,6 +122,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK GLControlWrapper wrapper = new GLControlWrapper(this); wrapper.MyControl = glc; + + //this might be important.. or it might not. it's ready, in case we need it + //glc.GetType().GetMethod("SetStyle", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(glc, new object[] { System.Windows.Forms.ControlStyles.UserMouse, true }); return wrapper; }