From d7703c822c7b2373615a972f02667287635c667b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 29 Oct 2020 16:32:32 +0100 Subject: Simplify header names --- include/pugl/cairo.h | 50 +++++++++++++++ include/pugl/gl.h | 90 +++++++++++++++++++++++++++ include/pugl/pugl.h | 4 +- include/pugl/pugl_cairo.h | 50 --------------- include/pugl/pugl_gl.h | 90 --------------------------- include/pugl/pugl_stub.h | 52 ---------------- include/pugl/pugl_vulkan.h | 148 --------------------------------------------- include/pugl/stub.h | 52 ++++++++++++++++ include/pugl/vulkan.h | 148 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 342 insertions(+), 342 deletions(-) create mode 100644 include/pugl/cairo.h create mode 100644 include/pugl/gl.h delete mode 100644 include/pugl/pugl_cairo.h delete mode 100644 include/pugl/pugl_gl.h delete mode 100644 include/pugl/pugl_stub.h delete mode 100644 include/pugl/pugl_vulkan.h create mode 100644 include/pugl/stub.h create mode 100644 include/pugl/vulkan.h (limited to 'include') diff --git a/include/pugl/cairo.h b/include/pugl/cairo.h new file mode 100644 index 0000000..2022c21 --- /dev/null +++ b/include/pugl/cairo.h @@ -0,0 +1,50 @@ +/* + Copyright 2012-2020 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file cairo.h + @brief Declaration of Cairo backend accessor. +*/ + +#ifndef PUGL_CAIRO_H +#define PUGL_CAIRO_H + +#include "pugl/pugl.h" + +PUGL_BEGIN_DECLS + +/** + @defgroup cairo Cairo + Cairo graphics support. + @ingroup pugl_c + @{ +*/ + +/** + Cairo graphics backend accessor. + + Pass the returned value to puglSetBackend() to draw to a view with Cairo. +*/ +PUGL_API PUGL_CONST_FUNC const PuglBackend* +puglCairoBackend(void); + +/** + @} +*/ + +PUGL_END_DECLS + +#endif // PUGL_CAIRO_H diff --git a/include/pugl/gl.h b/include/pugl/gl.h new file mode 100644 index 0000000..dca9a45 --- /dev/null +++ b/include/pugl/gl.h @@ -0,0 +1,90 @@ +/* + Copyright 2012-2020 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file gl.h + @brief OpenGL-specific API. +*/ + +#ifndef PUGL_GL_H +#define PUGL_GL_H + +#include "pugl/pugl.h" + +// IWYU pragma: begin_exports + +/* Unfortunately, GL includes vary across platforms, so include them here to + enable pure portable programs. */ + +#ifndef PUGL_NO_INCLUDE_GL_H +# ifdef __APPLE__ +# include "OpenGL/gl.h" +# else +# ifdef _WIN32 +# include +# endif +# include "GL/gl.h" +# endif +#endif + +#ifndef PUGL_NO_INCLUDE_GLU_H +# ifdef __APPLE__ +# include "OpenGL/glu.h" +# else +# ifdef _WIN32 +# include +# endif +# include "GL/glu.h" +# endif +#endif + +// IWYU pragma: end_exports + +PUGL_BEGIN_DECLS + +/** + @defgroup gl OpenGL + OpenGL graphics support. + @ingroup pugl_c + @{ +*/ + +/** + OpenGL extension function. +*/ +typedef void (*PuglGlFunc)(void); + +/** + Return the address of an OpenGL extension function. +*/ +PUGL_API PuglGlFunc +puglGetProcAddress(const char* name); + +/** + OpenGL graphics backend. + + Pass the returned value to puglSetBackend() to draw to a view with OpenGL. +*/ +PUGL_API PUGL_CONST_FUNC const PuglBackend* +puglGlBackend(void); + +PUGL_END_DECLS + +/** + @} +*/ + +#endif // PUGL_GL_H diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 19f9fa4..814b39b 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -899,8 +899,8 @@ puglGetHandle(PuglView* view); Pugl includes the following backends: - - puglGlBackend(), declared in pugl_gl.h - - puglCairoBackend(), declared in pugl_cairo.h + - puglGlBackend(), declared in pugl/gl.h + - puglCairoBackend(), declared in pugl/cairo.h Note that backends are modular and not compiled into the main Pugl library to avoid unnecessary dependencies. To use a particular backend, diff --git a/include/pugl/pugl_cairo.h b/include/pugl/pugl_cairo.h deleted file mode 100644 index 6e5a035..0000000 --- a/include/pugl/pugl_cairo.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2012-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @file pugl_cairo.h - @brief Declaration of Cairo backend accessor. -*/ - -#ifndef PUGL_PUGL_CAIRO_H -#define PUGL_PUGL_CAIRO_H - -#include "pugl/pugl.h" - -PUGL_BEGIN_DECLS - -/** - @defgroup cairo Cairo - Cairo graphics support. - @ingroup pugl_c - @{ -*/ - -/** - Cairo graphics backend accessor. - - Pass the returned value to puglSetBackend() to draw to a view with Cairo. -*/ -PUGL_API PUGL_CONST_FUNC const PuglBackend* -puglCairoBackend(void); - -/** - @} -*/ - -PUGL_END_DECLS - -#endif // PUGL_PUGL_CAIRO_H diff --git a/include/pugl/pugl_gl.h b/include/pugl/pugl_gl.h deleted file mode 100644 index 78b994b..0000000 --- a/include/pugl/pugl_gl.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright 2012-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @file pugl_gl.h - @brief OpenGL-specific API. -*/ - -#ifndef PUGL_PUGL_GL_H -#define PUGL_PUGL_GL_H - -#include "pugl/pugl.h" - -// IWYU pragma: begin_exports - -/* Unfortunately, GL includes vary across platforms, so include them here to - enable pure portable programs. */ - -#ifndef PUGL_NO_INCLUDE_GL_H -# ifdef __APPLE__ -# include "OpenGL/gl.h" -# else -# ifdef _WIN32 -# include -# endif -# include "GL/gl.h" -# endif -#endif - -#ifndef PUGL_NO_INCLUDE_GLU_H -# ifdef __APPLE__ -# include "OpenGL/glu.h" -# else -# ifdef _WIN32 -# include -# endif -# include "GL/glu.h" -# endif -#endif - -// IWYU pragma: end_exports - -PUGL_BEGIN_DECLS - -/** - @defgroup gl OpenGL - OpenGL graphics support. - @ingroup pugl_c - @{ -*/ - -/** - OpenGL extension function. -*/ -typedef void (*PuglGlFunc)(void); - -/** - Return the address of an OpenGL extension function. -*/ -PUGL_API PuglGlFunc -puglGetProcAddress(const char* name); - -/** - OpenGL graphics backend. - - Pass the returned value to puglSetBackend() to draw to a view with OpenGL. -*/ -PUGL_API PUGL_CONST_FUNC const PuglBackend* -puglGlBackend(void); - -PUGL_END_DECLS - -/** - @} -*/ - -#endif // PUGL_PUGL_GL_H diff --git a/include/pugl/pugl_stub.h b/include/pugl/pugl_stub.h deleted file mode 100644 index 569415c..0000000 --- a/include/pugl/pugl_stub.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2019-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @file pugl_stub.h - @brief Stub backend functions and accessor declaration. -*/ - -#ifndef PUGL_PUGL_STUB_H -#define PUGL_PUGL_STUB_H - -#include "pugl/pugl.h" - -PUGL_BEGIN_DECLS - -/** - @defgroup stub Stub - Native graphics support. - @ingroup pugl_c - @{ -*/ - -/** - Stub graphics backend accessor. - - This backend just creates a simple native window without setting up any - portable graphics API. -*/ -PUGL_API PUGL_CONST_FUNC -const PuglBackend* -puglStubBackend(void); - -/** - @} -*/ - -PUGL_END_DECLS - -#endif // PUGL_PUGL_STUB_H diff --git a/include/pugl/pugl_vulkan.h b/include/pugl/pugl_vulkan.h deleted file mode 100644 index 451c28f..0000000 --- a/include/pugl/pugl_vulkan.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - Copyright 2012-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @file pugl_vulkan.h Vulkan-specific API. - - Note that this header includes Vulkan headers, so if you are writing a - program or plugin that dynamically loads vulkan, you should first define - `VK_NO_PROTOTYPES` before including it. -*/ - -#ifndef PUGL_PUGL_VULKAN_H -#define PUGL_PUGL_VULKAN_H - -#include "pugl/pugl.h" - -#include - -PUGL_BEGIN_DECLS - -/** - @defgroup vulkan Vulkan - Vulkan graphics support. - - Vulkan support differs from OpenGL because almost all most configuration is - done using the Vulkan API itself, rather than by setting view hints to - configure the context. Pugl only provides a minimal loader for loading the - Vulkan library, and a portable function to create a Vulkan surface for a - view, which hides the platform-specific implementation details. - - @ingroup pugl_c - @{ -*/ - -/** - Dynamic Vulkan loader. - - This can be used to dynamically load the Vulkan library. Applications or - plugins should not link against the Vulkan library, but instead use this at - runtime. This ensures that things will work on as many systems as possible, - and allows errors to be handled gracefully. - - This is not a "loader" in the sense of loading all the required Vulkan - functions (which is the application's responsibility), but just a minimal - implementation to portably load the Vulkan library and get the two functions - that are used to load everything else. - - Note that this owns the loaded Vulkan library, so it must outlive all use of - the Vulkan API. - - @see https://www.khronos.org/registry/vulkan/specs/1.0/html/chap4.html -*/ -typedef struct PuglVulkanLoaderImpl PuglVulkanLoader; - -/** - Create a new dynamic loader for Vulkan functions. - - This dynamically loads the Vulkan library and gets the load functions from it. - - @return A new Vulkan loader, or null on failure. -*/ -PUGL_API PuglVulkanLoader* -puglNewVulkanLoader(PuglWorld* world); - -/** - Free a loader created with puglNewVulkanLoader(). - - Note that this closes the Vulkan library, so no Vulkan objects or API may be - used after this is called. -*/ -PUGL_API void -puglFreeVulkanLoader(PuglVulkanLoader* loader); - -/** - Return the `vkGetInstanceProcAddr` function. - - @return Null if the Vulkan library does not contain this function (which is - unlikely and indicates a broken system). -*/ -PUGL_API PFN_vkGetInstanceProcAddr -puglGetInstanceProcAddrFunc(const PuglVulkanLoader* loader); - -/** - Return the `vkGetDeviceProcAddr` function. - - @return Null if the Vulkan library does not contain this function (which is - unlikely and indicates a broken system). -*/ -PUGL_API PFN_vkGetDeviceProcAddr -puglGetDeviceProcAddrFunc(const PuglVulkanLoader* loader); - -/** - Return the Vulkan instance extensions required to draw to a PuglView. - - This simply returns static strings, it does not access Vulkan or the window - system. The returned array always contains at least "VK_KHR_surface". - - @param[out] count The number of extensions in the returned array. - @return An array of extension name strings. -*/ -PUGL_API const char* const* -puglGetInstanceExtensions(uint32_t* count); - -/** - Create a Vulkan surface for a Pugl view. - - @param loader The loader for Vulkan functions. - @param view The view the surface is to be displayed on. - @param instance The Vulkan instance. - @param allocator Vulkan allocation callbacks, may be NULL. - @param[out] surface Pointed to a newly created Vulkan surface. - @return `VK_SUCCESS` on success, or a Vulkan error code. -*/ -PUGL_API VkResult -puglCreateSurface(const PuglVulkanLoader* loader, - PuglView* view, - VkInstance instance, - const VkAllocationCallbacks* allocator, - VkSurfaceKHR* surface); - -/** - Vulkan graphics backend. - - Pass the returned value to puglSetBackend() to draw to a view with Vulkan. -*/ -PUGL_API PUGL_CONST_FUNC const PuglBackend* -puglVulkanBackend(void); - -/** - @} -*/ - -PUGL_END_DECLS - -#endif // PUGL_PUGL_VULKAN_H diff --git a/include/pugl/stub.h b/include/pugl/stub.h new file mode 100644 index 0000000..fd62ff0 --- /dev/null +++ b/include/pugl/stub.h @@ -0,0 +1,52 @@ +/* + Copyright 2019-2020 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file stub.h + @brief Stub backend functions and accessor declaration. +*/ + +#ifndef PUGL_STUB_H +#define PUGL_STUB_H + +#include "pugl/pugl.h" + +PUGL_BEGIN_DECLS + +/** + @defgroup stub Stub + Native graphics support. + @ingroup pugl_c + @{ +*/ + +/** + Stub graphics backend accessor. + + This backend just creates a simple native window without setting up any + portable graphics API. +*/ +PUGL_API PUGL_CONST_FUNC +const PuglBackend* +puglStubBackend(void); + +/** + @} +*/ + +PUGL_END_DECLS + +#endif // PUGL_STUB_H diff --git a/include/pugl/vulkan.h b/include/pugl/vulkan.h new file mode 100644 index 0000000..a2755f9 --- /dev/null +++ b/include/pugl/vulkan.h @@ -0,0 +1,148 @@ +/* + Copyright 2012-2020 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file vulkan.h Vulkan-specific API. + + Note that this header includes Vulkan headers, so if you are writing a + program or plugin that dynamically loads vulkan, you should first define + `VK_NO_PROTOTYPES` before including it. +*/ + +#ifndef PUGL_VULKAN_H +#define PUGL_VULKAN_H + +#include "pugl/pugl.h" + +#include + +PUGL_BEGIN_DECLS + +/** + @defgroup vulkan Vulkan + Vulkan graphics support. + + Vulkan support differs from OpenGL because almost all most configuration is + done using the Vulkan API itself, rather than by setting view hints to + configure the context. Pugl only provides a minimal loader for loading the + Vulkan library, and a portable function to create a Vulkan surface for a + view, which hides the platform-specific implementation details. + + @ingroup pugl_c + @{ +*/ + +/** + Dynamic Vulkan loader. + + This can be used to dynamically load the Vulkan library. Applications or + plugins should not link against the Vulkan library, but instead use this at + runtime. This ensures that things will work on as many systems as possible, + and allows errors to be handled gracefully. + + This is not a "loader" in the sense of loading all the required Vulkan + functions (which is the application's responsibility), but just a minimal + implementation to portably load the Vulkan library and get the two functions + that are used to load everything else. + + Note that this owns the loaded Vulkan library, so it must outlive all use of + the Vulkan API. + + @see https://www.khronos.org/registry/vulkan/specs/1.0/html/chap4.html +*/ +typedef struct PuglVulkanLoaderImpl PuglVulkanLoader; + +/** + Create a new dynamic loader for Vulkan functions. + + This dynamically loads the Vulkan library and gets the load functions from it. + + @return A new Vulkan loader, or null on failure. +*/ +PUGL_API PuglVulkanLoader* +puglNewVulkanLoader(PuglWorld* world); + +/** + Free a loader created with puglNewVulkanLoader(). + + Note that this closes the Vulkan library, so no Vulkan objects or API may be + used after this is called. +*/ +PUGL_API void +puglFreeVulkanLoader(PuglVulkanLoader* loader); + +/** + Return the `vkGetInstanceProcAddr` function. + + @return Null if the Vulkan library does not contain this function (which is + unlikely and indicates a broken system). +*/ +PUGL_API PFN_vkGetInstanceProcAddr +puglGetInstanceProcAddrFunc(const PuglVulkanLoader* loader); + +/** + Return the `vkGetDeviceProcAddr` function. + + @return Null if the Vulkan library does not contain this function (which is + unlikely and indicates a broken system). +*/ +PUGL_API PFN_vkGetDeviceProcAddr +puglGetDeviceProcAddrFunc(const PuglVulkanLoader* loader); + +/** + Return the Vulkan instance extensions required to draw to a PuglView. + + This simply returns static strings, it does not access Vulkan or the window + system. The returned array always contains at least "VK_KHR_surface". + + @param[out] count The number of extensions in the returned array. + @return An array of extension name strings. +*/ +PUGL_API const char* const* +puglGetInstanceExtensions(uint32_t* count); + +/** + Create a Vulkan surface for a Pugl view. + + @param loader The loader for Vulkan functions. + @param view The view the surface is to be displayed on. + @param instance The Vulkan instance. + @param allocator Vulkan allocation callbacks, may be NULL. + @param[out] surface Pointed to a newly created Vulkan surface. + @return `VK_SUCCESS` on success, or a Vulkan error code. +*/ +PUGL_API VkResult +puglCreateSurface(const PuglVulkanLoader* loader, + PuglView* view, + VkInstance instance, + const VkAllocationCallbacks* allocator, + VkSurfaceKHR* surface); + +/** + Vulkan graphics backend. + + Pass the returned value to puglSetBackend() to draw to a view with Vulkan. +*/ +PUGL_API PUGL_CONST_FUNC const PuglBackend* +puglVulkanBackend(void); + +/** + @} +*/ + +PUGL_END_DECLS + +#endif // PUGL_VULKAN_H -- cgit v1.2.1