Ensure that the Window._create_projection() method is called, before `on_resize`
event is dispatched by `set_visible`.
@@ -602,12 +602,12 @@ class BaseWindow(with_metaclass(_WindowMetaclass, EventDispatcher)):
self.switch_to()
+ self._create_projection()
+
if visible:
self.set_visible(True)
self.activate()
- self._create_projection()
-
def _create_projection(self):
self._default_program = shader.ShaderProgram(shader.Shader(self._default_vertex_source, 'vertex'))
self.ubo = self._default_program.uniform_blocks['WindowBlock'].create_ubo()
