GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
holoplay.h
Go to the documentation of this file.
1#pragma once
2
3#if _WIN32
4 #define EXPORT_API __declspec(dllexport)
5#else
6 #define EXPORT_API
7#endif
8
9#include <string>
10
11#ifdef HP_LOAD_LIBRARY
12 #if _WIN32
13 #include <windows.h>
14 #include <iostream>
15 #include <stdio.h>
16 #define IMPORT_API __cdecl
17 #else
18 #define IMPORT_API
19 #endif
20 typedef void (IMPORT_API* hp_loadCalibration_type)();
21 hp_loadCalibration_type hp_loadCalibration;
22 typedef void (IMPORT_API* hp_loadLightfieldShaders_type)();
23 hp_loadLightfieldShaders_type hp_loadLightfieldShaders;
24 typedef void (IMPORT_API* hp_loadBlitShaders_type)();
25 hp_loadBlitShaders_type hp_loadBlitShaders;
26 typedef void (IMPORT_API* hp_loadCalibrationIntoShader_type)();
27 hp_loadCalibrationIntoShader_type hp_loadCalibrationIntoShader;
28 typedef void (IMPORT_API* hp_setupQuiltSettings_type)(unsigned int);
29 hp_setupQuiltSettings_type hp_setupQuiltSettings;
30 typedef void (IMPORT_API* hp_setupCustomQuiltSettings_type)(unsigned int, unsigned int,
31 unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
32 hp_setupCustomQuiltSettings_type hp_setupCustomQuiltSettings;
33 typedef void (IMPORT_API* hp_setupQuiltTexture_type)();
34 hp_setupQuiltTexture_type hp_setupQuiltTexture;
35 typedef void (IMPORT_API* hp_copyViewToQuilt_type)(unsigned int);
36 hp_copyViewToQuilt_type hp_copyViewToQuilt;
37 typedef void (IMPORT_API* hp_drawLightfield_type)();
38 hp_drawLightfield_type hp_drawLightfield;
39 typedef void (IMPORT_API* hp_setupBuffers_type)();
40 hp_setupBuffers_type hp_setupBuffers;
41 typedef void (IMPORT_API* hp_initialize_type)();
42 hp_initialize_type hp_initialize;
43 typedef void (IMPORT_API* hp_release_type)();
44 hp_release_type hp_release;
45 typedef int (IMPORT_API* load_calibration_type)(char *);
46 load_calibration_type load_calibration;
47 typedef void (IMPORT_API* get_version_type)(char *);
48 get_version_type get_version;
49
50 #if _WIN32
51 void hp_loadLibrary(char * path = (char*)"HoloPlayAPI") {
52 auto dll = LoadLibraryA(path);
53 // make func pointers
54 hp_loadCalibration = (hp_loadCalibration_type) GetProcAddress(dll, "hp_loadCalibration");
55 hp_loadLightfieldShaders = (hp_loadLightfieldShaders_type) GetProcAddress(dll, "hp_loadLightfieldShaders");
56 hp_loadBlitShaders = (hp_loadBlitShaders_type) GetProcAddress(dll, "hp_loadBlitShaders");
57 hp_loadCalibrationIntoShader = (hp_loadCalibrationIntoShader_type) GetProcAddress(dll, "hp_loadCalibrationIntoShader");
58 hp_setupQuiltSettings = (hp_setupQuiltSettings_type) GetProcAddress(dll, "hp_setupQuiltSettings");
59 hp_setupCustomQuiltSettings = (hp_setupCustomQuiltSettings_type) GetProcAddress(dll, "hp_setupCustomQuiltSettings");
60 hp_setupQuiltTexture = (hp_setupQuiltTexture_type) GetProcAddress(dll, "hp_setupQuiltTexture");
61 hp_copyViewToQuilt = (hp_copyViewToQuilt_type) GetProcAddress(dll, "hp_copyViewToQuilt");
62 hp_drawLightfield = (hp_drawLightfield_type) GetProcAddress(dll, "hp_drawLightfield");
63 hp_setupBuffers = (hp_setupBuffers_type) GetProcAddress(dll, "hp_setupBuffers");
64 hp_initialize = (hp_initialize_type) GetProcAddress(dll, "hp_initialize");
65 hp_release = (hp_release_type) GetProcAddress(dll, "hp_release");
66 load_calibration = (load_calibration_type) GetProcAddress(dll, "load_calibration");
67 get_version = (get_version_type) GetProcAddress(dll, "get_version");
68 }
69 #elif __APPLE__
70 void hp_loadLibrary(char * path = (char*)"/Library/HoloPlayAPI.bundle"){
71 CFURLRef bundleURL;
72 CFBundleRef myBundle;
73 bundleURL = CFURLCreateWithFileSystemPath(
74 kCFAllocatorDefault,
75 CFSTR("/Library/HoloPlayAPI.bundle"),
76 kCFURLPOSIXPathStyle,
77 true
78 );
79 myBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
80 CFRelease(bundleURL);
81
82 // make the function pointers
83 hp_loadCalibration = (hp_loadCalibration_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_loadCalibration"));
84 hp_loadLightfieldShaders = (hp_loadLightfieldShaders_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_loadLightfieldShaders"));
85 hp_loadBlitShaders = (hp_loadBlitShaders_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_loadBlitShaders"));
86 hp_loadCalibrationIntoShader = (hp_loadCalibrationIntoShader_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_loadCalibrationIntoShader"));
87 hp_setupQuiltSettings = (hp_setupQuiltSettings_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_setupQuiltSettings"));
88 hp_setupCustomQuiltSettings = (hp_setupCustomQuiltSettings_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_setupCustomQuiltSettings"));
89 hp_setupQuiltTexture = (hp_setupQuiltTexture_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_setupQuiltTexture"));
90 hp_copyViewToQuilt = (hp_copyViewToQuilt_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_copyViewToQuilt"));
91 hp_drawLightfield = (hp_drawLightfield_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_drawLightfield"));
92 hp_setupBuffers = (hp_setupBuffers_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_setupBuffers"));
93 hp_initialize = (hp_initialize_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_initialize"));
94 hp_release = (hp_release_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("hp_release"));
95 load_calibration = (load_calibration_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("load_calibration"));
96 get_version = (get_version_type) CFBundleGetFunctionPointerForName(myBundle, CFSTR("get_version"));
97 }
98 #endif
99
100#else
101
102extern "C" {
103 // quilt settings
104 EXPORT_API unsigned int qs_width;
105 EXPORT_API unsigned int qs_height;
108 EXPORT_API unsigned int qs_rows;
109 EXPORT_API unsigned int qs_columns;
111
112 // calibration
125
126 // holoplay stuff
130 EXPORT_API unsigned int hp_VAO;
131 EXPORT_API unsigned int hp_VBO;
132 EXPORT_API unsigned int hp_FBO;
133
134 // methods
140 EXPORT_API void hp_setupCustomQuiltSettings(unsigned int, unsigned int,
141 unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); // really annoying
143 EXPORT_API void hp_copyViewToQuilt(unsigned int);
150
151 // internal shader funcs
152 void setBool(unsigned int ID, const std::string &name, bool value);
153 void setInt(unsigned int ID, const std::string &name, int value);
154 void setFloat(unsigned int ID, const std::string &name, float value);
155 void setVector(unsigned int ID, const std::string &name, float value0, float value1, float value2, float value3);
156 void setMatrix(unsigned int ID, const std::string &name, float* value);
158}
159#endif
EXPORT_API void hp_loadBlitShaders()
EXPORT_API unsigned int hp_quiltTexture
Definition holoplay.h:129
EXPORT_API unsigned int qs_width
Definition holoplay.h:104
EXPORT_API void get_version(char *)
EXPORT_API unsigned int qs_viewWidth
Definition holoplay.h:106
EXPORT_API void hp_release()
#define EXPORT_API
Definition holoplay.h:6
EXPORT_API void hp_copyViewToQuilt(unsigned int)
EXPORT_API unsigned int hp_VAO
Definition holoplay.h:130
EXPORT_API float cal_center
Definition holoplay.h:115
EXPORT_API void hp_loadCalibration()
EXPORT_API float cal_verticalAngle
Definition holoplay.h:118
EXPORT_API void hp_initialize()
EXPORT_API void hp_loadCalibrationIntoShader()
EXPORT_API int load_calibration(char *)
EXPORT_API void hp_setupQuiltSettings(unsigned int)
EXPORT_API float cal_screenH
Definition holoplay.h:121
EXPORT_API float cal_viewCone
Definition holoplay.h:116
EXPORT_API unsigned int qs_viewHeight
Definition holoplay.h:107
void setBool(unsigned int ID, const std::string &name, bool value)
EXPORT_API void hp_drawLightfield()
EXPORT_API float cal_slope
Definition holoplay.h:114
EXPORT_API void hp_setupCustomQuiltSettings(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
void setFloat(unsigned int ID, const std::string &name, float value)
EXPORT_API unsigned int qs_columns
Definition holoplay.h:109
void setVector(unsigned int ID, const std::string &name, float value0, float value1, float value2, float value3)
EXPORT_API unsigned int qs_rows
Definition holoplay.h:108
EXPORT_API unsigned int hp_VBO
Definition holoplay.h:131
void setInt(unsigned int ID, const std::string &name, int value)
void setMatrix(unsigned int ID, const std::string &name, float *value)
EXPORT_API void hp_setupQuiltTexture()
EXPORT_API unsigned int qs_numViews
Definition holoplay.h:110
EXPORT_API float cal_DPI
Definition holoplay.h:119
EXPORT_API float cal_screenW
Definition holoplay.h:120
EXPORT_API unsigned int hp_lightfieldShader
Definition holoplay.h:127
EXPORT_API float cal_flipImageX
Definition holoplay.h:122
EXPORT_API unsigned int hp_blitShader
Definition holoplay.h:128
EXPORT_API unsigned int hp_FBO
Definition holoplay.h:132
EXPORT_API float cal_flipImageY
Definition holoplay.h:123
EXPORT_API unsigned int qs_height
Definition holoplay.h:105
void passQuiltSettingsToShader()
EXPORT_API void hp_loadLightfieldShaders()
EXPORT_API void hp_setupBuffers()
EXPORT_API float cal_pitch
Definition holoplay.h:113
EXPORT_API float cal_flipSubp
Definition holoplay.h:124
EXPORT_API float cal_invView
Definition holoplay.h:117
iVBORw0KGgoAAAANSUhEUgAAANcAAAB5CAMAAACdtUQZAAAA51BMVEX</div ></div >< div style="padding: 0px 0px; width: 1324px;">< div style="height: 400px; width: 1324px;"></div >< div itemscope itemtype="https: </div><div itemscope itemtype="https:</div >< div itemscope itemtype="https: </div></div><p><div style="padding:0px 0px;width:1324px;"><div></div><div itemscope itemtype="https:< ul >< li >< b > Application name
8AkrcAgqgAs9wqQ0ey2tkAo8gAuuQfeI4hPUH09fXHy8z4+fng4uNKXF/Lz9BzfoAcgpkQMTUAKjAbOT4Qr9AXhJ8Rl7ktMCwTosA...
Definition meshpage.php:1610
Definition GameApi.h:53