xcb.d 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Boost Software License - Version 1.0 - August 17th, 2003
  3. Permission is hereby granted, free of charge, to any person or organization
  4. obtaining a copy of the software and accompanying documentation covered by
  5. this license (the "Software") to use, reproduce, display, distribute,
  6. execute, and transmit the Software, and to prepare derivative works of the
  7. Software, and to permit third-parties to whom the Software is furnished to
  8. do so, all subject to the following:
  9. The copyright notices in the Software and this entire statement, including
  10. the above license grant, this restriction and the following disclaimer,
  11. must be included in all copies of the Software, in whole or in part, and
  12. all derivative works of the Software, unless such copies or derivative
  13. works are solely in the form of machine-executable object code generated by
  14. a source language processor.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  18. SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  19. FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  20. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. DEALINGS IN THE SOFTWARE.
  22. */
  23. module derelict.vulkan.system.posix.xcb;
  24. version (VK_USE_PLATFORM_XCB_KHR):
  25. extern(System):
  26. public {
  27. import derelict.vulkan.base;
  28. import derelict.vulkan.types;
  29. }
  30. import xcb.xcb;
  31. enum VK_KHR_xcb_surface = 1;
  32. enum VK_KHR_XCB_SURFACE_SPEC_VERSION = 6;
  33. enum VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface";
  34. alias VkXcbSurfaceCreateFlagsKHR = VkFlags;
  35. struct VkXcbSurfaceCreateInfoKHR {
  36. VkStructureType sType ;
  37. const(void)* pNext ;
  38. VkXcbSurfaceCreateFlagsKHR flags ;
  39. xcb_connection_t* connection;
  40. xcb_window_t window ;
  41. }
  42. alias PFN_vkCreateXcbSurfaceKHR = nothrow
  43. VkResult function( VkInstance instance
  44. , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
  45. , const(VkAllocationCallbacks)* pAllocator
  46. , VkSurfaceKHR* pSurface );
  47. alias PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR = nothrow
  48. VkBool32 function( VkPhysicalDevice physicalDevice
  49. , uint queueFamilyIndex
  50. , xcb_connection_t* connection
  51. , xcb_visualid_t visual_id );
  52. mixin template XCBFunctions() {
  53. PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR;
  54. PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR;
  55. pragma(inline, true)
  56. void bindFunctionsXCB(alias bind)() {
  57. bind(cast(void**)&vkCreateXcbSurfaceKHR, "vkCreateXcbSurfaceKHR");
  58. bind( cast(void**)&vkGetPhysicalDeviceXcbPresentationSupportKHR
  59. , "vkGetPhysicalDeviceXcbPresentationSupportKHR" );
  60. }
  61. }
  62. version (none) {
  63. VkResult vkCreateXcbSurfaceKHR( VkInstance instance
  64. , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
  65. , const(VkAllocationCallbacks)* pAllocator
  66. , VkSurfaceKHR* pSurface );
  67. VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice
  68. , uint queueFamilyIndex
  69. , xcb_connection_t* connection
  70. , xcb_visualid_t visual_id);
  71. }