1 // SPDX-FileCopyrightText: Copyright 2012 Intel Corporation
2 // SPDX-License-Identifier: BSD-2-Clause
6 #include "wcore_error.h"
8 #include "posix_platform.h"
10 #include "wegl_config.h"
11 #include "wegl_context.h"
12 #include "wegl_util.h"
14 #include "droid_display.h"
15 #include "droid_platform.h"
16 #include "droid_window.h"
18 static const struct wcore_platform_vtbl droid_platform_vtbl
;
21 droid_platform_destroy(struct wcore_platform
*wc_self
)
23 struct droid_platform
*self
= droid_platform(wc_self
);
25 posix_platform_teardown(wc_self
);
30 struct wcore_platform
*
31 droid_platform_create(void)
33 static const char *dso_names
[] = {
38 struct droid_platform
*self
;
40 self
= wcore_calloc(sizeof(*self
));
44 wcore_platform_init(&self
->wcore
);
45 posix_platform_init(&self
->wcore
, dso_names
);
47 self
->wcore
.vtbl
= &droid_platform_vtbl
;
51 static const struct wcore_platform_vtbl droid_platform_vtbl
= {
52 .destroy
= droid_platform_destroy
,
54 .make_current
= wegl_make_current
,
55 .get_proc_address
= wegl_get_proc_address
,
56 .dl_can_open
= posix_platform_can_dlopen
,
57 .dl_sym
= posix_platform_dlsym
,
60 .connect
= droid_display_connect
,
61 .destroy
= droid_display_disconnect
,
62 .supports_context_api
= wegl_display_supports_context_api
,
67 .choose
= wegl_config_choose
,
68 .destroy
= wegl_config_destroy
,
73 .create
= wegl_context_create
,
74 .destroy
= wegl_context_destroy
,
79 .create
= droid_window_create
,
80 .destroy
= droid_window_destroy
,
81 .show
= droid_window_show
,
82 .swap_buffers
= wegl_surface_swap_buffers
,
83 .resize
= droid_window_resize
,