Commit Graph

57 Commits (c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec)

Author SHA1 Message Date
german77 c82806f9cb input_common: touch: Rewrite touch driver to support multiple touch points 4 years ago
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.
4 years ago
german77 14b949a0da yuzu_cmd: Use new input 4 years ago
Fernando Sahmkow 23ca1eb82e yuzu-cmd/CMakeLists: Correct attribution for this function. 4 years ago
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.
4 years ago
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().
4 years ago
lat9nq b11c81cc13 general: Implement FullscreenMode enumeration
Prevents us from using an unclear 0 or 1 to describe the fullscreen
mode.
4 years ago
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.
4 years ago
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>
4 years ago
lat9nq f785933125 sdl_impl, emu_window: Remove clang ignore
Fixed upstream by
libsdl-org/SDL@25fc40b0bd
4 years ago
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.
5 years ago
Lioncash 8805233f5e emu_window: unsigned -> u32
This is more concise and consistent with the rest of the codebase.
5 years ago
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.
5 years ago
german77 4738e14cb0 inputCommon: Mouse fixes 5 years ago
bunnei eae9f2e440 yuzu: Various frontend improvements to avoid crashes and improve experience on Linux. 5 years ago
german 52b79ac009 Add mouse panning 5 years ago
german 8495e1bd83 Add mutitouch support for touch screens 5 years ago
bunnei 7bc3e80399
Merge pull request #4939 from german77/MouseInput
InputCommon: Implement full mouse support
5 years ago
german e46f0e084c Implement full mouse support 5 years ago
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.
5 years ago
ReinUsesLisp 7003090187 renderer_opengl: Remove emulated mailbox presentation
Emulated mailbox presentation was causing performance issues on
Nvidia's OpenGL driver. Remove it.
5 years ago
Lioncash 9e1b0af259 input_common: Eliminate most global state
Abstracts most of the input mechanisms under an InputSubsystem class
that is managed by the frontends, eliminating any static constructors
and destructors. This gets rid of global accessor functions and also
allows the frontends to have a more fine-grained control over the
lifecycle of the input subsystem.

This also makes it explicit which interfaces rely on the input subsystem
instead of making it opaque in the interface functions. All that remains
to migrate over is the factories, which can be done in a separate
change.
5 years ago
H27CK a26a725515 Fix format error in performance statistics
Formatting
6 years ago
bunnei 2e16c23784 frontend: sdl2: emu_window: Implement separate presentation thread. 6 years ago
ReinUsesLisp f92cbc5501 yuzu: Implement Vulkan frontend
Adds a Qt and SDL2 frontend for Vulkan. It also finishes the missing
bits on Vulkan initialization.
6 years ago
Fernando Sahmkow 678d9ccad6 SDL: Fix missing header
This fixes linux and mingw builds.
6 years ago
jroweboy 64dbc92b61 Add FPS to SDL title bar
Also fix a small issue with incorrect shutdown ordering in SDL.
Previously the system would still be running so the telemetry task
didn't launch and detached_tasks would assert(count == 0)
6 years ago
ReinUsesLisp 37eaf39b44 emu_window: Pass OnMinimalClientAreaChangeRequest argument by copy
There's no performance improvement in passing an unsigned pair by
reference.
7 years ago
ReinUsesLisp 4b80dd23a4 yuzu_cmd: Split emu_window OpenGL implementation into its own file 7 years ago
ReinUsesLisp 69265e4504 yuzu_cmd: Use OpenGL compat when asked in the settings 7 years ago
bunnei 065f83c6c3
Merge pull request #2017 from jroweboy/glwidget
Frontend: Migrate to QOpenGLWindow and support shared contexts
7 years ago
James Rowe 09ac66388c Input: Remove global variables from SDL Input
Changes the interface as well to remove any unique methods that
frontends needed to call such as StartJoystickEventHandler by
conditionally starting the polling thread only if the frontend hasn't
started it already. Additionally, moves all global state into a single
SDLState class in order to guarantee that the destructors are called in
the proper order
7 years ago
zhupengfei a94a828b6c citra_qt: Log settings on launch 7 years ago
James Rowe f2a2f818b6 SDL Frontend: Add shared context support 7 years ago
ReinUsesLisp 22c7c710b4 gl_rasterizer: Remove extension booleans 7 years ago
FernandoS27 0368260c99 Removed pre 4.3 ARB extensions 7 years ago
FernandoS27 377c60645c Update OpenGL's backend version from 3.3 to 4.3 7 years ago
NeatNit 4f24343f32 implemented touch in Qt and SDL
change TouchToPixelPos to return std::pair<int, int>

static_cast (SDL)

various minor style and code improvements

style - PascalCase for function names

made touch events private

const pointer arg in touch events

make TouchToPixelPos a const member function

did I do this right?

braces on barely-multiline if

remove question comment (confirmed in Discord)

fixed consts

remove unused parameter from TouchEndEvent

DRY - High-DPI scaled touch put in separate function

also fixes a bug where if you start touching (with either mouse or touchscreen) and drag the mouse to the LEFT of the emulator window, the touch point jumps to the RIGHT side of the touchscreen; draggin to above the window would make it jump to the bottom.

implicit conversion from QPoint to QPointF, apparently

I have no idea what const even means but I'll put it here anyway

remove unused or used-once variables

make touch scaling functions const, and put their implementations together

removed unused FingerID parameters

QTouchEvent forward declaration; add comment to TouchBegin that was lost in an edit

better DRY in SDL

To do -> TODO(NeatNit)

remove unused include
7 years ago
bunnei 2fbb20b2b5 yuzu/yuzu_cmd: Add checks for required extension ARB_copy_image. 7 years ago
ReinUsesLisp a42376dfad Use ARB_multi_bind for uniform buffers (#1287)
* gl_rasterizer: use ARB_multi_bind for uniform buffers

* address feedback
7 years ago
Markus Wick 3e973bc4c6 gl_rasterizer: Use ARB_texture_storage.
It allows us to use texture views and it reduces the overhead within the GPU driver.

But it disallows us to reallocate the texture, but we don't do so anyways.

In the end, it is the new way to allocate textures, so there is no need to use the old way.
7 years ago
Tobias 804115b2a4 Port #4141 from citra: Joystick hotplug support (#1275)
* Joystick hotplug support (#4141)

* use SDL_PollEvent instead of SDL_JoystickUpdate

Register hot plugged controller by GUID if they were configured in a previous session

* Move SDL_PollEvent into its own thread

* Don't store SDLJoystick pointer in Input Device; Get pointer on each GetStatus call

* Fix that joystick_list gets cleared after SDL_Quit

* Add VirtualJoystick for InputDevices thats never nullptr

* fixup! Add VirtualJoystick for InputDevices thats never nullptr

* fixup! fixup! Add VirtualJoystick for InputDevices thats never nullptr

* Remove SDL_GameController, make SDL_Joystick* unique_ptr

* fixup! Remove SDL_GameController, make SDL_Joystick* unique_ptr

* Adressed feedback; fixed handling of same guid reconnects

* fixup! Adressed feedback; fixed handling of same guid reconnects

* merge the two joystick_lists into one

* make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! fixup! make SDLJoystick a member of VirtualJoystick

* SDLJoystick: Addressed review comments

* Address one missed review comment
7 years ago
bunnei 8b08cb925b gl_rasterizer: Use baseInstance instead of moving the buffer points.
This hopefully helps our cache not to redundant upload the vertex buffer.

# Conflicts:
#	src/video_core/renderer_opengl/gl_rasterizer.cpp
7 years ago
CaptV0rt3x 9382414b20 For SDL Frontend 7 years ago
fearlessTobi 742f895f8b frontend: Set swap interval to 0 7 years ago
David Marcec 706fc5d2d6 Added check to see if ARB_texture_mirror_clamp_to_edge is supported 7 years ago
fearlessTobi 6f05a57712 Port #3665 from Citra 7 years ago
Subv ba2fb83d60 Frontend: Check for more required OpenGL extensions during startup. 7 years ago
Tobias 316b933a31 Port #3335 and #3373 from Citra: "Small SDL fixes" and "Print the actual error preventing SDL from working" (#637)
* Port #3335 and #3373 from Citra

* Fixup: Use the new logging placeholders
7 years ago
James Rowe 638956aa81 Rename logging macro back to LOG_* 7 years ago