Commit graph

26 commits

Author SHA1 Message Date
german
df1070a735 Add mutitouch support for touch screens 2021-01-15 09:05:17 -06:00
comex
bb729eefce Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off main thread
EmuWindow::PollEvents was called from the GPU thread (or the CPU thread
in sync-GPU mode) when swapping buffers.  It had three implementations:

- In GRenderWindow, it didn't actually poll events, just set a flag and
  emit a signal to indicate that a frame was displayed.

- In EmuWindow_SDL2_Hide, it did nothing.

- In EmuWindow_SDL2, it did call SDL_PollEvents, but this is wrong
  because SDL_PollEvents is supposed to be called on the thread that set
  up video - in this case, the main thread, which was sleeping in a
  busyloop (regardless of whether sync-GPU was enabled).  On macOS this
  causes a crash.

To fix this:

- Rename EmuWindow::PollEvents to OnFrameDisplayed, and give it a
  default implementation that does nothing.

- In EmuWindow_SDL2, do not override OnFrameDisplayed, but instead have
  the main thread call SDL_WaitEvent in a loop.
2020-11-23 17:58:49 -05:00
Lioncash
f44ad07f2f emu_window: Mark Scoped constructor and Acquire() as nodiscard
Ensures that callers make use of the constructor, preventing bugs from
silently occurring.
2020-08-14 04:43:44 -04:00
ReinUsesLisp
30bbdc653c yuzu: Drop SDL2 and Qt frontend Vulkan requirements
Create Vulkan instances and surfaces from the Vulkan backend.
2020-04-07 16:32:19 -03:00
James Rowe
c935a1a475 Address review and fix broken yuzu-tester build 2020-03-25 23:32:42 -06:00
James Rowe
b37d69e5e1 Frontend/GPU: Refactor context management
Changes the GraphicsContext to be managed by the GPU core. This
eliminates the need for the frontends to fool around with tricky
MakeCurrent/DoneCurrent calls that are dependent on the settings (such
as async gpu option).

This also refactors out the need to use QWidget::fromWindowContainer as
that caused issues with focus and input handling. Now we use a regular
QWidget and just access the native windowHandle() directly.

Another change is removing the debug tool setting in FrameMailbox.
Instead of trying to block the frontend until a new frame is ready, the
core will now take over presentation and draw directly to the window if
the renderer detects that its hooked by NSight or RenderDoc

Lastly, since it was in the way, I removed ScopeAcquireWindowContext and
replaced it with a simple subclass in GraphicsContext that achieves the
same result
2020-03-24 21:03:42 -06:00
bunnei
cba9bdcab0 renderer_opengl: Move Frame/FrameMailbox to OpenGL namespace. 2020-02-26 18:28:50 -05:00
bunnei
6904e8442d frontend: sdl2: emu_window: Implement separate presentation thread. 2020-02-25 21:23:00 -05:00
bunnei
27e56facc9 core: frontend: emu_window: Add TextureMailbox class. 2020-02-25 21:22:57 -05:00
ReinUsesLisp
48cb021c34 yuzu: Implement Vulkan frontend
Adds a Qt and SDL2 frontend for Vulkan. It also finishes the missing
bits on Vulkan initialization.
2020-01-29 17:53:11 -03:00
ReinUsesLisp
2410482b11 emu_window: Pass OnMinimalClientAreaChangeRequest argument by copy
There's no performance improvement in passing an unsigned pair by
reference.
2019-05-26 00:54:13 -03:00
Lioncash
6f1d39e2e5 core/frontend/emu_window: Make GraphicsContext's destructor virtual
This class is used in a polymorphic context, so destruction of the
context will lead to undefined behavior if the destructor isn't virtual.
2019-05-04 01:47:38 -04:00
bunnei
116f65a527 Merge pull request #2017 from jroweboy/glwidget
Frontend: Migrate to QOpenGLWindow and support shared contexts
2019-04-13 22:08:40 -04:00
Lioncash
4596a529ed core/frontend/emu_window: Make ClipToTouchScreen a const member function
This member function doesn't modify instance state, so it can have the
const specifier applied to it.
2019-02-27 08:54:42 -05:00
James Rowe
01a3b4f0de QT Frontend: Migrate to QOpenGLWindow 2019-01-21 16:00:01 -07:00
Lioncash
893faf13d7 emu_window: Ensure WindowConfig members are always initialized
Previously we weren't always initializing all members of the struct.
Prevents potentially wonky behavior from occurring.
2018-08-14 19:36:43 -04:00
Lioncash
53e86e35eb core: Namespace EmuWindow
Gets the class out of the global namespace.
2018-08-11 20:20:21 -04:00
bunnei
6eda6ae6eb frontend: Update for undocked Switch screen layout. 2018-01-10 23:28:43 -05:00
wwylele
2814d0fba2 EmuWindow: refactor touch input into a TouchDevice 2017-08-24 15:00:56 +03:00
wwylele
d500f79b8e move MotionEmu from core/frontend to input_common as a InputDevice 2017-08-11 11:05:08 +03:00
Yuri Kunde Schlesner
e6dc5926fb Move framebuffer_layout from Common to Core
This removes a dependency inversion between core and common. It's also
the proper place for the file since it makes screen layout decisions
specific to the 3DS.
2017-05-27 16:10:25 -07:00
wwylele
9bdb78f869 Input: remove unused stuff & clean up
1. removed zl, zr and c-stick from HID::PadState. They are handled by IR, not HID
2. removed button handling in EmuWindow
3. removed key_map
4. cleanup #include
2017-03-01 23:30:57 +02:00
wwylele
189063ac2d InputCommon: add Keyboard 2017-03-01 23:30:57 +02:00
wwylele
128190f242 Frontend: make motion sensor interfaced thread-safe 2016-12-29 21:18:36 +02:00
wwylele
e844f294a1 Frontend: emulate motion sensor 2016-12-26 10:52:16 +02:00
MerryMage
4aaaea9758 core: Move emu_window and key_map into core
* Removes circular dependences (common should not depend on core)
2016-12-23 13:42:39 +00:00
Renamed from src/common/emu_window.h (Browse further)