Commit graph

100 commits

Author SHA1 Message Date
Narr the Reg
ee847f8ff0 hid_core: Move hid to it's own subproject 2024-01-05 11:41:15 -06:00
Nikita Strygin
9323a1f9b2 yuzu_cmd: Report more SDL errors 2023-12-30 13:32:33 +03:00
bunnei
ae099d583c core: frontend: Refactor GraphicsContext to its own module. 2023-06-03 00:05:31 -07:00
Narr the Reg
17207939e5 input_common: Split mouse input into individual devices 2023-02-16 14:22:13 -06:00
german77
ebca59b8e9 yuzu_cmd: Fix mismatching controller input 2023-02-04 11:05:57 -06:00
german77
424643f9af yuzu_cmd: Fix touch input 2023-02-04 10:31:12 -06:00
Alexander Orzechowski
09e3029c11 gl_device: Use a more robust way to use strict context mode
Instead of checking a environment variable which may not actually
exist or is just wrong, ask QT if it's running on the wayland
platform.
2022-12-13 15:01:51 -05:00
Alexander Orzechowski
5754456292 emu_window_sdl2: Respect hidpi
Use SDL_GL_GetDrawableSize instead of SDL_GetWindowSize which
will return the true size our swapchain needs to be in even
for hidpi displays.
2022-12-13 13:23:35 -05:00
liamwhite
02b10a6e4d
Merge pull request #9374 from liamwhite/externals
externals: update dynarmic, SDL2
2022-12-04 10:44:12 -05:00
Liam
6d2c597371 externals: update dynarmic, SDL2 2022-12-04 10:12:26 -05:00
bunnei
f77cc6c412
Merge pull request #9344 from liamwhite/null
video_core: add null backend
2022-12-03 11:23:25 -08:00
Matías Locatti
c043ba8467
Merge pull request #9303 from liamwhite/new-vulkan-init
Vulkan: update initialization
2022-12-02 18:32:54 -03:00
Liam
89dd7dc180 video_core: add null backend 2022-11-28 19:49:09 -05:00
Liam
2956a33463 Vulkan: update initialization
Co-authored-by: bylaws <bylaws@users.noreply.github.com>
2022-11-27 14:58:28 -05:00
german77
a67e776af9 yuzu-cmd: Fix input callback crash on close 2022-11-27 10:53:22 -06:00
Kyle Kienapfel
6fa3faec65 Add break for default cases
Visual Studio has an option to search all files in a solution, so I
did a search in there for "default:" looking for any missing break
statements.

I've left out default statements that return something, and that throw
something, even if via ThrowInvalidType. UNREACHABLE leads towards throw

R_THROW macro leads towards a return
2022-11-13 16:30:55 -08:00
Andrea Pappacoda
cdb240f3d4
chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.

Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.

The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.

Following REUSE has a few advantages over the current approach:

- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
  `.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
  files like binary assets / images is always accurate and up to date

To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.

[REUSE]: https://reuse.software

Follow-up to 01cf05bc75
2022-07-27 12:53:49 +02:00
Morph
69d92a19a5 yuzu_cmd: Eliminate variable shadowing 2022-06-13 18:19:23 -04:00
Liam
c3cc65a11e yuzu-cmd: ignore bogus timeous from SDL 2022-06-10 12:49:18 -04:00
german77
c82806f9cb input_common: touch: Rewrite touch driver to support multiple touch points 2022-05-23 11:01:14 -05:00
Morph
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
bunnei
46da380b57
Merge pull request #8027 from lat9nq/cmd-fullscreen-size
emu_window_sdl2: Set window size to display dimensions for exclusive fullscreen
2022-04-13 18:43:47 -07:00
ameerj
a367db44cf yuzu_cmd: Reduce unused includes 2022-03-20 02:25:09 -04:00
lat9nq
50415f68a5 emu_window_sdl2: Set window size to display dimensions for exclusive fullscreen
Since SDL2 does not automatically resize the canvas when entering
fullscreen mode, resize the window to desktop display dimensions.
2022-03-15 04:33:08 -04:00
german77
14b949a0da yuzu_cmd: Use new input 2021-11-24 20:30:23 -06:00
Fernando Sahmkow
23ca1eb82e yuzu-cmd/CMakeLists: Correct attribution for this function. 2021-08-08 20:24:53 +02:00
san
3e26141483 yuzu-cmd: hide cursor when in fullscreen
Exposed the SDL_ShowCursor function to EmuWindow baseclass. When creating the window (GL or VK) in fullscreen it now automatically hides the cursor.
2021-08-01 21:46:13 +02:00
lat9nq
335de3fdf5 emu_window: Remove global system instance
It was just the one in emu_window_sdl2, but since _gl and _vk inherit
from it, they all needed adjustments.

Leaves just the one auto system& in main().
2021-07-30 10:43:58 -04:00
lat9nq
b11c81cc13 general: Implement FullscreenMode enumeration
Prevents us from using an unclear 0 or 1 to describe the fullscreen
mode.
2021-07-23 10:14:37 -04:00
lat9nq
9befe7047b yuzu_cmd: Make use of fullscreen_mode setting
Reverts 48259de0c1a6a1aca77eec31cb8aca5ca2b680dd to the previous
hierarchy and fixes the resolution issue with this fullscreen mode.
yuzu-cmd will now read the fullscreen_mode setting and use it
appropriately.
2021-07-21 19:48:03 -04:00
san
583a10fded
yuzu-cmd: Fullscreen Improvements (#6656)
* emu_window_sdl2_vk: Use the generated SDL config

On Linux, due to the way we include SDL2 as a submodule, it makes it
difficult for us to specify which SDL_config.h we intended to include.
Before, CMake would default to the dummy one included with SDL and
ignore the generated one.

This tells CMake to use the generated one. In addition, we define
USING_GENERATED_CONFIG_H to throw an error in case the dummy config is
used by accident. Fixes Vulkan not working on Linux yuzu-cmd.

* emu_window_sdl2_vk: Specify the window manager if it should be supported

The original language "not implemented" is wrong if the implementation
exists but is not compiled. This causes a bit of a debugging headache
when it goes wrong. Log it if the window manager is known before
exiting.

* sdl_impl, emu_window: Remove clang ignore

Fixed upstream by
libsdl-org/SDL@25fc40b0bd

* Enable fullscreen support for Vulkan on yuzu-cmd

Hooked up the existing SDL2 logic for fullscreen support in the Vulkan window of yuzu-cmd.

* Change fullscreen logic to attempt desktop resolution first on yuzu-cmd

Changed the order in which we attempt to switch to fullscreen. First try desktop resolution first, if it fails fall back to streched fullscreen using windowed resolution.

Co-authored-by: lat9nq <22451773+lat9nq@users.noreply.github.com>
Co-authored-by: san <san+gitkraken@smederijmerlijn.nl>
2021-07-21 11:56:42 -07:00
lat9nq
f785933125 sdl_impl, emu_window: Remove clang ignore
Fixed upstream by
libsdl-org/SDL@25fc40b0bd
2021-07-16 15:43:12 -04:00
lat9nq
0e6ba0cd0d emu_window_sdl2_vk: Specify the window manager if it should be supported
The original language "not implemented" is wrong if the implementation
exists but is not compiled. This causes a bit of a debugging headache
when it goes wrong. Log it if the window manager is known before
exiting.
2021-07-16 15:43:12 -04:00
lat9nq
d3748cad73 emu_window_sdl2_vk: Use the generated SDL config
On Linux, due to the way we include SDL2 as a submodule, it makes it
difficult for us to specify which SDL_config.h we intended to include.
Before, CMake would default to the dummy one included with SDL and
ignore the generated one.

This tells CMake to use the generated one. In addition, we define
USING_GENERATED_CONFIG_H to throw an error in case the dummy config is
used by accident. Fixes Vulkan not working on Linux yuzu-cmd.
2021-07-16 15:43:02 -04:00
Clément Gallet
2e1c58b905
Avoid -Wshadow warning
Co-authored-by: Mai M. <mathew1800@gmail.com>
2021-06-05 18:43:10 +02:00
Clément Gallet
9ff8504452 yuzu-cmd: Fix OpenGL rendering 2021-06-04 11:39:04 +02:00
ameerj
5bef54618a perf_stats: Rework FPS counter to be more accurate
The FPS counter was based on metrics in the nvdisp swapbuffers call. This metric would be accurate if the gpu thread/renderer were synchronous with the nvdisp service, but that's no longer the case.

This commit moves the frame counting responsibility onto the concrete renderers after their frame draw calls. Resulting in more meaningful metrics.
The displayed FPS is now made up of the average framerate between the previous and most recent update, in order to avoid distracting FPS counter updates when framerate is oscillating between close values.

The status bar update frequency was also changed from 2 seconds to 500ms.
2021-05-15 20:34:20 -04:00
Lioncash
8805233f5e emu_window: unsigned -> u32
This is more concise and consistent with the rest of the codebase.
2021-04-23 11:19:32 -04:00
lat9nq
f973274b99 general: Ignore implicit-fallthrough for SDL.h
SDL 2.0.14 introduces an incompatibility with Clang, causing it to
trigger -Wimplicit-fallthrough even though it is marked. Ignore it for
now, with a comment mentioning why this is needed.
2021-04-18 01:31:26 -04:00
bunnei
a4c6712a4b common: Move settings to common from core.
- Removes a dependency on core and input_common from common.
2021-04-14 16:24:03 -07:00
german77
4738e14cb0 inputCommon: Mouse fixes 2021-02-27 17:53:10 -06:00
bunnei
eae9f2e440 yuzu: Various frontend improvements to avoid crashes and improve experience on Linux. 2021-02-14 00:20:41 -08:00
bunnei
e53b6ecc76
Merge pull request #5869 from german77/mousePanning
input_common: Add mouse panning
2021-02-11 09:58:23 -08:00
german
52b79ac009 Add mouse panning 2021-02-07 20:31:58 -06:00
Morph
6e5cc977ad renderer_opengl: Update OpenGL backend version requirement to 4.6 2021-02-07 16:32:35 -05:00
german
8495e1bd83 Add mutitouch support for touch screens 2021-01-15 09:05:17 -06:00
bunnei
7bc3e80399
Merge pull request #4939 from german77/MouseInput
InputCommon: Implement full mouse support
2020-11-29 22:59:50 -08:00
german
e46f0e084c Implement full mouse support 2020-11-25 23:59:30 -06:00
comex
994f497781 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
ReinUsesLisp
7003090187 renderer_opengl: Remove emulated mailbox presentation
Emulated mailbox presentation was causing performance issues on
Nvidia's OpenGL driver. Remove it.
2020-09-20 16:29:41 -03:00