windows.d 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.windows;
  24. version(Windows):
  25. extern(System):
  26. public {
  27. import derelict.vulkan.base;
  28. import derelict.vulkan.types;
  29. }
  30. import core.sys.windows.windows;
  31. enum libNames = "vulkan-1.dll";
  32. enum VK_KHR_win32_surface = 1;
  33. enum VK_KHR_WIN32_SURFACE_SPEC_VERSION = 5;
  34. enum VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface";
  35. alias VkWin32SurfaceCreateFlagsKHR = VkFlags;
  36. struct VkWin32SurfaceCreateInfoKHR {
  37. VkStructureType sType ;
  38. const(void)* pNext ;
  39. VkWin32SurfaceCreateFlagsKHR flags ;
  40. HINSTANCE hinstance;
  41. HWND hwnd ;
  42. }
  43. alias PFN_vkCreateWin32SurfaceKHR = nothrow
  44. VkResult function( VkInstance instance
  45. , const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo
  46. , const(VkAllocationCallbacks)* pAllocator
  47. , VkSurfaceKHR* pSurface );
  48. alias PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = nothrow
  49. VkBool32 function( VkPhysicalDevice physicalDevice, uint queueFamilyIndex );
  50. mixin template Functions() {
  51. PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR;
  52. PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR;
  53. pragma(inline, true)
  54. void bindFunctions(alias bind)() {
  55. bind(cast(void**)&vkCreateWin32SurfaceKHR, "vkCreateWin32SurfaceKHR");
  56. bind( cast(void**)&vkGetPhysicalDeviceWin32PresentationSupportKHR
  57. , "vkGetPhysicalDeviceWin32PresentationSupportKHR");
  58. }
  59. }
  60. version (none) {
  61. VkResult vkCreateWin32SurfaceKHR( VkInstance instance
  62. , const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo
  63. , const(VkAllocationCallbacks)* pAllocator
  64. , VkSurfaceKHR* pSurface );
  65. VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint queueFamilyIndex );
  66. }