1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gdk.VulkanContext; 26 27 private import gdk.DrawContext; 28 private import gdk.c.functions; 29 public import gdk.c.types; 30 private import gio.InitableIF; 31 private import gio.InitableT; 32 private import gobject.Signals; 33 private import std.algorithm; 34 35 36 /** 37 * `GdkVulkanContext` is an object representing the platform-specific 38 * Vulkan draw context. 39 * 40 * `GdkVulkanContext`s are created for a surface using 41 * [method@Gdk.Surface.create_vulkan_context], and the context will match 42 * the the characteristics of the surface. 43 * 44 * Support for `GdkVulkanContext` is platform-specific and context creation 45 * can fail, returning %NULL context. 46 */ 47 public class VulkanContext : DrawContext, InitableIF 48 { 49 /** the main Gtk struct */ 50 protected GdkVulkanContext* gdkVulkanContext; 51 52 /** Get the main Gtk struct */ 53 public GdkVulkanContext* getVulkanContextStruct(bool transferOwnership = false) 54 { 55 if (transferOwnership) 56 ownedRef = false; 57 return gdkVulkanContext; 58 } 59 60 /** the main Gtk struct as a void* */ 61 protected override void* getStruct() 62 { 63 return cast(void*)gdkVulkanContext; 64 } 65 66 /** 67 * Sets our main struct and passes it to the parent class. 68 */ 69 public this (GdkVulkanContext* gdkVulkanContext, bool ownedRef = false) 70 { 71 this.gdkVulkanContext = gdkVulkanContext; 72 super(cast(GdkDrawContext*)gdkVulkanContext, ownedRef); 73 } 74 75 // add the Initable capabilities 76 mixin InitableT!(GdkVulkanContext); 77 78 79 /** */ 80 public static GType getType() 81 { 82 return gdk_vulkan_context_get_type(); 83 } 84 85 /** 86 * Emitted when the images managed by this context have changed. 87 * 88 * Usually this means that the swapchain had to be recreated, 89 * for example in response to a change of the surface size. 90 */ 91 gulong addOnImagesUpdated(void delegate(VulkanContext) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 92 { 93 return Signals.connect(this, "images-updated", dlg, connectFlags ^ ConnectFlags.SWAPPED); 94 } 95 }