Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:58:15

0001 ////////////////////////////////////////////////////////////
0002 //
0003 // SFML - Simple and Fast Multimedia Library
0004 // Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
0005 //
0006 // This software is provided 'as-is', without any express or implied warranty.
0007 // In no event will the authors be held liable for any damages arising from the use of this software.
0008 //
0009 // Permission is granted to anyone to use this software for any purpose,
0010 // including commercial applications, and to alter it and redistribute it freely,
0011 // subject to the following restrictions:
0012 //
0013 // 1. The origin of this software must not be misrepresented;
0014 //    you must not claim that you wrote the original software.
0015 //    If you use this software in a product, an acknowledgment
0016 //    in the product documentation would be appreciated but is not required.
0017 //
0018 // 2. Altered source versions must be plainly marked as such,
0019 //    and must not be misrepresented as being the original software.
0020 //
0021 // 3. This notice may not be removed or altered from any source distribution.
0022 //
0023 ////////////////////////////////////////////////////////////
0024 
0025 #ifndef SFML_VULKAN_HPP
0026 #define SFML_VULKAN_HPP
0027 
0028 ////////////////////////////////////////////////////////////
0029 // Headers
0030 ////////////////////////////////////////////////////////////
0031 #include <SFML/Window/Export.hpp>
0032 #include <SFML/Window/WindowHandle.hpp>
0033 #include <vector>
0034 #include <cstddef>
0035 #include <stdint.h>
0036 
0037 
0038 typedef struct VkInstance_T* VkInstance;
0039 
0040 #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
0041 
0042 typedef struct VkSurfaceKHR_T* VkSurfaceKHR;
0043 
0044 #else
0045 
0046 typedef uint64_t VkSurfaceKHR;
0047 
0048 #endif
0049 
0050 struct VkAllocationCallbacks;
0051 
0052 
0053 namespace sf
0054 {
0055 
0056 typedef void (*VulkanFunctionPointer)();
0057 
0058 ////////////////////////////////////////////////////////////
0059 /// \brief Vulkan helper functions
0060 ///
0061 ////////////////////////////////////////////////////////////
0062 class SFML_WINDOW_API Vulkan
0063 {
0064 public:
0065 
0066     ////////////////////////////////////////////////////////////
0067     /// \brief Tell whether or not the system supports Vulkan
0068     ///
0069     /// This function should always be called before using
0070     /// the Vulkan features. If it returns false, then
0071     /// any attempt to use Vulkan will fail.
0072     ///
0073     /// If only compute is required, set \a requireGraphics
0074     /// to false to skip checking for the extensions necessary
0075     /// for graphics rendering.
0076     ///
0077     /// \param requireGraphics
0078     ///
0079     /// \return True if Vulkan is supported, false otherwise
0080     ///
0081     ////////////////////////////////////////////////////////////
0082     static bool isAvailable(bool requireGraphics = true);
0083 
0084     ////////////////////////////////////////////////////////////
0085     /// \brief Get the address of a Vulkan function
0086     ///
0087     /// \param name Name of the function to get the address of
0088     ///
0089     /// \return Address of the Vulkan function, 0 on failure
0090     ///
0091     ////////////////////////////////////////////////////////////
0092     static VulkanFunctionPointer getFunction(const char* name);
0093 
0094     ////////////////////////////////////////////////////////////
0095     /// \brief Get Vulkan instance extensions required for graphics
0096     ///
0097     /// \return Vulkan instance extensions required for graphics
0098     ///
0099     ////////////////////////////////////////////////////////////
0100     static const std::vector<const char*>& getGraphicsRequiredInstanceExtensions();
0101 };
0102 
0103 } // namespace sf
0104 
0105 
0106 #endif // SFML_VULKAN_HPP
0107 
0108 
0109 ////////////////////////////////////////////////////////////
0110 /// \class sf::Vulkan
0111 /// \ingroup window
0112 ///
0113 /// 
0114 ///
0115 ////////////////////////////////////////////////////////////