From 55220453207d0bb0f1265dfa139812a9441f72c4 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Mon, 12 Jun 2006 15:50:27 +0000 Subject: [PATCH] As reported by Fredrik Ekdahli, the GL viewport should be set by default as soon as the view is attached to a window. But the default size is the view one, not the view's window size, which doesn't make much sense. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17798 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/opengl/GLView.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kits/opengl/GLView.cpp b/src/kits/opengl/GLView.cpp index e14085c344..0c3e00f20e 100644 --- a/src/kits/opengl/GLView.cpp +++ b/src/kits/opengl/GLView.cpp @@ -128,7 +128,12 @@ void BGLView::AttachedToWindow() if (fRenderer) { // Don't paint white window background when resized SetViewColor(B_TRANSPARENT_32_BIT); - return fRenderer->AttachedToWindow(); + fRenderer->AttachedToWindow(); + + // Set default OpenGL viewport: + glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); + + return; } // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing context