From 6666744827856c07f315a6dfc2344b30f8832b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 1 Oct 2013 23:08:50 +0000 Subject: [PATCH] [OPENGL32] - Initialize the viewport when setting the context as current for the first time. svn path=/trunk/; revision=60510 --- reactos/dll/opengl/opengl32/swimpl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/dll/opengl/opengl32/swimpl.c b/reactos/dll/opengl/opengl32/swimpl.c index 195401836c8..3efa591a0d8 100644 --- a/reactos/dll/opengl/opengl32/swimpl.c +++ b/reactos/dll/opengl/opengl32/swimpl.c @@ -13,6 +13,7 @@ #include
#include
#include
+#include
#include #include #include @@ -758,6 +759,15 @@ BOOL sw_SetContext(struct wgl_dc_data* dc_data, DHGLRC dhglrc) 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);