Setup the EGL context for the given native_window

Property definitions

gamnit :: egl $ GamnitDisplay :: setup_egl_context
	# Setup the EGL context for the given `native_window`
	protected fun setup_egl_context(native_window: Pointer)
	do
		var window_surface = egl_display.create_window_surface(egl_config, native_window, [0])
		assert window_surface.is_ok else print "Creating EGL window surface failed: {egl_display.error}"
		self.window_surface = window_surface

		egl_context = egl_display.create_context(egl_config)
		assert egl_context.is_ok else print "Creating EGL context failed: {egl_display.error}"

		var make_current_res = egl_display.make_current(window_surface, window_surface, egl_context)
		assert make_current_res else print "Creating EGL make current failed: {egl_display.error}"

		# TODO make the API selection configurable per platform
		assert egl_bind_opengl_es_api else print "EGL bind API failed: {egl_display.error}"
	end
lib/gamnit/egl.nit:86,2--101,4