diff --git a/src/sdl/main.c b/src/sdl/main.c
index 5706cc75c95c5d490414e2673a56725522e724e7..0b1aada10b2c8886093651c5401a8fbab2eca3e9 100644 (file)
--- a/src/sdl/main.c
+++ b/src/sdl/main.c
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <SDL.h>
+#include "SDL.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h> // srand exit
return s != NULL;
}
+void Y_get_videomode (int *w, int *h) {
+ if (surf != NULL) {
+ *w = surf->w;
+ *h = surf->h;
+ } else {
+ *w = 0;
+ *h = 0;
+ }
+}
+
int Y_videomode_setted (void) {
return surf != NULL;
}
SDL_InitSubSystem(SDL_INIT_VIDEO);
}
-int Y_set_fullscreen (int yes) {
- //SDL_WM_ToggleFullScreen();
- return 0;
+void Y_set_fullscreen (int yes) {
+ assert(surf != NULL);
+ int flags = 0;
+ if ((surf->flags & SDL_FULLSCREEN) == 0) {
+ flags |= SYSTEM_USE_FULLSCREEN;
+ }
+ if (surf->flags & SDL_OPENGL) {
+ flags |= SDL_OPENGL;
+ }
+ Y_set_videomode(surf->w, surf->h, flags);
}
int Y_get_fullscreen (void) {