RDK Resources

[*ASP Wiki*]

Code Management Facility

Code Releases

RDK Forums

[RDK Conferences]

RDK Support


Papers & Presentations Archive

In the News!

Skip to end of metadata
Go to start of metadata

The app manager has the job of running a wayland compositor for all the apps it runs. Before painting to the screen apps will connect to this compositor using wayland calls.

The following is a general graphics setup flow.

// Connect to compositor
display= wl_display_connect(display_name);  // A NULL display name connects to default WAYLAND_DISPLAY set by app manager

// Use the registry as the hook to connect to the rest of the wayland callbacks
registry= wl_display_get_registry(display); 
wl_registry_add_listener(registry, &registryListener, &ctx);

// Complete communication to compositor for above commands

// Setup EGL

// Use the the wayland display to get the egl display
ctx->eglDisplay = eglGetDisplay((NativeDisplayType)display);
// Continue setting up EGL...

// Create a surface with the compositor
// Get compositor reference from wayland registry callback
// Create surface
ctx->surface= wl_compositor_create_surface(ctx->compositor);

// Create egl window from surface
ctx->native= wl_egl_window_create(ctx->surface, ctx->planeWidth, ctx->planeHeight);

// Continue setting up surface with normal egl calls..

// Do Open GL setup for your app

// Run graphics app loop
while (shouldRunMainLoop)
  // dispatch queued wayland events on default queue, can also use blocking method wl_display_dispatch

  // render your gl scene

  // swap buffers
  eglSwapBuffers(eglDisplay, eglSurfaceWindow);
  • No labels