SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLInterface.h
Go to the documentation of this file.
1 /**
2  * \file SLInterface.h
3  * \brief Declaration of the main Scene Library C-Interface.
4  * \details For more info on how to create a new app with SLProject see:
5  * https://github.com/cpvrlab/SLProject4/wiki/Creating-a-New-App
6  * For more info about App framework see:
7  * https://cpvrlab.github.io/SLProject4/app-framework.html
8  * \date July 2014
9  * \authors Marcus Hudritsch
10  * \copyright http://opensource.org/licenses/GPL-3.0
11  * \remarks Please use clangformat to format the code. See more code style on
12  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
13 */
14 
15 #ifndef SLINTERFACE_H
16 #define SLINTERFACE_H
17 
18 #include <SLEnums.h>
19 #include <SLGLEnums.h>
20 
21 class SLAssetManager;
22 class SLScene;
23 class SLSceneView;
24 class SLInputManager;
25 
26 //-----------------------------------------------------------------------------
27 void slCreateApp(SLVstring& cmdLineArgs,
28  const SLstring& dataPath,
29  const SLstring& shaderPath,
30  const SLstring& modelPath,
31  const SLstring& texturePath,
32  const SLstring& fontPath,
33  const SLstring& videoPath,
34  const SLstring& configPath,
35  const SLstring& applicationName);
36 //-----------------------------------------------------------------------------
38  SLScene* scene,
39  int screenWidth,
40  int screenHeight,
41  int dotsPerInch,
42  SLSceneID initScene,
43  void* onWndUpdateCallback,
44  void* onSelectNodeMeshCallback = nullptr,
45  void* onNewSceneViewCallback = nullptr,
46  void* onImGuiBuild = nullptr,
47  void* onImGuiLoadConfig = nullptr,
48  void* onImGuiSaveConfig = nullptr);
49 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 SLSceneView* slNewSceneView(SLScene* s, int dotsPerInch, SLInputManager& inputManager);
55 bool slShouldClose();
56 void slShouldClose(bool val);
57 void slTerminate();
58 void slResize(int sceneViewIndex, int width, int height);
59 bool slUpdateParallelJob();
60 bool slPaintAllViews();
61 //-----------------------------------------------------------------------------
62 void slMouseDown(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier);
63 void slMouseMove(int sceneViewIndex, int x, int y);
64 void slMouseUp(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier);
65 void slDoubleClick(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier);
66 void slTouch2Down(int sceneViewIndex, int x1, int y1, int x2, int y2);
67 void slTouch2Move(int sceneViewIndex, int x1, int y1, int x2, int y2);
68 void slTouch2Up(int sceneViewIndex, int x1, int y1, int x2, int y2);
69 void slTouch3Down(int sceneViewIndex, int x, int y);
70 void slTouch3Move(int sceneViewIndex, int x, int y);
71 void slTouch3Up(int sceneViewIndex, int x, int y);
72 void slMouseWheel(int sceneViewIndex, int pos, SLKey modifier);
73 void slKeyPress(int sceneViewIndex, SLKey key, SLKey modifier);
74 void slKeyRelease(int sceneViewIndex, SLKey key, SLKey modifier);
75 void slCharInput(int sceneViewIndex, unsigned int character);
76 //-----------------------------------------------------------------------------
77 bool slUsesRotation();
78 void slRotationQUAT(float quatX, float quatY, float quatZ, float quatW);
79 bool slUsesLocation();
80 void slLocationLatLonAlt(double latitudeDEG, double longitudeDEG, double altitudeM, float accuracyM);
81 string slGetWindowTitle(int sceneViewIndex);
82 void slSetupExternalDir(const SLstring& externalDirPath);
83 void slSetDeviceParameter(const SLstring& parameter, SLstring value);
84 //-----------------------------------------------------------------------------
85 #endif // SLINTERFACE_H
vector< SLstring > SLVstring
Definition: SL.h:201
string SLstring
Definition: SL.h:158
int SLint
Definition: SL.h:170
int SLSceneID
Scene identifier.
Definition: SLEnums.h:91
SLMouseButton
Mouse button codes.
Definition: SLEnums.h:98
SLKey
Keyboard key codes enumeration.
Definition: SLEnums.h:16
Enumerations containing OpenGL constants.
void slRotationQUAT(float quatX, float quatY, float quatZ, float quatW)
void slTouch3Down(int sceneViewIndex, int x, int y)
void slLoadCoreAssetsAsync()
bool slUsesRotation()
void slMouseMove(int sceneViewIndex, int x, int y)
void slSwitchScene(SLSceneView *sv, SLSceneID sceneID)
bool slUsesLocation()
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 slCharInput(int sceneViewIndex, unsigned int character)
void slTouch2Up(int sceneViewIndex, int x1, int y1, int x2, int y2)
void slLoadCoreAssetsSync()
void slTouch3Up(int sceneViewIndex, int x, int y)
void slResize(int sceneViewIndex, int width, int height)
bool slPaintAllViews()
string slGetWindowTitle(int sceneViewIndex)
Global function to retrieve a window title generated by the scene library.
void slMouseDown(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier)
SLint slCreateSceneView(SLAssetManager *am, SLScene *scene, int screenWidth, int screenHeight, int dotsPerInch, SLSceneID initScene, void *onWndUpdateCallback, void *onSelectNodeMeshCallback=nullptr, void *onNewSceneViewCallback=nullptr, void *onImGuiBuild=nullptr, void *onImGuiLoadConfig=nullptr, void *onImGuiSaveConfig=nullptr)
void slTouch2Move(int sceneViewIndex, int x1, int y1, int x2, int y2)
void slKeyPress(int sceneViewIndex, SLKey key, SLKey modifier)
void slTerminate()
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)
Definition: SLInterface.cpp:57
void slTouch3Move(int sceneViewIndex, int x, int y)
SLSceneView * slNewSceneView(SLScene *s, int dotsPerInch, SLInputManager &inputManager)
void slMouseUp(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier)
void slTouch2Down(int sceneViewIndex, int x1, int y1, int x2, int y2)
void slDoubleClick(int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier)
void slSetDeviceParameter(const SLstring &parameter, SLstring value)
Adds a value to the applications device parameter map.
void slSetupExternalDir(const SLstring &externalDirPath)
bool slShouldClose()
SLScene SLSceneView SLint sceneID
Definition: SLScene.h:33
Toplevel holder of the assets meshes, materials, textures and shaders.
SLInputManager. manages system input and custom input devices.
The SLScene class represents the top level instance holding the scene structure.
Definition: SLScene.h:47
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69