Commit Graph

86 Commits

Author SHA1 Message Date
SachinVin
9268b7d48e
Merge branch 'master' into tex-cache 2022-09-01 19:50:32 +05:30
Ian Chamberlain
401336c5e7
Rename Close() -> RequestClose() 2022-08-22 18:11:26 -04:00
Ian Chamberlain
c634c263db
citra-sdl: use the result of system.RunLoop()
If a shutdown was requested by the application, close the SDL window,
initiating the normal shutdown procedure. This causes a graceful exit
process instead of hanging.
2022-08-20 20:49:59 -04:00
emufan4568
025cd31420 video_core: Bump OpenGL version to 4.3 on desktop
* The current backend heavily depends on many extensions for shadow
  rendering and texture cubes in the fragment shaders. All these
  extensions were incorporated to core in 4.3. Support is practically
  ubiquitous and requiring support for it makes things a lot easier
2022-08-21 01:39:16 +03:00
pawelniegowski
ff81fb04b4 Fix MakeCurrent and shader issues with AMD 22.7 driver 2022-07-29 12:26:18 +02:00
Ian Chamberlain
6764264488
Initialize GAMECONTROLLER in EmuWindow_SDL2 (#6078)
Resolves #6077

If only `SDL_INIT_JOYSTICK` is used, `InputCommon::SDL::SDLState` later tries to initialize the game controller in a background thread, which on macOS causes a crash in `SDL_PumpEvents`. From [the SDL docs](https://wiki.libsdl.org/SDL_Init), `SDL_INIT_GAMECONTROLLER` implies `SDL_INIT_JOYSTICK`, so this should be a total superset of the previous behavior.
2022-07-28 20:51:53 +05:30
xperia64
3fa12d43f5
Fix fmt crash from deprecated percent specifier (#5616)
* Fix fmt crash from deprecated percent specifier

* ...clang format
2020-11-22 20:55:45 -05:00
James Rowe
66f5278f52 Delete core_context before shutting down SDL 2019-11-09 13:12:30 -07:00
James Rowe
26d828fb4c Prevent softlock on shutdown and various cleanup 2019-11-09 13:12:29 -07:00
James Rowe
52d7676831 recreate mailbox to use a queue instead 2019-11-09 13:12:29 -07:00
James Rowe
ac90cd0378 Change Present to finish only after swap 2019-11-09 13:12:29 -07:00
James Rowe
fcbe5e1acd Add a separate thread for rendering and add texture mailbox and shared context to SDL 2019-11-09 13:10:18 -07:00
James Rowe
7152f4c748 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)
2019-09-21 22:10:24 -06:00
Tobias
a546efad31
Port yuzu-emu/yuzu#2529: "yuzu/bootmanager: Minor interface tid… (#4794)
* yuzu/bootmanager: Remove unnecessary pointer casts

We can just invoke these functions by qualifying the object name before
the function.

* yuzu/bootmanager: unsigned -> u32

Same thing (for platforms we support), less reading.

* yuzu/bootmanager: Default EmuThread's destructor in the cpp file

This class contains non-trivial members, so we should default the
destructor's definition within the cpp file.

* yuzu/bootmanager: Treat the resolution factor as a u32

Treating it as a u16 can result in a sign-conversion warning when
performing arithmetic with it, as u16 promotes to an int when aritmetic
is performed on it, not unsigned int.

This also makes the interface more uniform, as the layout interface now
operates on u32 across the board.

* yuzu/bootmanager: Log out screenshot destination path

We can make this message more meaningful by indicating the location the
screenshot has been saved to. We can also log out whenever a screenshot
could not be saved (e.g. due to filesystem permissions or some other
reason).

* Fix compilation
2019-07-11 18:46:44 +02:00
Lioncash
6e22891761 core: Namespace EmuWindow
Gets the class out of the global namespace.
2019-04-21 14:16:16 +02:00
BreadFish64
cd21abe50f sdl: add GLES support 2019-02-03 15:58:09 -06:00
fearlessTobi
1302c9c1e7 frontend: Remove V-Sync option from UI
The V-Sync option is fundamentally broken in Citra, so let's do the same as yuzu and remove it entirely for SDL2 and at least from the frontend for QT.
(It was also only used by 7.3% of users)
2019-01-19 17:43:44 +01:00
NeatNit
4ee914c7a8 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
2018-10-09 23:10:28 +08:00
James Rowe
3f4a7f8f58 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
2018-09-22 14:13:50 -06:00
B3n30
0238cf52b7 SDLJoystick: Addressed review comments 2018-09-11 14:50:41 +02:00
Ben
17978cf758
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
2018-09-08 19:01:30 +02:00
fearlessTobi
cf8b1726df Address review comments 2018-09-06 00:00:21 +02:00
Lioncash
3284bef360 string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-09-06 00:00:21 +02:00
zhupengfei
e8ac58c480
settings: move log code to settings 2018-07-19 08:38:57 +08:00
wwylele
0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
wwylele
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
zhupengfei
ddc97b15f4 common: Parse Nightly/Canary build version 2018-06-20 09:30:26 +08:00
adityaruplaha
0cece7918a Log Citra version.
Class: Frontend
Level: Info
Format: "Citra Version: " + window title
2018-04-29 21:05:19 +05:30
adityaruplaha
e5f5fdee2e SDL2: Implement fullscreen 2018-04-17 23:22:23 +05:30
James Rowe
0daac3020e Logging: Add customizable logging backends and fmtlib based macros
* Change the logging backend to support multiple sinks through the
Backend Interface
* Add a new set of logging macros to use fmtlib instead.
* Qt: Compile as GUI application on windows to make the console hidden by
default. Add filter configuration and a button to open log location.
* SDL: Migrate to the new logging macros
2018-03-16 11:18:06 +08:00
Emmanuel Gil Peyrot
c361dad7d2 Citra: Print the actual error preventing SDL from working 2018-01-13 21:41:51 +01:00
wwylele
188194908c move MotionEmu from core/frontend to input_common as a InputDevice 2017-08-11 11:05:08 +03:00
B3n30
ebff5ba514 Network: Init Network in SDL and QT 2017-07-16 21:29:19 +02:00
Yuri Kunde Schlesner
eb10f25025 Move screen size constants from video_core to core
video_core didn't even properly use them, and they were the source of
many otherwise-unnecessary dependencies from core to video_core.
2017-05-27 18:41:24 -07:00
wwylele
38e800f70d InputCommon: add Keyboard 2017-03-01 23:30:57 +02:00
James Rowe
b090422991 Gui: Change title bar to include build name
Nightly builds now have "Citra Nightly" in the titlebar
Bleeding edge builds now have "Citra Bleeding Edge" in the titlebar
2017-02-23 00:42:55 -07:00
wwylele
bcf9d20d57 Frontend: emulate motion sensor 2016-12-26 10:52:16 +02:00
MerryMage
64f98f4d0f 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
James Rowe
2b1654ad9b Support additional screen layouts.
Allows users to choose a single screen layout or a large screen layout.
Adds a configuration option to change the prominent screen.
2016-11-05 02:55:41 -06:00
Emmanuel Gil Peyrot
ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner
396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot
dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
bunnei
08ad9b36d4 config: Add a setting for graphics V-Sync. 2016-08-29 21:42:30 -04:00
wwylele
03631f9b8f Refactor input subsystem 2016-05-15 13:24:22 +03:00
Emmanuel Gil Peyrot
aa4d4ff23c Frontends, VideoCore: Move glad initialisation to the frontend
On SDL2 this allows it to use SDL_GL_GetProcAddress() instead of the
default function loader, and fixes a crash when using apitrace with an
EGL context.

On Qt we will need to migrate from QGLWidget to QOpenGLWidget and
QOpenGLContext before we can use gladLoadGLLoader() instead of
gladLoadGL(), since the former doesn’t expose a function loader.
2016-05-06 03:10:14 +01:00
bunnei
69a38e7b54 SDL2: Explicitly use RGB8 color buffer. 2016-03-14 21:59:16 -04:00
MerryMage
ba2a54a9dd Dependencies: Remove GLFW, Add SDL2
citra: Remove GLFW, Add SDL2

FindSDL2: Do not CACHE SDL2_* variables if library is not found

EmuWindow_SDL2: Set minimal client area at initialisation time

EmuWindow_SDL2: Corrections

EmuWindow_SDL2: Fix no decorations on startup on OS X

cmake: windows_copy_files
2016-03-02 14:09:02 +00:00
Yuri Kunde Schlesner
68eb197494 Increase required OpenGL version to 3.3
This gives us several niceties such as Sampler Objects, shader attribute
locations and Timer Queries.
2015-08-30 08:45:57 -03:00
Yuri Kunde Schlesner
a1a5570e97 Replace the previous OpenGL loader with a glad-generated 3.3 one
The main advantage of switching to glad from glLoadGen is that, apart
from being actively maintained, it supports a customizable entrypoint
loader function, which makes it possible to also support OpenGL ES.
2015-08-30 08:45:56 -03:00
James Rowe
1bc7829ee9 Move input values into an array 2015-07-27 21:41:21 -06:00