From e4e5d03fa6dc52795e66ac2693e0fe0e0d85c9af Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Sun, 10 Jan 2021 18:25:16 +0800 Subject: [PATCH] native,ioe,gpu: support 800x600 mode --- am/src/native/native-gpu.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/am/src/native/native-gpu.c b/am/src/native/native-gpu.c index 67055ea..3bd8f2b 100644 --- a/am/src/native/native-gpu.c +++ b/am/src/native/native-gpu.c @@ -1,8 +1,15 @@ #include #include -#define W 400 -#define H 300 +//#define MODE_800x600 +#ifdef MODE_800x600 +# define W 800 +# define H 600 +#else +# define W 400 +# define H 300 +#endif + #define FPS 60 static SDL_Window *window = NULL; @@ -23,7 +30,13 @@ static Uint32 texture_sync(Uint32 interval, void *param) { void __am_gpu_init() { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER); - SDL_CreateWindowAndRenderer(W * 2, H * 2, 0, &window, &renderer); + SDL_CreateWindowAndRenderer( +#ifdef MODE_800x600 + W, H, +#else + W * 2, H * 2, +#endif + 0, &window, &renderer); SDL_SetWindowTitle(window, "Native Application"); texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, W, H);