testmouse: Create the window on the touch screen when building for the 3DS

This commit is contained in:
Cameron Cawley 2024-04-13 23:23:18 +01:00 committed by Sam Lantinga
parent 4df852cbbf
commit 154ec5c57a
1 changed files with 15 additions and 4 deletions

View File

@ -18,7 +18,13 @@
#include <stdlib.h> /* exit() */
#ifdef __IPHONEOS__
#ifdef __3DS__
/* For mouse-based tests, we want to have the window on the touch screen */
#define SCREEN_X 40
#define SCREEN_Y 240
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#elif defined(__IPHONEOS__)
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480
#else
@ -26,6 +32,13 @@
#define SCREEN_HEIGHT 480
#endif
#ifndef SCREEN_X
#define SCREEN_X SDL_WINDOWPOS_CENTERED
#endif
#ifndef SCREEN_Y
#define SCREEN_Y SDL_WINDOWPOS_CENTERED
#endif
static SDL_Window *window;
typedef struct _Object
@ -263,9 +276,7 @@ int main(int argc, char *argv[])
}
/* Create a window to display joystick axis position */
window = SDL_CreateWindow("Mouse Test", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
SCREEN_HEIGHT, 0);
window = SDL_CreateWindow("Mouse Test", SCREEN_X, SCREEN_Y, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
if (!window) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
return SDL_FALSE;