src/video/SDL_vulkan_internal.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 30 Jan 2018 18:08:34 -0800
changeset 11839 971881e55d61
parent 11811 5d94cb6b24d3
child 11872 e917e911dab6
permissions -rw-r--r--
Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 #ifndef SDL_vulkan_internal_h_
    22 #define SDL_vulkan_internal_h_
    23 
    24 #include "../SDL_internal.h"
    25 
    26 #include "SDL_stdinc.h"
    27 
    28 #if defined(SDL_LOADSO_DISABLED)
    29 #undef SDL_VIDEO_VULKAN
    30 #define SDL_VIDEO_VULKAN 0
    31 #endif
    32 
    33 #if SDL_VIDEO_VULKAN
    34 
    35 #if SDL_VIDEO_DRIVER_ANDROID
    36 #define VK_USE_PLATFORM_ANDROID_KHR
    37 #endif
    38 #if SDL_VIDEO_DRIVER_COCOA
    39 #define VK_USE_PLATFORM_MACOS_MVK
    40 #endif
    41 #if SDL_VIDEO_DRIVER_MIR
    42 #define VK_USE_PLATFORM_MIR_KHR
    43 #endif
    44 #if SDL_VIDEO_DRIVER_UIKIT
    45 #define VK_USE_PLATFORM_IOS_MVK
    46 #endif
    47 #if SDL_VIDEO_DRIVER_WAYLAND
    48 #define VK_USE_PLATFORM_WAYLAND_KHR
    49 #include "wayland/SDL_waylanddyn.h"
    50 #endif
    51 #if SDL_VIDEO_DRIVER_WINDOWS
    52 #define VK_USE_PLATFORM_WIN32_KHR
    53 #include "../core/windows/SDL_windows.h"
    54 #endif
    55 #if SDL_VIDEO_DRIVER_X11
    56 #define VK_USE_PLATFORM_XLIB_KHR
    57 #define VK_USE_PLATFORM_XCB_KHR
    58 #endif
    59 
    60 #define VK_NO_PROTOTYPES
    61 #include "./khronos/vulkan/vulkan.h"
    62 
    63 #include "SDL_vulkan.h"
    64 
    65 
    66 extern const char *SDL_Vulkan_GetResultString(VkResult result);
    67 
    68 extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
    69     PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
    70     Uint32 *extensionCount); /* free returned list with SDL_free */
    71 
    72 /* Implements functionality of SDL_Vulkan_GetInstanceExtensions for a list of
    73  * names passed in nameCount and names. */
    74 extern SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
    75                                                         const char **userNames,
    76                                                         unsigned nameCount,
    77                                                         const char *const *names);
    78 
    79 #else
    80 
    81 /* No SDL Vulkan support, just include the header for typedefs */
    82 #include "SDL_vulkan.h"
    83 
    84 typedef void* PFN_vkGetInstanceProcAddr;
    85 typedef void* PFN_vkEnumerateInstanceExtensionProperties;
    86 
    87 #endif /* SDL_VIDEO_VULKAN */
    88 
    89 #endif /* SDL_vulkan_internal_h_ */
    90 
    91 /* vi: set ts=4 sw=4 expandtab: */