Author: jgardou Date: Tue Oct 1 23:08:50 2013 New Revision: 60510
URL: http://svn.reactos.org/svn/reactos?rev=60510&view=rev Log: [OPENGL32] - Initialize the viewport when setting the context as current for the first time.
Modified: trunk/reactos/dll/opengl/opengl32/swimpl.c
Modified: trunk/reactos/dll/opengl/opengl32/swimpl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/swimpl.... ============================================================================== --- trunk/reactos/dll/opengl/opengl32/swimpl.c [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/swimpl.c [iso-8859-1] Tue Oct 1 23:08:50 2013 @@ -13,6 +13,7 @@ #include <main/framebuffer.h> #include <main/renderbuffer.h> #include <main/shared.h> +#include <main/viewport.h> #include <swrast/s_context.h> #include <swrast/s_renderbuffer.h> #include <swrast_setup/swrast_setup.h> @@ -758,6 +759,15 @@ ERR("_mesa_make_current filaed!\n"); return FALSE; } + + /* Set the viewport if this is the first time we initialize this context */ + if(sw_ctx->mesa.Viewport.X == 0 && + sw_ctx->mesa.Viewport.Y == 0 && + sw_ctx->mesa.Viewport.Width == 0 && + sw_ctx->mesa.Viewport.Height == 0) + { + _mesa_set_viewport(&sw_ctx->mesa, 0, 0, width, height); + }
/* update the framebuffer size */ _mesa_resize_framebuffer(&sw_ctx->mesa, fb->gl_buffer, width, height);