1 | /* GDK - The GIMP Drawing Kit |
2 | * |
3 | * gdkvulkancontext.h: specific Vulkan wrappers |
4 | * |
5 | * Copyright © 2016 Benjamin Otte |
6 | * |
7 | * This library is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU Library General Public |
9 | * License as published by the Free Software Foundation; either |
10 | * version 2 of the License, or (at your option) any later version. |
11 | * |
12 | * This library is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | * Library General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU Library General Public |
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
19 | */ |
20 | |
21 | #ifndef __GDK_VULKAN_CONTEXT__ |
22 | #define __GDK_VULKAN_CONTEXT__ |
23 | |
24 | #if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION) |
25 | #error "Only <gdk/gdk.h> can be included directly." |
26 | #endif |
27 | |
28 | #include <gdk/gdkversionmacros.h> |
29 | #include <gdk/gdktypes.h> |
30 | |
31 | #ifdef GDK_RENDERING_VULKAN |
32 | #include <vulkan/vulkan.h> |
33 | #endif |
34 | |
35 | G_BEGIN_DECLS |
36 | |
37 | #define GDK_TYPE_VULKAN_CONTEXT (gdk_vulkan_context_get_type ()) |
38 | #define GDK_VULKAN_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_VULKAN_CONTEXT, GdkVulkanContext)) |
39 | #define GDK_IS_VULKAN_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_VULKAN_CONTEXT)) |
40 | |
41 | #define GDK_VULKAN_ERROR (gdk_vulkan_error_quark ()) |
42 | |
43 | GDK_AVAILABLE_IN_ALL |
44 | GQuark gdk_vulkan_error_quark (void); |
45 | |
46 | GDK_AVAILABLE_IN_ALL |
47 | GType gdk_vulkan_context_get_type (void) G_GNUC_CONST; |
48 | |
49 | #ifndef __GI_SCANNER__ |
50 | #ifdef GDK_RENDERING_VULKAN |
51 | |
52 | GDK_AVAILABLE_IN_ALL |
53 | const char * gdk_vulkan_strerror (VkResult result); |
54 | |
55 | GDK_AVAILABLE_IN_ALL |
56 | VkInstance gdk_vulkan_context_get_instance (GdkVulkanContext *context); |
57 | GDK_AVAILABLE_IN_ALL |
58 | VkPhysicalDevice gdk_vulkan_context_get_physical_device (GdkVulkanContext *context); |
59 | GDK_AVAILABLE_IN_ALL |
60 | VkDevice gdk_vulkan_context_get_device (GdkVulkanContext *context); |
61 | GDK_AVAILABLE_IN_ALL |
62 | VkQueue gdk_vulkan_context_get_queue (GdkVulkanContext *context); |
63 | GDK_AVAILABLE_IN_ALL |
64 | uint32_t gdk_vulkan_context_get_queue_family_index (GdkVulkanContext *context); |
65 | GDK_AVAILABLE_IN_ALL |
66 | VkFormat gdk_vulkan_context_get_image_format (GdkVulkanContext *context); |
67 | GDK_AVAILABLE_IN_ALL |
68 | uint32_t gdk_vulkan_context_get_n_images (GdkVulkanContext *context); |
69 | GDK_AVAILABLE_IN_ALL |
70 | VkImage gdk_vulkan_context_get_image (GdkVulkanContext *context, |
71 | guint id); |
72 | GDK_AVAILABLE_IN_ALL |
73 | uint32_t gdk_vulkan_context_get_draw_index (GdkVulkanContext *context); |
74 | GDK_AVAILABLE_IN_ALL |
75 | VkSemaphore gdk_vulkan_context_get_draw_semaphore (GdkVulkanContext *context); |
76 | |
77 | #endif /* GDK_RENDERING_VULKAN */ |
78 | #endif /* __GI_SCANNER__ */ |
79 | |
80 | G_END_DECLS |
81 | |
82 | #endif /* __GDK_VULKAN_CONTEXT__ */ |
83 | |