commit b82bc4149f4e6bfa70ae20f9ddef928fdf44d904 parent 11a7af72bf36a3fde504a61f7f3fe4810e590581 Author: Michael Savage <mikejsavage@gmail.com> Date: Sun, 4 Aug 2019 00:59:58 +0300 glViewport with window size in begin_frame Diffstat:
M | renderer.cc | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -141,6 +141,13 @@ void renderer_begin_frame() { ubos[ i ].bytes_used = 0; ASSERT( ubos[ i ].buffer != NULL ); } + + v2u32 window_size = get_window_size(); + if( window_size.x != previous_viewport_width || window_size.y != previous_viewport_height ) { + previous_viewport_width = window_size.x; + previous_viewport_height = window_size.y; + glViewport( 0, 0, window_size.x, window_size.y ); + } } static GLenum depthfunc_to_glenum( DepthFunc depth_func ) {