src/video/SDL_vulkan_internal.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 27 Aug 2017 23:25:12 -0400
changeset 11367 e8fc755a89e8
parent 11365 a9bd2625fa01
child 11376 91e5e5a2cb71
permissions -rw-r--r--
vulkan: Include a copy of vulkan.h and vk_platform.h.

Now we can provide Vulkan support in the build even if the build box doesn't
have a Vulkan SDK, since we dynamically link to the library anyhow.
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
*/
icculus@11365
    21
#ifndef _SDL_vulkan_internal_h
icculus@11365
    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
icculus@11365
    28
#if defined(SDL_LOADSO_DISABLED)
icculus@11365
    29
#undef SDL_VIDEO_VULKAN_SURFACE
icculus@11365
    30
#define SDL_VIDEO_VULKAN_SURFACE 0
icculus@11365
    31
#endif
icculus@11365
    32
icculus@11365
    33
#if SDL_VIDEO_DRIVER_ANDROID
icculus@11365
    34
#define VK_USE_PLATFORM_ANDROID_KHR
icculus@11365
    35
#endif
icculus@11365
    36
#if SDL_VIDEO_DRIVER_COCOA
icculus@11365
    37
#define VK_USE_PLATFORM_MACOS_MVK
icculus@11365
    38
#endif
icculus@11365
    39
#if SDL_VIDEO_DRIVER_MIR
icculus@11365
    40
#define VK_USE_PLATFORM_MIR_KHR
icculus@11365
    41
#endif
icculus@11365
    42
#if SDL_VIDEO_DRIVER_UIKIT
icculus@11365
    43
#define VK_USE_PLATFORM_IOS_MVK
icculus@11365
    44
#endif
icculus@11365
    45
#if SDL_VIDEO_DRIVER_WAYLAND
icculus@11365
    46
#define VK_USE_PLATFORM_WAYLAND_KHR
icculus@11365
    47
#endif
icculus@11365
    48
#if SDL_VIDEO_DRIVER_WINDOWS
icculus@11365
    49
#define VK_USE_PLATFORM_WIN32_KHR
icculus@11365
    50
#endif
icculus@11365
    51
#if SDL_VIDEO_DRIVER_X11
icculus@11365
    52
#define VK_USE_PLATFORM_XLIB_KHR
icculus@11365
    53
#define VK_USE_PLATFORM_XCB_KHR
icculus@11365
    54
#endif
icculus@11365
    55
icculus@11365
    56
#if SDL_VIDEO_VULKAN_SURFACE
icculus@11365
    57
icculus@11365
    58
/* Need vulkan.h for the following declarations. Must ensure the first
icculus@11365
    59
 * inclusion of vulkan has the appropriate USE_PLATFORM defined, hence
icculus@11365
    60
 * the above. */
icculus@11365
    61
#define VK_NO_PROTOTYPES
icculus@11367
    62
#include "./khronos/vulkan/vulkan.h"
icculus@11365
    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);
icculus@11365
    76
icculus@11365
    77
#endif
icculus@11365
    78
icculus@11365
    79
#endif
icculus@11365
    80
/* vi: set ts=4 sw=4 expandtab: */