93 SL_LOG(
"Path to Models : %s", modelPath.c_str());
94 SL_LOG(
"Path to Shaders : %s", shaderPath.c_str());
95 SL_LOG(
"Path to Textures : %s", texturePath.c_str());
96 SL_LOG(
"Path to Fonts : %s", fontPath.c_str());
97 SL_LOG(
"Path to Config. : %s", configPath.c_str());
99 SL_LOG(
"OpenCV Version : %d.%d.%d", CV_MAJOR_VERSION, CV_MINOR_VERSION, CV_VERSION_REVISION);
100 SL_LOG(
"OpenCV has OpenCL: %s", cv::ocl::haveOpenCL() ?
"yes" :
"no");
106 SL_LOG(
"------------------------------------------------------------------");
128 void* onWndUpdateCallback,
129 void* onSelectNodeMeshCallback,
130 void* onNewSceneViewCallback,
132 void* onImGuiLoadConfig,
133 void* onImGuiSaveConfig)
139 if (onNewSceneViewCallback ==
nullptr)
151 SLfloat dpiScaleProp = (float)dotsPerInch / 120.0f;
152 SLfloat dpiScaleFixed = (float)dotsPerInch / 142.0f;
170 onSelectNodeMeshCallback,
249 SL_LOG(
"Begin of Terminate");
258 SL_LOG(
"Before END_PROFILING_SESSION");
260 SL_LOG(
"After END_PROFILING_SESSION");
265 SL_LOG(
"Profile written : %s", filePathName.c_str());
267 SL_LOG(
"No Profile written: %s", filePathName.c_str());
272 SL_LOG(
"End of Terminate");
273 SL_LOG(
"------------------------------------------------------------------");
292 bool needUpdate =
false;
303 SLstring pathFilename = path + filename;
317 void slResize(
int sceneViewIndex,
int width,
int height)
487 unsigned int character)
545 SL_LOG(
"Ext. directory : %s", externalPath.c_str());
550 SL_LOG(
"ERROR: external directory does not exists: %s", externalPath.c_str());
The AppCommon class holds the top-level instances of the app-demo.
#define END_PROFILING_SESSION
#define BEGIN_PROFILING_SESSION(name, storeInMemory, outputPath)
#define PROFILE_THREAD(name)
#define PROFILER_TRACE_FILE_PATH
vector< SLstring > SLVstring
int SLSceneID
Scene identifier.
SLMouseButton
Mouse button codes.
constexpr SLSceneID SL_EMPTY_SCENE_ID
SLSceneID for an empty scene.
SLKey
Keyboard key codes enumeration.
void(SL_STDCALL * cbOnImGuiSaveConfig)()
Callback function typedef for ImGui save config function.
void(SL_STDCALL * cbOnImGuiLoadConfig)(int dpi)
Callback function typedef for ImGui load config function.
Wrapper Class around the external ImGui GUI-framework.
void slRotationQUAT(float quatX, float quatY, float quatZ, float quatW)
void slTouch2Move(int sceneViewIndex, int xpos1, int ypos1, int xpos2, int ypos2)
void slMouseDown(int sceneViewIndex, SLMouseButton button, int xpos, int ypos, SLKey modifier)
void slSetupExternalDir(const SLstring &externalPath)
void slTouch2Down(int sceneViewIndex, int xpos1, int ypos1, int xpos2, int ypos2)
void slLoadCoreAssetsAsync()
void slMouseMove(int sceneViewIndex, int x, int y)
void slSwitchScene(SLSceneView *sv, SLSceneID sceneID)
void slLocationLatLonAlt(double latitudeDEG, double longitudeDEG, double altitudeM, float accuracyM)
void slMouseWheel(int sceneViewIndex, int pos, SLKey modifier)
void slKeyRelease(int sceneViewIndex, SLKey key, SLKey modifier)
void slMouseUp(int sceneViewIndex, SLMouseButton button, int xpos, int ypos, SLKey modifier)
void slCharInput(int sceneViewIndex, unsigned int character)
void slTouch2Up(int sceneViewIndex, int xpos1, int ypos1, int xpos2, int ypos2)
void slDoubleClick(int sceneViewIndex, SLMouseButton button, int xpos, int ypos, SLKey modifier)
void slLoadCoreAssetsSync()
void slResize(int sceneViewIndex, int width, int height)
string slGetWindowTitle(int sceneViewIndex)
Global function to retrieve a window title generated by the scene library.
void slKeyPress(int sceneViewIndex, SLKey key, SLKey modifier)
bool slUpdateParallelJob()
void slCreateApp(SLVstring &cmdLineArgs, const SLstring &dataPath, const SLstring &shaderPath, const SLstring &modelPath, const SLstring &texturePath, const SLstring &fontPath, const SLstring &videoPath, const SLstring &configPath, const SLstring &applicationName)
SLSceneView * slNewSceneView(SLScene *s, int dotsPerInch, SLInputManager &inputManager)
SLint slCreateSceneView(SLAssetManager *am, SLScene *scene, int screenWidth, int screenHeight, int dotsPerInch, SLSceneID initScene, void *onWndUpdateCallback, void *onSelectNodeMeshCallback, void *onNewSceneViewCallback, void *onImGuiBuild, void *onImGuiLoadConfig, void *onImGuiSaveConfig)
bool gShouldClose
global flag that determines if the application should be closed
void slSetDeviceParameter(const SLstring ¶meter, SLstring value)
Adds a value to the applications device parameter map.
Declaration of the main Scene Library C-Interface.
SLScene SLSceneView SLint sceneID
SLSceneView *SL_STDCALL * cbOnNewSceneView(SLScene *s, int dotsPerInch, SLInputManager &inputManager)
Callback function typedef for custom SLSceneView derived creator function.
static void handleParallelJob()
Starts parallel job if one is queued.
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static void registerCoreAssetsLoad()
static SLIOBuffer fontDataProp
static SLstring fontPath
Path to font images.
static SLstring configPath
Default path for calibration files.
static optional< SLSceneID > sceneToLoad
Scene id to load at start up.
static SLstring exePath
executable root path
static atomic< bool > jobIsRunning
True if a parallel job is running.
static SLDeviceLocation devLoc
Mobile device location from GPS.
static SLUiInterface * gui
Pointer to the GUI.
static SLstring modelPath
Path to 3D models.
static SLVSceneView sceneViews
Vector of sceneview pointers.
static SLIOBuffer fontDataFixed
static SLstring texturePath
Path to texture images.
static void switchScene(SLSceneView *sv, SLSceneID sceneID)
static SLstring videoPath
Path to video files.
static void createApp(SLstring appName)
Application creation function.
static SLstring shaderPath
Path to GLSL shader programs.
static SLAssetLoader * assetLoader
Asset-loader for async asset loading.
static SLInputManager inputManager
Input events manager.
static SLstring externalPath
Default path for external file storage.
static SLSceneID sceneID
ID of currently loaded scene.
static SLScene * scene
Pointer to the one and only SLScene instance.
static map< string, string > deviceParameter
Generic device parameter.
static SLstring dataPath
Path to data directory (it is set platform dependent)
static void deleteApp()
Calls the destructor of the single scene instance.
static Profiler & instance()
void loadAssetsAsync(function< void()> onDone)
Toplevel holder of the assets meshes, materials, textures and shaders.
void isUsed(SLbool isUsed)
Setter that turns on the device rotation sensor.
void onLocationLatLonAlt(SLdouble latDEG, SLdouble lonDEG, SLdouble altM, SLfloat accuracyM)
Event handler for mobile device location update.
void isUsed(SLbool isUsed)
Setter that turns on the device rotation sensor.
void onRotationQUAT(SLfloat quatX, SLfloat quatY, SLfloat quatZ, SLfloat quatW)
Singleton class holding all OpenGL states.
static SLGLState * instance()
Public static instance getter for singleton pattern.
SLstring getSLVersionNO()
Returns the OpenGL Shading Language version number as a string.
ImGui Interface class for forwarding all events to the original ImGui Handlers.
static SLfloat fontPropDots
Default font size of proportional font.
static SLfloat fontFixedDots
Default font size of fixed size font.
Specialized SLInput class for all keypress related input events.
Specialized SLInput class for all mouse related input events.
Specialized SLInput class for window resize events.
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
void init(SLstring name, SLint screenWidth, SLint screenHeight, void *onWndUpdateCallback, void *onSelectNodeMeshCallback, SLUiInterface *gui, const string &configPath)
void saveFrameBufferAsImage(SLstring pathFilename, cv::Size targetSize=cv::Size(-1, -1))
Saves after n wait frames the front frame buffer as a PNG image.
void screenCaptureIsRequested(bool doScreenCap)
Specialized SLInput class for touch related input events.
string getDateTime2String()
Returns local time as string like "20190213-154611".
string unifySlashes(const string &inputDir, bool withTrailingSlash)
Returns the inputDir string with unified forward slashes, e.g.: "dirA/dirB/".
bool fileExists(const string &pathfilename)
Returns true if a file exists.
bool dirExists(const string &path)
Returns true if a directory exists.
string getDirName(const string &pathFilename)
Strip last component from file name.
string trimRightString(const string &s, const string &drop)
trims a string at the right end
bool makeDirRecurse(std::string path)