// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) var xVulkanErrorQuark func() glib.Quark // Registers an error quark for [class@Gdk.VulkanContext] errors. func VulkanErrorQuark() glib.Quark { cret := xVulkanErrorQuark() return cret } // Represents the platform-specific Vulkan draw context. // // `GdkVulkanContext`s are created for a surface using // [method@Gdk.Surface.create_vulkan_context], and the context will match // the characteristics of the surface. // // Support for `GdkVulkanContext` is platform-specific and context creation // can fail, returning %NULL context. type VulkanContext struct { DrawContext } var xVulkanContextGLibType func() types.GType func VulkanContextGLibType() types.GType { return xVulkanContextGLibType() } func VulkanContextNewFromInternalPtr(ptr uintptr) *VulkanContext { cls := &VulkanContext{} cls.Ptr = ptr return cls } func (c *VulkanContext) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *VulkanContext) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // Emitted when the images managed by this context have changed. // // Usually this means that the swapchain had to be recreated, // for example in response to a change of the surface size. func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr) { fa := VulkanContext{} fa.Ptr = clsPtr cbFn := *cb cbFn(fa) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } func init() { core.SetPackageName("GDK", "gtk4") core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GDK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xVulkanErrorQuark, libs, "gdk_vulkan_error_quark") core.PuregoSafeRegister(&xVulkanContextGLibType, libs, "gdk_vulkan_context_get_type") }