Draw all elements of actors and then call frame_core_flat

Property definitions

gamnit :: depth $ App :: frame_core_depth
	# Draw all elements of `actors` and then call `frame_core_flat`
	protected fun frame_core_depth(display: GamnitDisplay)
	do
		frame_core_depth_clock.lapse

		# Compute shadows
		if light isa LightCastingShadows then
			frame_core_shadow_prep display
			perfs["gamnit depth shadows"].add frame_core_depth_clock.lapse
		end

		glViewport(0, 0, display.width, display.height)
		frame_core_dynamic_resolution_before display
		perfs["gamnit depth dynres"].add frame_core_depth_clock.lapse

		for actor in actors do
			for leaf in actor.model.leaves do
				leaf.material.draw(actor, leaf, app.world_camera)
				assert glGetError == gl_NO_ERROR else print_error "Gamnit error on material {leaf.material.class_name}"
			end
		end
		perfs["gamnit depth actors"].add frame_core_depth_clock.lapse

		frame_core_world_sprites display
		perfs["gamnit depth sprites"].add frame_core_depth_clock.lapse

		# Toggle writing to the depth buffer for particles effects
		glDepthMask false
		for system in particle_systems do
			system.draw
			assert glGetError == gl_NO_ERROR else print_error "OpenGL error in {system}"
		end
		glDepthMask true
		perfs["gamnit depth particles"].add frame_core_depth_clock.lapse

		# Stop using the dynamic resolution before drawing UI sprites
		frame_core_dynamic_resolution_after display

		frame_core_ui_sprites display
		perfs["gamnit depth ui_sprites"].add frame_core_depth_clock.lapse

		# Debug, show the light point of view
		#frame_core_shadow_debug display
	end
lib/gamnit/depth/depth.nit:55,2--98,4