mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
testmouse: Create the window on the touch screen when building for the 3DS
This commit is contained in:

committed by
Sam Lantinga

parent
4df852cbbf
commit
154ec5c57a
@@ -18,7 +18,13 @@
|
|||||||
|
|
||||||
#include <stdlib.h> /* exit() */
|
#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_WIDTH 320
|
||||||
#define SCREEN_HEIGHT 480
|
#define SCREEN_HEIGHT 480
|
||||||
#else
|
#else
|
||||||
@@ -26,6 +32,13 @@
|
|||||||
#define SCREEN_HEIGHT 480
|
#define SCREEN_HEIGHT 480
|
||||||
#endif
|
#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;
|
static SDL_Window *window;
|
||||||
|
|
||||||
typedef struct _Object
|
typedef struct _Object
|
||||||
@@ -263,9 +276,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create a window to display joystick axis position */
|
/* Create a window to display joystick axis position */
|
||||||
window = SDL_CreateWindow("Mouse Test", SDL_WINDOWPOS_CENTERED,
|
window = SDL_CreateWindow("Mouse Test", SCREEN_X, SCREEN_Y, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
|
||||||
SCREEN_HEIGHT, 0);
|
|
||||||
if (!window) {
|
if (!window) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
Reference in New Issue
Block a user