SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppDemoSceneJansUniverse.h
Go to the documentation of this file.
1 /**
2  * \file AppDemoSceneJansUniverse.h
3  * \brief Class declaration for an SLScene inherited class
4  * \details For more info about App framework and the scene assembly see:
5  * https://cpvrlab.github.io/SLProject4/app-framework.html
6  * \date May 2024
7  * \authors Marcus Hudritsch, Marino von Wattenwyl
8  * \copyright http://opensource.org/licenses/GPL-3.0
9  * \remarks Please use clangformat to format the code. See more code style on
10  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
11 */
12 
13 #ifndef APPDEMOSCENEJANSUNIVERSE_H
14 #define APPDEMOSCENEJANSUNIVERSE_H
15 
16 #include "SLGLTexture.h"
17 #include <SLScene.h>
18 
19 //-----------------------------------------------------------------------------
20 //! Class for the benchmark scene for Jans Universe
22 {
23 public:
25 
26  //! All scene specific assets have to be registered for async loading in here.
27  /*! @remark All scene sspecific assets have to be loaded async by overriding
28  SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
29  assembling means that it happens in a parallel thread and that in there are
30  no OpenGL calls allowed. OpenGL calls are only allowed in the main thread.*/
31  void registerAssetsToLoad(SLAssetLoader& al) override;
32 
33  //! After parallel loading of the assets the scene gets assembled in here.
34  /*! @remark All scene-specific assets have to be loaded async by overriding
35  SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
36  assembling means that it happens in a parallel thread and that in there
37  are no OpenGL calls allowed. OpenGL calls are only allowed in the main
38  thread. It is important that all object instantiations within
39  SLScene::assemble do NOT call any OpenGL functions (gl*) because they happen
40  in a parallel thread. All objects that get rendered have to do their
41  initialization when they are used the first time during rendering in the
42  main thread.*/
43  void assemble(SLAssetManager* am, SLSceneView* sv) override;
45  SLScene* s,
46  SLNode* parent,
47  SLint parentID,
48  SLuint currentLevel,
49  SLuint levels,
50  SLuint childCount,
51  SLVMaterial& materials,
52  SLVMesh& meshes,
53  SLuint& numNodes);
55  SLScene* s,
56  SLNode* parent,
57  SLint parentID,
58  SLuint levels,
59  SLuint childCount,
60  SLVMaterial& materials,
61  SLVMesh& meshes);
62 
63 private:
67 };
68 //-----------------------------------------------------------------------------
69 
70 #endif
unsigned int SLuint
Definition: SL.h:171
int SLint
Definition: SL.h:170
vector< SLMaterial * > SLVMaterial
STL vector of material pointers.
Definition: SLMaterial.h:274
vector< SLMesh * > SLVMesh
Definition: SLMesh.h:263
Class for the benchmark scene for Jans Universe.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
void generateUniverse(SLAssetManager *am, SLScene *s, SLNode *parent, SLint parentID, SLuint levels, SLuint childCount, SLVMaterial &materials, SLVMesh &meshes)
Generates the Jan's Universe scene.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
void addUniverseLevel(SLAssetManager *am, SLScene *s, SLNode *parent, SLint parentID, SLuint currentLevel, SLuint levels, SLuint childCount, SLVMaterial &materials, SLVMesh &meshes, SLuint &numNodes)
Adds another level to Jan's Universe scene.
Toplevel holder of the assets meshes, materials, textures and shaders.
Texture object for OpenGL texturing.
Definition: SLGLTexture.h:110
SLNode represents a node in a hierarchical scene graph.
Definition: SLNode.h:147
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