46 ______ ___ _ __ ____ ___
47 / __/ / / _ \_______ (_)__ ____/ /_ / / / |_ |
48 _\ \/ /__/ ___/ __/ _ \ / / -_) __/ __/ /_ _/ / __/
49 /___/____/_/ /_/ \___/_/ /\__/\__/\__/ /_/(_)____/
114 "You can create only one AppCommon");
119 name = std::move(appName);
133 SLOptix::createStreamAndContext();
212 SL_LOG(
"Scene name : %s (SceneID: %d)",
219 #ifndef SL_EMSCRIPTEN
281 if (sceneView !=
nullptr)
282 sceneView->onInitialize();
301 #ifndef SL_EMSCRIPTEN
303 "You can delete a scene only once");
330 #ifndef SL_EMSCRIPTEN
366 thread jobThread(job);
The App namespace declares the App::Config struct and the App::run function.
The AppCommon class holds the top-level instances of the app-demo.
static void onBeforeSceneAssembly(SLSceneView *sv, SLScene *s)
static void onAfterSceneAssembly(SLSceneView *sv, SLScene *s)
static void onBeforeSceneDelete(SLSceneView *sv, SLScene *s)
static void onBeforeSceneLoad(SLSceneView *sv, SLScene *s)
int SLSceneID
Scene identifier.
constexpr SLSceneID SL_EMPTY_SCENE_ID
SLSceneID for an empty scene.
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
Wrapper Class around the external ImGui GUI-framework.
SLScene SLSceneView SLint sceneID
static void handleParallelJob()
Starts parallel job if one is queued.
static SLstring asciiLabel
SLProject ascii label string.
static const string CALIB_FTP_HOST
ftp host for calibration up and download
static CVCalibrationEstimator * calibrationEstimator
static SLstring version
SLProject version string.
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLstring name
Application name.
static void registerCoreAssetsLoad()
static SLIOBuffer fontDataProp
static const string CALIB_FTP_USER
ftp login user for calibration up and download
static SLstring fontPath
Path to font images.
static atomic< int > _jobProgressMax
Max. integer progress value.
static deque< function< void(void)> > jobsToBeThreaded
Queue of functions to be executed in a thread.
static const string CALIB_FTP_DIR
ftp directory for calibration up and download
static SLstring configPath
Default path for calibration files.
static SLstring calibIniPath
That's where data/calibrations folder is located.
static optional< SLSceneID > sceneToLoad
Scene id to load at start up.
static string jobProgressMsg()
Thread-safe getter of the progress message.
static string _jobProgressMsg
Text message to show during progress.
static SLAssetManager * assetManager
asset manager is the owner of all assets
static SLstring exePath
executable root path
static const string CALIB_FTP_PWD
ftp login pwd for calibration up and download
static SLstring gitCommit
Current GIT commit short hash id.
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 const string PROFILE_FTP_DIR
ftp directory for profiles upload
static SLstring modelPath
Path to 3D models.
static SLstring gitBranch
Current GIT branch.
static atomic< int > _jobProgressNum
Integer value to show progress.
static SLVSceneView sceneViews
Vector of sceneview pointers.
static SLIOBuffer fontDataFixed
static SLstring texturePath
Path to texture images.
static deque< function< void(void)> > jobsToFollowInMain
Queue of function to follow in the main thread.
static void onDoneLoading(SLSceneView *sv, SLScene *s, SLfloat startLoadMS)
static void switchScene(SLSceneView *sv, SLSceneID sceneID)
static CVCalibrationEstimatorParams calibrationEstimatorParams
static SLstring videoPath
Path to video files.
static SLstring gitDate
Current GIT commit date.
static SLstring configuration
Debug or Release configuration.
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 void onDoneAssembling(SLSceneView *sv, SLScene *s, SLfloat startLoadMS)
static mutex _jobMutex
Mutex to protect parallel access.
static SLstring appTag
Tag string used in logging.
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 calibFilePath
That's where calibrations are stored and loaded from.
static SLstring dataPath
Path to data directory (it is set platform dependent)
static void deleteApp()
Calls the destructor of the single scene instance.
void scene(SLScene *scene)
void loadAssetsAsync(function< void()> onDone)
void addLoadTask(SLAssetLoadTask task)
Add generic task.
void addRawDataToLoad(SLIOBuffer &buffer, SLstring filename, SLIOStreamKind kind)
Toplevel holder of the assets meshes, materials, textures and shaders.
void clear()
for all assets, clear gpu data
void generateStaticFonts(SLstring fontPath)
Encapsulation of a mobile device location set by the device's GPS sensor.
Encapsulation of a mobile device rotation set by the device's IMU sensor.
static void init(string shaderPath, string configPath)
Init by providing path to standard shader files.
static void deletePrograms()
Delete all instantiated programs.
static void loadPrograms()
Instantiate and load all programs.
static void deleteInstance()
global destruction
static SLGLState * instance()
Public static instance getter for singleton pattern.
static void deleteInstance()
static void deleteInstance()
void name(const SLstring &Name)
The SLScene class represents the top level instance holding the scene structure.
virtual void registerAssetsToLoad(SLAssetLoader &al)
All assets the should be loaded in parallel must be registered in here.
virtual void assemble(SLAssetManager *am, SLSceneView *sv)
After parallel loading of the assets the scene gets assembled in here.
void initOculus(SLstring shaderDir)
void loadTimeMS(SLfloat loadTimeMS)
void init(SLAssetManager *am)
SceneView class represents a dynamic real time 3D view onto the scene.
virtual void postSceneLoad()
void camera(SLCamera *camera)
void scene(SLScene *scene)
SLCamera * sceneViewCamera()
Interface for ui integration in SLSceneView.
Config config
The configuration set in App::run.
OnAfterSceneAssemblyCallback onAfterSceneAssembly
OnBeforeSceneAssemblyCallback onBeforeSceneAssembly
OnNewSceneCallback onNewScene
OnBeforeSceneLoadCallback onBeforeSceneLoad
OnBeforeSceneDeleteCallback onBeforeSceneDelete
Utility struct that holds a pointer and its length.
void deallocate()
Deallocates the data owned by the buffer.