SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppMinimalMain.cpp File Reference
#include <App.h>
#include <AppCommon.h>
#include <SLScene.h>
#include <SLBox.h>
#include <SLLightDirect.h>
#include <SLSceneView.h>
#include <SLAssetLoader.h>
#include <SLImGui.h>
#include <SLInterface.h>
Include dependency graph for AppMinimalMain.cpp:

Go to the source code of this file.

Classes

class  AppMinimalScene
 Scene class derived from SLScene. More...
 

Functions

static SLScenecreateScene (SLSceneID sceneID)
 A static function in which you can create the new scene. More...
 
static void buildGui (SLScene *s, SLSceneView *sv)
 A static function that builds the UI with ImGui. More...
 
int SL_MAIN_FUNCTION (int argc, char *argv[])
 

Function Documentation

◆ buildGui()

static void buildGui ( SLScene s,
SLSceneView sv 
)
static

A static function that builds the UI with ImGui.

Definition at line 109 of file AppMinimalMain.cpp.

110 {
111  if (ImGui::BeginMainMenuBar())
112  {
113  if (ImGui::BeginMenu("View"))
114  {
115  if (ImGui::MenuItem("Reset Camera"))
116  {
117  sv->camera()->translation(2, 1, 3);
118  sv->camera()->lookAt(0, 0, 0);
119  }
120 
121  ImGui::EndMenu();
122  }
123 
124  ImGui::EndMainMenuBar();
125  }
126 }
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69
void camera(SLCamera *camera)
Definition: SLSceneView.h:145

◆ createScene()

static SLScene* createScene ( SLSceneID  sceneID)
static

A static function in which you can create the new scene.

Definition at line 103 of file AppMinimalMain.cpp.

104 {
105  return new AppMinimalScene();
106 }
Scene class derived from SLScene.

◆ SL_MAIN_FUNCTION()

int SL_MAIN_FUNCTION ( int  argc,
char *  argv[] 
)

Definition at line 128 of file AppMinimalMain.cpp.

129 {
131  config.argc = argc,
132  config.argv = argv;
133  config.windowWidth = 640;
134  config.windowHeight = 480;
135  config.windowTitle = "SLProject Minimal App";
138 
139  return App::run(config);
140 }
static void buildGui(SLScene *s, SLSceneView *sv)
A static function that builds the UI with ImGui.
static SLScene * createScene(SLSceneID sceneID)
A static function in which you can create the new scene.
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
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