aboutsummaryrefslogtreecommitdiff
path: root/ThirdParty/NVIDIAGfeSDK/Include/gfesdk/bindings/cpp/isdk_cpp.h
blob: f2c0d03f3f7de79b48673a614faf4783baeacc45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Copyright (c) 2017, NVIDIA CORPORATION.  All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto.  Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/

/*!
 * \file
 * C++ bindings for GfeSDK.
 */

#ifndef GFESDK_ISDK_CPP_H
#define GFESDK_ISDK_CPP_H

#include "sdk_types_cpp.h"

namespace GfeSDK
{
// Avoid polluting global namespace with C api, so put it inside namespace
#include <gfesdk/isdk.h>

// Static functions that don't depend on an instance of the SDK
// Giving an alias to these to remove the NVGSDK_ prefix in lieu of the namespace
/*! C++ binding for \ref NVGSDK_SetLogLevel */
inline NVGSDK_RetCode SetFileLogLevel(NVGSDK_LogLevel level) { return NVGSDK_SetLogLevel(level); }
/*! C++ binding for \ref NVGSDK_AttachLogListener */
inline NVGSDK_RetCode AttachLogListener(NVGSDK_LoggingCallback callback) { return NVGSDK_AttachLogListener(callback); }
/*! C++ binding for \ref NVGSDK_SetListenerLogLevel */
inline NVGSDK_RetCode SetListenerLogLevel(NVGSDK_LogLevel level) { return NVGSDK_SetListenerLogLevel(level); }
/*! C++ binding for NVGSDK_RetCodeToString */
inline const char* RetCodeToString(NVGSDK_RetCode rc) { return NVGSDK_RetCodeToString(rc); }

/*! C++ Core interface */
class Core
{
public:
    /*! C++ binding for \ref NVGSDK_Create */
    static Core* Create(CreateInputParams const&, CreateResponse&);
    virtual ~Core() {}

    /*! C++ binding for \ref NVGSDK_Poll */
    virtual NVGSDK_RetCode Poll(void) = 0;
    /*! C++ binding for \ref NVGSDK_RequestPermissionsAsync */
    virtual void RequestPermissionsAsync(RequestPermissionsParams const&, TCallback cb = nullptr, void* cbContext = nullptr) = 0;
    /*! C++ binding for \ref NVGSDK_GetUILanguageAsync */
    virtual void GetUILanguageAsync(TGetUILanguageCallback cb = nullptr, void* cbContext = nullptr) = 0;

    // Return the C API handle;
    virtual NVGSDK_HANDLE* GetHandle() = 0;
};
}

#endif //GFESDK_ISDK_CPP_H