From 4bfd5a905b5fb4489abf5daabb0986ea523a18c2 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sat, 28 Aug 2010 17:03:21 +0200 Subject: [PATCH] setMode now accepts 0, 0 as width and height for screen width and height --- src/modules/graphics/opengl/Graphics.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 4a958a7f1..28e58d283 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -213,6 +213,13 @@ namespace opengl } } + if (width == 0 || height == 0) + { + const SDL_VideoInfo* videoinfo = SDL_GetVideoInfo(); + width = videoinfo->current_w; + height = videoinfo->current_h; + } + // Check if FSAA failed or not if(fsaa > 0) { @@ -306,7 +313,7 @@ namespace opengl { SDL_GL_SwapBuffers(); } - + void Graphics::setIcon(Image * image) { Uint32 rmask, gmask, bmask, amask;