1
1

xcb.d 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. mixin VK_DEFINE_NON_DISPATCHABLE_HANDLE!"XCBConnectionHandle";
  31. alias xcb_window_t = uint;
  32. alias xcb_visualid_t = uint;
  33. enum VK_KHR_xcb_surface = 1;
  34. enum VK_KHR_XCB_SURFACE_SPEC_VERSION = 6;
  35. enum VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface";
  36. alias VkXcbSurfaceCreateFlagsKHR = VkFlags;
  37. struct VkXcbSurfaceCreateInfoKHR {
  38. VkStructureType sType ;
  39. const(void)* pNext ;
  40. VkXcbSurfaceCreateFlagsKHR flags ;
  41. XCBConnectionHandle connection;
  42. xcb_window_t window ;
  43. }
  44. alias PFN_vkCreateXcbSurfaceKHR = nothrow
  45. VkResult function( VkInstance instance
  46. , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
  47. , const(VkAllocationCallbacks)* pAllocator
  48. , VkSurfaceKHR* pSurface );
  49. alias PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR = nothrow
  50. VkBool32 function( VkPhysicalDevice physicalDevice
  51. , uint queueFamilyIndex
  52. , XCBConnectionHandle connection
  53. , xcb_visualid_t visual_id );
  54. mixin template XCBFunctions() {
  55. PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR;
  56. PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR;
  57. pragma(inline, true)
  58. void bindFunctionsXCB(alias bind)() {
  59. bind(cast(void**)&vkCreateXcbSurfaceKHR, "vkCreateXcbSurfaceKHR");
  60. bind( cast(void**)&vkGetPhysicalDeviceXcbPresentationSupportKHR
  61. , "vkGetPhysicalDeviceXcbPresentationSupportKHR" );
  62. }
  63. }
  64. version (none) {
  65. VkResult vkCreateXcbSurfaceKHR( VkInstance instance
  66. , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
  67. , const(VkAllocationCallbacks)* pAllocator
  68. , VkSurfaceKHR* pSurface );
  69. VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice
  70. , uint queueFamilyIndex
  71. , XCBConnectionHandle connection
  72. , xcb_visualid_t visual_id);
  73. }