addressed comments
This commit is contained in:
parent
f37c01f08d
commit
4e1c747c81
2 changed files with 34 additions and 29 deletions
|
@ -26,7 +26,7 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
public bool IsStopped { get; set; }
|
public bool IsStopped { get; set; }
|
||||||
public bool IsFocussed { get; set; } = false;
|
public bool IsFocused { get; set; } = false;
|
||||||
|
|
||||||
private double _mouseX;
|
private double _mouseX;
|
||||||
private double _mouseY;
|
private double _mouseY;
|
||||||
|
@ -52,7 +52,8 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
private Input.NpadController _primaryController;
|
private Input.NpadController _primaryController;
|
||||||
|
|
||||||
public GLRenderer(Switch device) :base (new GraphicsMode(), 3, 3, GraphicsContextFlags.ForwardCompatible)
|
public GLRenderer(Switch device) :
|
||||||
|
base (new GraphicsMode(), 3, 3, GraphicsContextFlags.ForwardCompatible)
|
||||||
{
|
{
|
||||||
WaitEvent = new ManualResetEvent(false);
|
WaitEvent = new ManualResetEvent(false);
|
||||||
|
|
||||||
|
@ -78,12 +79,12 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
private void Parent_FocusOutEvent(object o, Gtk.FocusOutEventArgs args)
|
private void Parent_FocusOutEvent(object o, Gtk.FocusOutEventArgs args)
|
||||||
{
|
{
|
||||||
IsFocussed = false;
|
IsFocused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Parent_FocusInEvent(object o, Gtk.FocusInEventArgs args)
|
private void Parent_FocusInEvent(object o, Gtk.FocusInEventArgs args)
|
||||||
{
|
{
|
||||||
IsFocussed = true;
|
IsFocused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GLRenderer_Destroyed(object sender, EventArgs e)
|
private void GLRenderer_Destroyed(object sender, EventArgs e)
|
||||||
|
@ -106,7 +107,7 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
_toggleFullscreen = toggleFullscreen;
|
_toggleFullscreen = toggleFullscreen;
|
||||||
|
|
||||||
if (IsFocussed)
|
if (IsFocused)
|
||||||
{
|
{
|
||||||
if (this.ParentWindow.State.HasFlag(Gdk.WindowState.Fullscreen) )
|
if (this.ParentWindow.State.HasFlag(Gdk.WindowState.Fullscreen) )
|
||||||
{
|
{
|
||||||
|
@ -247,6 +248,10 @@ namespace Ryujinx.Ui
|
||||||
using (ScopedGLContext scopedGLContext = new ScopedGLContext(WindowInfo, GraphicsContext))
|
using (ScopedGLContext scopedGLContext = new ScopedGLContext(WindowInfo, GraphicsContext))
|
||||||
{
|
{
|
||||||
_renderer.Initialize();
|
_renderer.Initialize();
|
||||||
|
|
||||||
|
GL.Disable(EnableCap.AlphaTest);
|
||||||
|
|
||||||
|
SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (IsActive)
|
while (IsActive)
|
||||||
|
@ -256,17 +261,8 @@ namespace Ryujinx.Ui
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
using (ScopedGLContext scopedGLContext = new ScopedGLContext(WindowInfo, GraphicsContext))
|
using (ScopedGLContext scopedGLContext = new ScopedGLContext(WindowInfo, GraphicsContext))
|
||||||
{
|
{
|
||||||
GL.ClearColor(Color4.Black);
|
|
||||||
=======
|
|
||||||
GraphicsContext.MakeCurrent(WindowInfo);
|
|
||||||
|
|
||||||
GL.Disable(EnableCap.AlphaTest);
|
|
||||||
|
|
||||||
SwapBuffers();
|
|
||||||
>>>>>>> add fullscreen, enable input on focus, disable aplha
|
|
||||||
|
|
||||||
_ticks += _chrono.ElapsedTicks;
|
_ticks += _chrono.ElapsedTicks;
|
||||||
|
|
||||||
|
@ -325,7 +321,7 @@ namespace Ryujinx.Ui
|
||||||
this.ParentWindow.Title = _newTitle;
|
this.ParentWindow.Title = _newTitle;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (IsFocussed)
|
if (IsFocused)
|
||||||
{
|
{
|
||||||
UpdateFrame();
|
UpdateFrame();
|
||||||
}
|
}
|
||||||
|
@ -417,26 +413,26 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
// Get screen touch position from left mouse click
|
// Get screen touch position from left mouse click
|
||||||
// OpenTK always captures mouse events, even if out of focus, so check if window is focused.
|
// OpenTK always captures mouse events, even if out of focus, so check if window is focused.
|
||||||
if (IsFocussed && _mousePressed)
|
if (IsFocused && _mousePressed)
|
||||||
{
|
{
|
||||||
int scrnWidth = AllocatedWidth;
|
int screenWidth = AllocatedWidth;
|
||||||
int scrnHeight = AllocatedHeight;
|
int screenHeight = AllocatedHeight;
|
||||||
|
|
||||||
if (AllocatedWidth > (AllocatedHeight * TouchScreenWidth) / TouchScreenHeight)
|
if (AllocatedWidth > (AllocatedHeight * TouchScreenWidth) / TouchScreenHeight)
|
||||||
{
|
{
|
||||||
scrnWidth = (AllocatedHeight * TouchScreenWidth) / TouchScreenHeight;
|
screenWidth = (AllocatedHeight * TouchScreenWidth) / TouchScreenHeight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scrnHeight = (AllocatedWidth * TouchScreenHeight) / TouchScreenWidth;
|
screenHeight = (AllocatedWidth * TouchScreenHeight) / TouchScreenWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int startX = (AllocatedWidth - scrnWidth) >> 1;
|
int startX = (AllocatedWidth - screenWidth) >> 1;
|
||||||
int startY = (AllocatedHeight - scrnHeight) >> 1;
|
int startY = (AllocatedHeight - screenHeight) >> 1;
|
||||||
|
|
||||||
int endX = startX + scrnWidth;
|
int endX = startX + screenWidth;
|
||||||
int endY = startY + scrnHeight;
|
int endY = startY + screenHeight;
|
||||||
|
|
||||||
|
|
||||||
if (_mouseX >= startX &&
|
if (_mouseX >= startX &&
|
||||||
|
@ -444,11 +440,11 @@ namespace Ryujinx.Ui
|
||||||
_mouseX < endX &&
|
_mouseX < endX &&
|
||||||
_mouseY < endY)
|
_mouseY < endY)
|
||||||
{
|
{
|
||||||
int scrnMouseX = (int)_mouseX - startX;
|
int screenMouseX = (int)_mouseX - startX;
|
||||||
int scrnMouseY = (int)_mouseY - startY;
|
int screenMouseY = (int)_mouseY - startY;
|
||||||
|
|
||||||
int mX = (scrnMouseX * TouchScreenWidth) / scrnWidth;
|
int mX = (screenMouseX * TouchScreenWidth) / screenWidth;
|
||||||
int mY = (scrnMouseY * TouchScreenHeight) / scrnHeight;
|
int mY = (screenMouseY * TouchScreenHeight) / screenHeight;
|
||||||
|
|
||||||
TouchPoint currentPoint = new TouchPoint
|
TouchPoint currentPoint = new TouchPoint
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace Ryujinx.Ui
|
||||||
[GUI] CheckMenuItem _favToggle;
|
[GUI] CheckMenuItem _favToggle;
|
||||||
[GUI] MenuItem _firmwareInstallFile;
|
[GUI] MenuItem _firmwareInstallFile;
|
||||||
[GUI] MenuItem _firmwareInstallDirectory;
|
[GUI] MenuItem _firmwareInstallDirectory;
|
||||||
|
[GUI] MenuItem _openDebugger;
|
||||||
[GUI] CheckMenuItem _iconToggle;
|
[GUI] CheckMenuItem _iconToggle;
|
||||||
[GUI] CheckMenuItem _appToggle;
|
[GUI] CheckMenuItem _appToggle;
|
||||||
[GUI] CheckMenuItem _developerToggle;
|
[GUI] CheckMenuItem _developerToggle;
|
||||||
|
@ -73,6 +74,7 @@ namespace Ryujinx.Ui
|
||||||
[GUI] LevelBar _progressBar;
|
[GUI] LevelBar _progressBar;
|
||||||
[GUI] Box _viewBox;
|
[GUI] Box _viewBox;
|
||||||
[GUI] Box _listStatusBox;
|
[GUI] Box _listStatusBox;
|
||||||
|
|
||||||
#pragma warning restore CS0649
|
#pragma warning restore CS0649
|
||||||
#pragma warning restore IDE0044
|
#pragma warning restore IDE0044
|
||||||
|
|
||||||
|
@ -133,6 +135,8 @@ namespace Ryujinx.Ui
|
||||||
#if USE_DEBUGGING
|
#if USE_DEBUGGING
|
||||||
_debugger = new Debugger.Debugger();
|
_debugger = new Debugger.Debugger();
|
||||||
_openDebugger.Activated += _openDebugger_Opened;
|
_openDebugger.Activated += _openDebugger_Opened;
|
||||||
|
#else
|
||||||
|
_openDebugger.Hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_gameTable.Model = _tableStore = new ListStore(
|
_gameTable.Model = _tableStore = new ListStore(
|
||||||
|
@ -432,6 +436,7 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
_emulationContext = null;
|
_emulationContext = null;
|
||||||
_gameLoaded = false;
|
_gameLoaded = false;
|
||||||
|
_gLWigdet = null;
|
||||||
|
|
||||||
DiscordIntegrationModule.SwitchToMainMenu();
|
DiscordIntegrationModule.SwitchToMainMenu();
|
||||||
|
|
||||||
|
@ -862,10 +867,14 @@ namespace Ryujinx.Ui
|
||||||
if (_fullScreen.Active)
|
if (_fullScreen.Active)
|
||||||
{
|
{
|
||||||
Fullscreen();
|
Fullscreen();
|
||||||
|
|
||||||
|
ToggleExtraWidgets(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Unfullscreen();
|
Unfullscreen();
|
||||||
|
|
||||||
|
ToggleExtraWidgets(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue