summaryrefslogtreecommitdiff
path: root/framebuffer/fb_frontend_sdl.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-02-26 18:58:03 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-02-26 18:58:03 +0000
commit2fa78a799b3b4e5ee2bb8b846f2597d7eea88912 (patch)
treec93afe85cc5b571aaeb7253905326bd5b43107e1 /framebuffer/fb_frontend_sdl.c
parent12f07aa8fd6ae7582aa10db0ade34ef78f4cd5c4 (diff)
downloadnetsurf-2fa78a799b3b4e5ee2bb8b846f2597d7eea88912.tar.gz
netsurf-2fa78a799b3b4e5ee2bb8b846f2597d7eea88912.tar.bz2
Improve option handling code in frontends
Improve depth handling in the VNC frontend svn path=/trunk/netsurf/; revision=6641
Diffstat (limited to 'framebuffer/fb_frontend_sdl.c')
-rw-r--r--framebuffer/fb_frontend_sdl.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/framebuffer/fb_frontend_sdl.c b/framebuffer/fb_frontend_sdl.c
index 36d5af218..4a9e26476 100644
--- a/framebuffer/fb_frontend_sdl.c
+++ b/framebuffer/fb_frontend_sdl.c
@@ -37,6 +37,7 @@
#include "framebuffer/fb_frontend.h"
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_rootwindow.h"
+#include "framebuffer/fb_options.h"
#include "utils/log.h"
@@ -47,6 +48,21 @@ static SDL_Surface *sdl_screen;
framebuffer_t *fb_os_init(int argc, char** argv)
{
framebuffer_t *newfb;
+ int fb_width;
+ int fb_height;
+ int fb_depth;
+
+ if ((option_window_width != 0) && (option_window_height != 0)) {
+ fb_width = option_window_width;
+ fb_height = option_window_height;
+ } else {
+ fb_width = 800;
+ fb_height = 600;
+ }
+
+ fb_depth = option_fb_depth;
+ if ((fb_depth != 32) && (fb_depth != 16) && (fb_depth != 8))
+ fb_depth = 16; /* sanity checked depth in bpp */
newfb = calloc(1, sizeof(framebuffer_t));
if (newfb == NULL)
@@ -58,9 +74,9 @@ framebuffer_t *fb_os_init(int argc, char** argv)
}
atexit(SDL_Quit);
- newfb->width = 800;
- newfb->height = 600;
- newfb->bpp = 32;
+ newfb->width = fb_width;
+ newfb->height = fb_height;
+ newfb->bpp = fb_depth;
sdl_screen = SDL_SetVideoMode(newfb->width,
newfb->height,