• Advertisement
Sign in to follow this  

Glfw3.2 bindings for c#

Recommended Posts

My question is are there any maintained glfw3.2 bindings for C# which also has support for Vulkan. I can't find any that has supports both.

Share this post


Link to post
Share on other sites
Advertisement

I am not sure about any ready-made wrappers.

However, my Vulkan backend which uses glfw contains only about 10-15 glfw function calls. That should get you up and running with a render window and Vulkan compatible surface. Seems to me like it would be fairly easy to make a small C# wrapper yourself for only what you need to get started. Seeing as glfw is a C library it should be straightforward to import the C functions using DLLImport or something similar. You can then add more functions from the glfw API as needed. That said, I am not sure if the Vulkan API itself is easily usable from C#.

Share this post


Link to post
Share on other sites

I'm sure I'm misunderstanding this, but because the PhysicalDevice class is implementing IMarshalling, it should have a method called Handle which returns an IntPtr, but it don't see it in the class.

 public interface IMarshalling
    {
        IntPtr Handle { get; }
    }
public class PhysicalDevice : IMarshalling
    {
        public IntPtr AcquireXlibDisplayEXT(DisplayKhr display);
        public Device CreateDevice(DeviceCreateInfo pCreateInfo, AllocationCallbacks pAllocator = null);
        public DisplayModeKhr CreateDisplayModeKHR(DisplayKhr display, DisplayModeCreateInfoKhr pCreateInfo, AllocationCallbacks pAllocator = null);
        public ExtensionProperties[] EnumerateDeviceExtensionProperties(string pLayerName = null);
        public LayerProperties[] EnumerateDeviceLayerProperties();
        public DisplayModePropertiesKhr[] GetDisplayModePropertiesKHR(DisplayKhr display);
        public DisplayPlaneCapabilitiesKhr GetDisplayPlaneCapabilitiesKHR(DisplayModeKhr mode, uint planeIndex);
        public DisplayPlanePropertiesKhr[] GetDisplayPlanePropertiesKHR();
        public DisplayKhr[] GetDisplayPlaneSupportedDisplaysKHR(uint planeIndex);
        public DisplayPropertiesKhr[] GetDisplayPropertiesKHR();
        public ExternalImageFormatPropertiesNv GetExternalImageFormatPropertiesNV(Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags = 0, ExternalMemoryHandleTypeFlagsNv externalHandleType = 0);
        public PhysicalDeviceFeatures GetFeatures();
        public PhysicalDeviceFeatures2Khr GetFeatures2KHR();
        public FormatProperties GetFormatProperties(Format format);
        public FormatProperties2Khr GetFormatProperties2KHR(Format format);
        public void GetGeneratedCommandsPropertiesNVX(out DeviceGeneratedCommandsFeaturesNvx pFeatures, out DeviceGeneratedCommandsLimitsNvx pLimits);
        public ImageFormatProperties GetImageFormatProperties(Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags = 0);
        public ImageFormatProperties2Khr GetImageFormatProperties2KHR(PhysicalDeviceImageFormatInfo2Khr pImageFormatInfo);
        public PhysicalDeviceMemoryProperties GetMemoryProperties();
        public PhysicalDeviceMemoryProperties2Khr GetMemoryProperties2KHR();
        public PhysicalDeviceProperties GetProperties();
        public PhysicalDeviceProperties2Khr GetProperties2KHR();
        public QueueFamilyProperties[] GetQueueFamilyProperties();
        public QueueFamilyProperties2Khr[] GetQueueFamilyProperties2KHR();
        public void GetRandROutputDisplayEXT(out IntPtr dpy, uint rrOutput, out DisplayKhr pDisplay);
        public SparseImageFormatProperties[] GetSparseImageFormatProperties(Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling);
        public SparseImageFormatProperties2Khr[] GetSparseImageFormatProperties2KHR(PhysicalDeviceSparseImageFormatInfo2Khr pFormatInfo);
        public SurfaceCapabilities2Ext GetSurfaceCapabilities2EXT(SurfaceKhr surface);
        public SurfaceCapabilitiesKhr GetSurfaceCapabilitiesKHR(SurfaceKhr surface);
        public SurfaceFormatKhr[] GetSurfaceFormatsKHR(SurfaceKhr surface);
        public PresentModeKhr[] GetSurfacePresentModesKHR(SurfaceKhr surface);
        public Bool32 GetSurfaceSupportKHR(uint queueFamilyIndex, SurfaceKhr surface);
        public void ReleaseDisplayEXT(DisplayKhr display);
    }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement