src/video/SDL_vulkan_internal.h
author sezero <sezero@users.sourceforge.net>
Mon, 12 Feb 2018 17:00:00 +0300
changeset 11872 e917e911dab6
parent 11839 971881e55d61
child 11891 13ccb0d9bccd
permissions -rw-r--r--
revert the recent typecast assignment changes (see bug #4079)

also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h into generic function
pointer typedefs.
icculus@11365
     1
/*
icculus@11365
     2
  Simple DirectMedia Layer
slouken@11811
     3
  Copyright (C) 1997-2018 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
slouken@11386
    49
#include "wayland/SDL_waylanddyn.h"
icculus@11365
    50
#endif
icculus@11365
    51
#if SDL_VIDEO_DRIVER_WINDOWS
icculus@11365
    52
#define VK_USE_PLATFORM_WIN32_KHR
slouken@11383
    53
#include "../core/windows/SDL_windows.h"
icculus@11365
    54
#endif
icculus@11365
    55
#if SDL_VIDEO_DRIVER_X11
icculus@11365
    56
#define VK_USE_PLATFORM_XLIB_KHR
icculus@11365
    57
#define VK_USE_PLATFORM_XCB_KHR
icculus@11365
    58
#endif
icculus@11365
    59
icculus@11365
    60
#define VK_NO_PROTOTYPES
icculus@11367
    61
#include "./khronos/vulkan/vulkan.h"
icculus@11365
    62
slouken@11376
    63
#include "SDL_vulkan.h"
slouken@11376
    64
slouken@11376
    65
icculus@11365
    66
extern const char *SDL_Vulkan_GetResultString(VkResult result);
icculus@11365
    67
icculus@11365
    68
extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
icculus@11365
    69
    PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
icculus@11365
    70
    Uint32 *extensionCount); /* free returned list with SDL_free */
icculus@11365
    71
icculus@11365
    72
/* Implements functionality of SDL_Vulkan_GetInstanceExtensions for a list of
icculus@11365
    73
 * names passed in nameCount and names. */
icculus@11365
    74
extern SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
icculus@11365
    75
                                                        const char **userNames,
icculus@11365
    76
                                                        unsigned nameCount,
icculus@11365
    77
                                                        const char *const *names);
slouken@11380
    78
slouken@11380
    79
#else
slouken@11380
    80
slouken@11380
    81
/* No SDL Vulkan support, just include the header for typedefs */
slouken@11380
    82
#include "SDL_vulkan.h"
slouken@11380
    83
sezero@11872
    84
typedef void (*PFN_vkGetInstanceProcAddr) ();
sezero@11872
    85
typedef int  (*PFN_vkEnumerateInstanceExtensionProperties) ();
slouken@11839
    86
slouken@11381
    87
#endif /* SDL_VIDEO_VULKAN */
icculus@11365
    88
slouken@11376
    89
#endif /* SDL_vulkan_internal_h_ */
icculus@11365
    90
icculus@11365
    91
/* vi: set ts=4 sw=4 expandtab: */