mirror of
https://github.com/encounter/SDL.git
synced 2025-12-17 00:47:15 +00:00
SWITCH: add joystick support
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
/* SDL internals */
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
@@ -88,6 +89,9 @@ static int SWITCH_VideoInit(_THIS)
|
||||
{
|
||||
SDL_DisplayMode mode;
|
||||
|
||||
consoleDebugInit(debugDevice_SVC);
|
||||
stdout = stderr;
|
||||
|
||||
gfxInitResolution(SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
gfxInitDefault();
|
||||
gfxSetMode(GfxMode_LinearDouble);
|
||||
@@ -119,7 +123,14 @@ static int SWITCH_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMo
|
||||
|
||||
static void SWITCH_PumpEvents(_THIS)
|
||||
{
|
||||
// TODO
|
||||
if (!appletMainLoop()) {
|
||||
SDL_Event ev;
|
||||
ev.type = SDL_QUIT;
|
||||
SDL_PushEvent(&ev);
|
||||
return;
|
||||
}
|
||||
|
||||
hidScanInput();
|
||||
}
|
||||
|
||||
typedef struct
|
||||
@@ -139,6 +150,8 @@ static int SWITCH_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *for
|
||||
*format = SDL_PIXELFORMAT_ABGR8888;
|
||||
*pixels = gfxGetFramebuffer(NULL, NULL);
|
||||
|
||||
SDL_SetKeyboardFocus(window);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user