src/video/SDL_vulkan_internal.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 28 Aug 2017 00:11:38 -0700
changeset 11381 2610f8f0a9c6
parent 11380 bb5404c6b2e0
child 11383 6cafb5954aaf
permissions -rw-r--r--
Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration
icculus@11365
     1
/*
icculus@11365
     2
  Simple DirectMedia Layer
icculus@11365
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
icculus@11365
     4
icculus@11365
     5
  This software is provided 'as-is', without any express or implied
icculus@11365
     6
  warranty.  In no event will the authors be held liable for any damages
icculus@11365
     7
  arising from the use of this software.
icculus@11365
     8
icculus@11365
     9
  Permission is granted to anyone to use this software for any purpose,
icculus@11365
    10
  including commercial applications, and to alter it and redistribute it
icculus@11365
    11
  freely, subject to the following restrictions:
icculus@11365
    12
icculus@11365
    13
  1. The origin of this software must not be misrepresented; you must not
icculus@11365
    14
     claim that you wrote the original software. If you use this software
icculus@11365
    15
     in a product, an acknowledgment in the product documentation would be
icculus@11365
    16
     appreciated but is not required.
icculus@11365
    17
  2. Altered source versions must be plainly marked as such, and must not be
icculus@11365
    18
     misrepresented as being the original software.
icculus@11365
    19
  3. This notice may not be removed or altered from any source distribution.
icculus@11365
    20
*/
slouken@11376
    21
#ifndef SDL_vulkan_internal_h_
slouken@11376
    22
#define SDL_vulkan_internal_h_
icculus@11365
    23
icculus@11365
    24
#include "../SDL_internal.h"
icculus@11365
    25
icculus@11365
    26
#include "SDL_stdinc.h"
icculus@11365
    27
slouken@11381
    28
#if defined(SDL_LOADSO_DISABLED)
slouken@11381
    29
#undef SDL_VIDEO_VULKAN
slouken@11381
    30
#define SDL_VIDEO_VULKAN 0
slouken@11380
    31
#endif
slouken@11380
    32
slouken@11381
    33
#if SDL_VIDEO_VULKAN
slouken@11380
    34
icculus@11365
    35
#if SDL_VIDEO_DRIVER_ANDROID
icculus@11365
    36
#define VK_USE_PLATFORM_ANDROID_KHR
icculus@11365
    37
#endif
icculus@11365
    38
#if SDL_VIDEO_DRIVER_COCOA
icculus@11365
    39
#define VK_USE_PLATFORM_MACOS_MVK
icculus@11365
    40
#endif
icculus@11365
    41
#if SDL_VIDEO_DRIVER_MIR
icculus@11365
    42
#define VK_USE_PLATFORM_MIR_KHR
icculus@11365
    43
#endif
icculus@11365
    44
#if SDL_VIDEO_DRIVER_UIKIT
icculus@11365
    45
#define VK_USE_PLATFORM_IOS_MVK
icculus@11365
    46
#endif
icculus@11365
    47
#if SDL_VIDEO_DRIVER_WAYLAND
icculus@11365
    48
#define VK_USE_PLATFORM_WAYLAND_KHR
icculus@11365
    49
#endif
icculus@11365
    50
#if SDL_VIDEO_DRIVER_WINDOWS
icculus@11365
    51
#define VK_USE_PLATFORM_WIN32_KHR
icculus@11365
    52
#endif
icculus@11365
    53
#if SDL_VIDEO_DRIVER_X11
icculus@11365
    54
#define VK_USE_PLATFORM_XLIB_KHR
icculus@11365
    55
#define VK_USE_PLATFORM_XCB_KHR
icculus@11365
    56
#endif
icculus@11365
    57
icculus@11365
    58
#define VK_NO_PROTOTYPES
icculus@11367
    59
#include "./khronos/vulkan/vulkan.h"
icculus@11365
    60
slouken@11376
    61
#include "SDL_vulkan.h"
slouken@11376
    62
slouken@11376
    63
icculus@11365
    64
extern const char *SDL_Vulkan_GetResultString(VkResult result);
icculus@11365
    65
icculus@11365
    66
extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
icculus@11365
    67
    PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
icculus@11365
    68
    Uint32 *extensionCount); /* free returned list with SDL_free */
icculus@11365
    69
icculus@11365
    70
/* Implements functionality of SDL_Vulkan_GetInstanceExtensions for a list of
icculus@11365
    71
 * names passed in nameCount and names. */
icculus@11365
    72
extern SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
icculus@11365
    73
                                                        const char **userNames,
icculus@11365
    74
                                                        unsigned nameCount,
icculus@11365
    75
                                                        const char *const *names);
slouken@11380
    76
slouken@11380
    77
#else
slouken@11380
    78
slouken@11380
    79
/* No SDL Vulkan support, just include the header for typedefs */
slouken@11380
    80
#include "SDL_vulkan.h"
slouken@11380
    81
slouken@11381
    82
#endif /* SDL_VIDEO_VULKAN */
icculus@11365
    83
slouken@11376
    84
#endif /* SDL_vulkan_internal_h_ */
icculus@11365
    85
icculus@11365
    86
/* vi: set ts=4 sw=4 expandtab: */