mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 03:54:45 +00:00
Hide Cursor
Hiding Cursor implemented
This commit is contained in:
parent
5602debb22
commit
1435962bed
2 changed files with 12 additions and 1 deletions
|
@ -11,9 +11,18 @@
|
|||
#include "core/libraries/pad/pad.h"
|
||||
#include "input/controller.h"
|
||||
#include "sdl_window.h"
|
||||
#include <SDL3/SDL_mouse.h>
|
||||
|
||||
namespace Frontend {
|
||||
|
||||
void WindowSDL::CursorVisibility(bool cursor_visibility) {
|
||||
if (cursor_visibility) {
|
||||
SDL_HideCursor();
|
||||
} else {
|
||||
SDL_ShowCursor();
|
||||
}
|
||||
}
|
||||
|
||||
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_)
|
||||
: width{width_}, height{height_}, controller{controller_} {
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
|
@ -36,6 +45,7 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
|
|||
}
|
||||
|
||||
SDL_SetWindowFullscreen(window, Config::isFullscreenMode());
|
||||
CursorVisibility(true);
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32)
|
||||
window_info.type = WindowSystemType::Windows;
|
||||
|
@ -248,4 +258,4 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace Frontend
|
||||
} // namespace Frontend
|
|
@ -63,6 +63,7 @@ public:
|
|||
private:
|
||||
void onResize();
|
||||
void onKeyPress(const SDL_Event* event);
|
||||
void CursorVisibility(bool cursor_visibility);
|
||||
|
||||
private:
|
||||
s32 width;
|
||||
|
|
Loading…
Add table
Reference in a new issue