fix mouseclicks on GL viewport
This commit is contained in:
parent
ce9f282d67
commit
be49f6fa33
|
@ -49,6 +49,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//gl shouldnt be disposed! it should be a global resource! probably managed elsewhere
|
//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
|
class FontWrapper : IBlitterFont
|
||||||
{
|
{
|
||||||
public FontWrapper(StringRenderer font)
|
public FontWrapper(StringRenderer font)
|
||||||
|
@ -67,6 +73,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GraphicsControl = gl.CreateGraphicsControl();
|
GraphicsControl = gl.CreateGraphicsControl();
|
||||||
Renderer = new GuiRenderer(gl);
|
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 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"))
|
using (var tex = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Client.EmuHawk.Resources.courier16px_0.png"))
|
||||||
TheOneFont = new StringRenderer(gl,xml,tex);
|
TheOneFont = new StringRenderer(gl,xml,tex);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
//http://www.opentk.com/node/437 (AGG#, codes on Tao forums)
|
//http://www.opentk.com/node/437 (AGG#, codes on Tao forums)
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -121,6 +122,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
|
|
||||||
GLControlWrapper wrapper = new GLControlWrapper(this);
|
GLControlWrapper wrapper = new GLControlWrapper(this);
|
||||||
wrapper.MyControl = glc;
|
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;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue