mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 13:36:12 +01:00
Add count parameter to sfVulkan_getGraphicsRequiredInstanceExtensions
Based on `sfSoundRecorder_getAvailableDevices()` Fixes #227 Co-authored-by: kimci86 <kimci86@hotmail.fr>
This commit is contained in:
1 parent
fb9b3aeab7
commit
b7826c5f9a
2 files changed
+11
-3
No files matched your search
@@ -26,6 +26,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Window/Export.h>
|
#include <SFML/Window/Export.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct VkInstance_T* VkInstance;
|
typedef struct VkInstance_T* VkInstance;
|
||||||
@@ -76,7 +77,9 @@ CSFML_WINDOW_API sfVulkanFunctionPointer sfVulkan_getFunction(const char* name);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get Vulkan instance extensions required for graphics
|
/// \brief Get Vulkan instance extensions required for graphics
|
||||||
///
|
///
|
||||||
|
/// \param count Pointer to a variable that will be filled with the number of instance extensions in the array
|
||||||
|
///
|
||||||
/// \return Vulkan instance extensions required for graphics
|
/// \return Vulkan instance extensions required for graphics
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions(void);
|
CSFML_WINDOW_API const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions(size_t* count);
|
||||||
@@ -48,7 +48,12 @@ sfVulkanFunctionPointer sfVulkan_getFunction(const char* name)
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions()
|
const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions(size_t* count)
|
||||||
{
|
{
|
||||||
return &sf::Vulkan::getGraphicsRequiredInstanceExtensions()[0];
|
static std::vector<const char*> extensions = sf::Vulkan::getGraphicsRequiredInstanceExtensions();
|
||||||
|
|
||||||
|
if (count)
|
||||||
|
*count = extensions.size();
|
||||||
|
|
||||||
|
return !extensions.empty() ? &extensions[0] : NULL;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user