Merge: gamnit: fix color buffer clearing issues on some computers
authorJean Privat <jean@pryen.org>
Fri, 9 Jun 2017 14:55:14 +0000 (10:55 -0400)
committerJean Privat <jean@pryen.org>
Fri, 9 Jun 2017 14:55:14 +0000 (10:55 -0400)
This PR clear the drawing buffers *after* selecting the target framebuffer, even when the buffer does not change. This should fix the issue @BlackMinou was having (the color buffer not being cleared) when running Tinks! 3D or https://gitlab.com/xymus/jumpngun.

However, this does not fix a similar issue on my desktop computer and I think an issue remained with the depth buffer on @BlackMinou computer.

Pull-Request: #2480

1  2 
lib/gamnit/dynamic_resolution.nit
lib/gamnit/flat.nit

Simple merge
@@@ -372,22 -373,8 +372,19 @@@ redef class Ap
                if display != null then display.close
        end
  
 +      redef fun on_resize(display)
 +      do
 +              super
 +
 +              world_camera.mvp_matrix_cache = null
 +              ui_camera.mvp_matrix_cache = null
 +
 +              # Update all sprites in the UI
 +              for sprite in ui_sprites do sprite.needs_update
 +      end
 +
        redef fun frame_core(display)
        do
-               # Prepare to draw, clear buffers
-               glClear(gl_COLOR_BUFFER_BIT | gl_DEPTH_BUFFER_BIT)
                # Check errors
                var gl_error = glGetError
                assert gl_error == gl_NO_ERROR else print_error gl_error