native,ioe,gpu: support 800x600 mode
This commit is contained in:
parent
18995de269
commit
e4e5d03fa6
1 changed files with 16 additions and 3 deletions
|
@ -1,8 +1,15 @@
|
||||||
#include <am.h>
|
#include <am.h>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
#define W 400
|
//#define MODE_800x600
|
||||||
#define H 300
|
#ifdef MODE_800x600
|
||||||
|
# define W 800
|
||||||
|
# define H 600
|
||||||
|
#else
|
||||||
|
# define W 400
|
||||||
|
# define H 300
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FPS 60
|
#define FPS 60
|
||||||
|
|
||||||
static SDL_Window *window = NULL;
|
static SDL_Window *window = NULL;
|
||||||
|
@ -23,7 +30,13 @@ static Uint32 texture_sync(Uint32 interval, void *param) {
|
||||||
|
|
||||||
void __am_gpu_init() {
|
void __am_gpu_init() {
|
||||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
|
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");
|
SDL_SetWindowTitle(window, "Native Application");
|
||||||
texture = SDL_CreateTexture(renderer,
|
texture = SDL_CreateTexture(renderer,
|
||||||
SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, W, H);
|
SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, W, H);
|
||||||
|
|
Loading…
Add table
Reference in a new issue