extern "C" so that I can also use c++
authorEleni Maria Stea <estea@igalia.com>
Sat, 18 Sep 2021 20:13:59 +0000 (23:13 +0300)
committerEleni Maria Stea <estea@igalia.com>
Sat, 18 Sep 2021 20:13:59 +0000 (23:13 +0300)
src/main.c
src/util.h
src/vk.c
src/vk.h

index 94d6269..af4277c 100644 (file)
@@ -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;
index 97abe8a..d4e9d71 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <stdbool.h>
 
+#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 */
index 480b6b8..5aabed1 100644 (file)
--- 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++) {
index 6d4b05e..2750d84 100644 (file)
--- 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 */