Allow resizing of testsprite
This commit is contained in:
parent
8209e2a9a9
commit
12098369fe
1 changed files with 4 additions and 1 deletions
|
@ -172,7 +172,7 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
numsprites = NUM_SPRITES;
|
numsprites = NUM_SPRITES;
|
||||||
videoflags = SDL_SWSURFACE | SDL_ANYFORMAT;
|
videoflags = SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE;
|
||||||
width = 640;
|
width = 640;
|
||||||
height = 480;
|
height = 480;
|
||||||
video_bpp = 8;
|
video_bpp = 8;
|
||||||
|
@ -297,6 +297,9 @@ main(int argc, char *argv[])
|
||||||
++frames;
|
++frames;
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
case SDL_VIDEORESIZE:
|
||||||
|
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, video_bpp, videoflags);
|
||||||
|
break;
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
SDL_WarpMouse(screen->w / 2, screen->h / 2);
|
SDL_WarpMouse(screen->w / 2, screen->h / 2);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue