From 8d3a8ecaf4f20ed8c460ab75724c7bf8363e905a Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Sat, 18 Sep 2021 23:13:59 +0300 Subject: [PATCH] extern "C" so that I can also use c++ --- src/main.c | 2 +- src/util.h | 8 ++++++++ src/vk.c | 2 +- src/vk.h | 9 +++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 94d6269..af4277c 100644 --- a/src/main.c +++ b/src/main.c @@ -33,7 +33,7 @@ display(void); static GLFWwindow *win; static bool redraw_pending; -static bool vk_enable_layers; +static bool vk_enable_layers = true; static int win_w = 800; static int win_h = 600; diff --git a/src/util.h b/src/util.h index 97abe8a..d4e9d71 100644 --- a/src/util.h +++ b/src/util.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + char * sdr_load(const char *fname, int *sz); @@ -11,4 +15,8 @@ img_dump_rgba(const char *fname, int w, int h, unsigned char *data); +#ifdef __cplusplus +} +#endif + #endif /* UTIL_H */ diff --git a/src/vk.c b/src/vk.c index 480b6b8..5aabed1 100644 --- a/src/vk.c +++ b/src/vk.c @@ -1018,7 +1018,7 @@ are_props_supported(struct vk_ctx *ctx, struct vk_att_props *props) VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2; img_fmt_info.pNext = props->need_export ? &ext_img_fmt_info : 0; img_fmt_info.format = props->format; - img_fmt_info.type = get_image_type(props->h, props->depth); + img_fmt_info.type = VK_IMAGE_TYPE_2D; img_fmt_info.tiling = props->tiling; for (i = 0; i < ARRAY_SIZE(all_flags); i++) { diff --git a/src/vk.h b/src/vk.h index 6d4b05e..2750d84 100644 --- a/src/vk.h +++ b/src/vk.h @@ -120,6 +120,10 @@ struct vk_semaphores VkSemaphore frame_done; }; +#ifdef __cplusplus +extern "C" { +#endif + /* context */ bool vk_init_ctx(struct vk_ctx *ctx, @@ -305,4 +309,9 @@ vk_transition_image_layout(struct vk_attachment *img_att, uint32_t src_queue_family_index, uint32_t dst_queue_family_index); + +#ifdef __cplusplus +} +#endif + #endif /* VK_H */ -- 1.7.10.4