From 85ca9f7123728d4fe88a3e33890aed47193ef7fa Mon Sep 17 00:00:00 2001 From: Johan Althoff Date: Tue, 7 Aug 2007 18:03:36 +0000 Subject: [PATCH] added support to auto select bitdepth when windowed --- src/engine/client/gfx.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/engine/client/gfx.cpp b/src/engine/client/gfx.cpp index 0644f71e8..1e11bb046 100644 --- a/src/engine/client/gfx.cpp +++ b/src/engine/client/gfx.cpp @@ -121,12 +121,22 @@ bool gfx_init() { screen_width = config.gfx_screen_width; screen_height = config.gfx_screen_height; - - if(!context.create(screen_width, screen_height, 24, 8, 16, 0, - config.gfx_fullscreen?opengl::context::FLAG_FULLSCREEN:0)) + + if(config.gfx_fullscreen) { - dbg_msg("game", "failed to create gl context"); - return false; + if(!context.create(screen_width, screen_height, 24, 0, 0, 0, opengl::context::FLAG_FULLSCREEN)) + { + dbg_msg("game", "failed to create gl context"); + return false; + } + } + else + { + if(!context.create(screen_width, screen_height, 0, 0, 0, 0, 0)) + { + dbg_msg("game", "failed to create gl context"); + return false; + } }