main()
The main() function uses a default configuration for Mir and sets up an InprocessEGLClient that accesses the graphics platform and surface factory.
This InprocessEGLClient sets up a single surface
auto session = shell->open_session(getpid(), "Inprocess client", std::make_shared<NullEventSink>());
auto surface = session->get_surface(shell->create_surface_for(session, params));
input_thread = input_platform->create_input_thread(
surface->client_input_fd(),
std::bind(std::mem_fn(&me::InprocessEGLClient::handle_event), this, std::placeholders::_1));
input_thread->start();
auto internal_client = graphics_platform->create_internal_client();
me::EGLHelper helper(internal_client->egl_native_display(), internal_client->egl_native_window(internal_surface));
auto rc = eglMakeCurrent(helper.the_display(), helper.the_surface(), helper.the_surface(), helper.the_context());
assert(rc == EGL_TRUE);
And loops updating the surface
while(!terminate)
{
rc = eglSwapBuffers(helper.the_display(), helper.the_surface());
assert(rc == EGL_TRUE);
}
(void)rc;
input_thread->stop();