]> git.tdb.fi Git - libs/gl.git/commitdiff
Immediately process window size to set correct viewport size
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Sep 2017 12:33:41 +0000 (15:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Sep 2017 12:33:41 +0000 (15:33 +0300)
The system framebuffer acquires its size from the window when the GL
context is created, but in some use cases the window may change size
before a View is created on it.

source/view.cpp

index 1518b6ee76b6012f51a4774ba7b5a5635e554d9d..b4dcca99cc4a4f6b6bb6839df1ee39bf8f99fc23 100644 (file)
@@ -17,6 +17,7 @@ View::View(Graphics::Window &w, Graphics::GLContext &c):
        content(0)
 {
        window.signal_resize.connect(sigc::mem_fun(this, &View::window_resized));
+       window_resized(window.get_width(), window.get_height());
 }
 
 void View::set_camera(Camera *c)