![]() |
SLProject 4.0.000
|
#include <SLGLState.h>#include <SLEnums.h>#include <SLInterface.h>#include <AppDemo.h>#include <SLAssetManager.h>#include <SLScene.h>#include <SLSceneView.h>#include <CVCapture.h>#include <AppDemoGui.h>#include <AppDemoSceneView.h>#include <GLFW/glfw3.h>#include <Profiler.h>Functions | |
| void | appDemoLoadScene (SLAssetManager *am, SLScene *s, SLSceneView *sv, SLSceneID sceneID) |
| Forward declaration of the scene definition function from AppDemoLoad.cpp. More... | |
| bool | onUpdateVideo () |
| Implements the update per frame for video update and feature tracking. More... | |
| void | onClose (GLFWwindow *myWindow) |
| SLbool | onPaint () |
| SLKey | mapKeyToSLKey (SLint key) |
| Maps the GLFW key codes to the SLKey codes. More... | |
| static void | onResize (GLFWwindow *myWindow, int width, int height) |
| static void | onMouseButton (GLFWwindow *myWindow, int button, int action, int mods) |
| static void | onMouseMove (GLFWwindow *myWindow, double x, double y) |
| static void | onMouseWheel (GLFWwindow *myWindow, double xscroll, double yscroll) |
| static void | onKeyPress (GLFWwindow *myWindow, int GLFWKey, int scancode, int action, int mods) |
| void | onCharInput (GLFWwindow *, SLuint c) |
| Event handler for GLFW character input. More... | |
| void | onGLFWError (int error, const char *description) |
| SLSceneView * | createAppDemoSceneView (SLScene *scene, int curDPI, SLInputManager &inputManager) |
| Alternative SceneView creation C-function passed by slCreateSceneView. More... | |
| void | initGLFW (int screenWidth, int screenHeight) |
| Initialises all GLFW and GL3W stuff. More... | |
| void | initSL (SLVstring &cmdLineArgs) |
| Inits all for SLProject library. More... | |
| int | main (int argc, char *argv[]) |
Variables | |
| static GLFWwindow * | window |
| The global glfw window handle. More... | |
| static SLint | svIndex |
| SceneView index. More... | |
| static SLint | scrWidth |
| Window width at start up. More... | |
| static SLint | scrHeight |
| Window height at start up. More... | |
| static SLbool | fixAspectRatio |
| Flag if wnd aspect ratio should be fixed. More... | |
| static SLfloat | scrWdivH |
| aspect ratio screen width divided by height More... | |
| static SLint | dpi = 142 |
| Dot per inch resolution of screen. More... | |
| static SLint | startX |
| start position x in pixels More... | |
| static SLint | startY |
| start position y in pixels More... | |
| static SLint | mouseX |
| Last mouse position x in pixels. More... | |
| static SLint | mouseY |
| Last mouse position y in pixels. More... | |
| static SLVec2i | touch2 |
| Last finger touch 2 position in pixels. More... | |
| static SLVec2i | touchDelta |
| Delta between two fingers in x. More... | |
| static SLint | lastWidth |
| Last window width in pixels. More... | |
| static SLint | lastHeight |
| Last window height in pixels. More... | |
| static SLfloat | lastMouseDownTime = 0.0f |
| Last mouse press time. More... | |
| static SLKey | modifiers = K_none |
| last modifier keys More... | |
| static SLbool | fullscreen = false |
| flag if window is in fullscreen mode More... | |
| void appDemoLoadScene | ( | SLAssetManager * | am, |
| SLScene * | s, | ||
| SLSceneView * | sv, | ||
| SLSceneID | sceneID | ||
| ) |
Forward declaration of the scene definition function from AppDemoLoad.cpp.
Forward declaration of the scene definition function from AppDemoLoad.cpp.
appDemoLoadScene builds a scene from source code. Such a function must be passed as a void*-pointer to slCreateScene. It will be called from within slCreateSceneView as soon as the view is initialized. You could separate different scene by a different sceneID.
The purpose is to assemble a scene by creating scenegraph objects with nodes (SLNode) and meshes (SLMesh). See the scene with SID_Minimal for a minimal example of the different steps.
| SLSceneView * createAppDemoSceneView | ( | SLScene * | scene, |
| int | curDPI, | ||
| SLInputManager & | inputManager | ||
| ) |
Alternative SceneView creation C-function passed by slCreateSceneView.
| void initGLFW | ( | int | screenWidth, |
| int | screenHeight | ||
| ) |
Initialises all GLFW and GL3W stuff.
| void initSL | ( | SLVstring & | cmdLineArgs | ) |
Inits all for SLProject library.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
The C main procedure running the GLFW GUI application.
| void onCharInput | ( | GLFWwindow * | , |
| SLuint | c | ||
| ) |
Event handler for GLFW character input.
| void onClose | ( | GLFWwindow * | myWindow | ) |
onClose event handler for deallocation of the scene & sceneview. onClose is called glfwPollEvents, glfwWaitEvents or glfwSwapBuffers.
| void onGLFWError | ( | int | error, |
| const char * | description | ||
| ) |
Error callback handler for GLFW.
|
static |
Key event handler sets the modifier key state & forwards the event to the slKeyPress function.
|
static |
Mouse button event handler forwards the events to the slMouseDown or slMouseUp. Two finger touches of touch devices are simulated with ALT & CTRL modifiers.
|
static |
Mouse move event handler forwards the events to slMouseMove or slTouch2Move.
|
static |
Mouse wheel event handler forwards the events to slMouseWheel
| SLbool onPaint | ( | ) |
onPaint: Paint event handler that passes the event to the slPaint function.
|
static |
onResize: Event handler called on the resize event of the window. This event should called once before the onPaint event.
| bool onUpdateVideo | ( | ) |
Implements the update per frame for video update and feature tracking.
This routine is called once per frame before any other update within the the main rendering loop (see: AppDemoMainGLFW::onPaint or GLES3View::onDrawFrame). See the documentation within SLCVTracked and in all of its inheritants.
|
static |
Dot per inch resolution of screen.
|
static |
Flag if wnd aspect ratio should be fixed.
|
static |
flag if window is in fullscreen mode
|
static |
Last window height in pixels.
|
static |
Last mouse press time.
|
static |
Last window width in pixels.
|
static |
Last mouse position x in pixels.
|
static |
Last mouse position y in pixels.
|
static |
Window height at start up.
|
static |
aspect ratio screen width divided by height
|
static |
Window width at start up.
|
static |
start position x in pixels
|
static |
start position y in pixels
|
static |
SceneView index.
|
static |
Last finger touch 2 position in pixels.
|
static |
Delta between two fingers in x.
|
static |
The global glfw window handle.