SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppNodeMain.cpp
Go to the documentation of this file.
1 /**
2  * \file AppNodeMain.cpp
3  * \brief File with the main function and two callbacks for the node demo app
4  * \date July 2014
5  * \authors Marcus Hudritsch
6  * \copyright http://opensource.org/licenses/GPL-3.0
7  * \remarks Please use clangformat to format the code. See more code style on
8  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9 */
10 
11 #include <App.h>
12 #include <AppCommon.h>
13 #include <AppNodeGui.h>
14 #include <AppNodeSceneView.h>
15 #include <AppNodeScene.h>
16 
17 //-----------------------------------------------------------------------------
19  int myDPI,
20  SLInputManager& inputManager)
21 {
22  return new AppNodeSceneView(scene, myDPI, inputManager);
23 }
24 //-----------------------------------------------------------------------------
26 {
27  return new AppNodeScene();
28 }
29 //-----------------------------------------------------------------------------
30 int SL_MAIN_FUNCTION(int argc, char* argv[])
31 {
33  config.argc = argc;
34  config.argv = argv;
35  config.windowWidth = 640;
36  config.windowHeight = 480;
37  config.windowTitle = "SLProject Node Demo";
41 
42  return App::run(config);
43 }
44 //-----------------------------------------------------------------------------
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 SLSceneView * createSceneView(SLScene *scene, int myDPI, SLInputManager &inputManager)
Definition: AppNodeMain.cpp:18
int SL_MAIN_FUNCTION(int argc, char *argv[])
Definition: AppNodeMain.cpp:30
static SLScene * createScene(SLSceneID sceneID)
Definition: AppNodeMain.cpp:25
Scene creation callback for the the node demo app.
Node transform test app to demonstrates all transforms of SLNode.
int SLSceneID
Scene identifier.
Definition: SLEnums.h:91
SLScene SLSceneView SLint sceneID
Definition: SLScene.h:33
static void build(SLScene *s, SLSceneView *sv)
Creates the ImGui UI.
Definition: AppNodeGui.cpp:28
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
int run(Config config)
App::run implementation from App.h for the Emscripten platform.
Definition: AppAndroid.cpp:78
Config config
The configuration set in App::run.
Definition: AppAndroid.cpp:34
App configuration struct to be passed to the App::run function.
Definition: App.h:57
SLint windowWidth
Definition: App.h:60
SLint windowHeight
Definition: App.h:61
OnNewSceneViewCallback onNewSceneView
Definition: App.h:65
OnNewSceneCallback onNewScene
Definition: App.h:66
OnGuiBuildCallback onGuiBuild
Definition: App.h:72
int argc
Definition: App.h:58
char ** argv
Definition: App.h:59
SLstring windowTitle
Definition: App.h:62