-
Notifications
You must be signed in to change notification settings - Fork 48
/
ofxNDIdynloader.h
56 lines (43 loc) · 1.35 KB
/
ofxNDIdynloader.h
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
#ifndef ofxNDIdynloader_H
#define ofxNDIdynloader_H
//
// Option : disable warning C26812 (unscoped enums) for Visual Studio for using NDI enums.
//
// Use of C++11 scoped (class) enums are not compatible with early compilers (< VS2012 and others).
// However, for Visual Studio this warning is designated "Prefer" and "C" standard unscoped enums
// are acceptable and compatible. The warning can be enabled or disabled here.
//
// #pragma warning(disable:26812)
//
#include <cstddef> // to avoid NULL definition problem
#include "ofxNDIplatforms.h"
#include "Processing.NDI.Lib.h" // NDI SDK
#if defined(TARGET_WIN32)
#include <windows.h>
#include <Shellapi.h> // for shellexecute
#pragma comment(lib, "Shell32.lib") // for shellexecute
#elif defined(TARGET_OSX) || defined(TARGET_LINUX)
#include <dlfcn.h> // dynamic library loading in Linux
// typedef used for Linux
typedef NDIlib_v4* (*NDIlib_v4_load_)(void);
#endif
#include <string>
#include <vector>
#include <iostream> // for cout
#include <io.h> // for _access
class ofxNDIdynloader
{
public:
ofxNDIdynloader();
~ofxNDIdynloader();
// load library dynamically
const NDIlib_v4* Load();
private :
#if defined(TARGET_WIN32)
HMODULE m_hNDILib;
#elif defined(TARGET_OSX) || defined(TARGET_LINUX)
const std::string FindRuntime();
#endif
const NDIlib_v4* p_NDILib;
};
#endif // ofxNDIdynloader_H