Monado OpenXR Runtime
comp_window_android.c File Reference

Android window code. More...

#include "xrt/xrt_compiler.h"
#include "util/u_misc.h"
#include "android/android_globals.h"
#include "android/android_custom_surface.h"
#include "main/comp_window.h"
#include <android/native_window.h>
#include <poll.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <linux/input.h>
Include dependency graph for comp_window_android.c:

Data Structures

struct  comp_window_android
 An Android window. More...
 

Macros

#define WINDOW_TITLE   "Monado"
 

Functions

static struct vk_bundleget_vk (struct comp_window_android *cwa)
 
static bool comp_window_android_init (struct comp_target *ct)
 
static void comp_window_android_destroy (struct comp_target *ct)
 
static void comp_window_android_update_window_title (struct comp_target *ct, const char *title)
 
static struct ANativeWindow * _create_android_window (struct comp_window_android *cwa)
 
static VkResult comp_window_android_create_surface (struct comp_window_android *cwa, struct ANativeWindow *window, VkSurfaceKHR *out_surface)
 
static bool comp_window_android_init_swapchain (struct comp_target *ct, uint32_t width, uint32_t height)
 
static void comp_window_android_flush (struct comp_target *ct)
 
struct comp_targetcomp_window_android_create (struct comp_compositor *c)
 
static bool detect (const struct comp_target_factory *ctf, struct comp_compositor *c)
 
static bool create_target (const struct comp_target_factory *ctf, struct comp_compositor *c, struct comp_target **out_ct)
 

Variables

static const char * instance_extensions []
 
const struct comp_target_factory comp_target_factory_android
 

Detailed Description

Variable Documentation

◆ comp_target_factory_android

const struct comp_target_factory comp_target_factory_android
Initial value:
= {
.name = "Android",
.identifier = "android",
.requires_vulkan_for_create = false,
.is_deferred = true,
.required_instance_version = 0,
.required_instance_extensions = instance_extensions,
.required_instance_extension_count = ARRAY_SIZE(instance_extensions),
.optional_device_extensions = NULL,
.optional_device_extension_count = 0,
.detect = detect,
.create_target = create_target,
}
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:30

◆ instance_extensions

const char* instance_extensions[]
static
Initial value:
= {
VK_KHR_ANDROID_SURFACE_EXTENSION_NAME,
}