# nodesnim/window

Dark Mode

Search:
Group by:

# Imports

thirdparty/opengl, thirdparty/opengl/glut, core/color, core/exceptions, core/input, nodes/node, nodes/scene, environment

# Vars

    env: EnvironmentRef = newEnvironment()

    main_scene: SceneRef = nil

    current_scene: SceneRef = nil

    scenes: seq[SceneRef] = @[]

    paused: bool = false

# Procs

    proc addScene(scene: SceneRef) {...}{.raises: [], tags: [].}

  Adds a new scenes in app.

  Arguments:

  - `scene` - pointer to the Scene object.

    proc addMainScene(scene: SceneRef) {...}{.raises: [], tags: [].}

  Adds a new scene in the app and set it mark it as main scene.

  Arguents:

  - `scene` - pointer to the Scene object.

    proc changeScene(name: string): bool {...}{.discardable, raises: [Exception],
                                       tags: [RootEffect].}

  Changes current scene.

  Arguments:

  - `name` - name of the added scene.

    proc setMainScene(name: string) {...}{.raises: [], tags: [].}

  Set up main scene.

  Arguments:

  - `name` - name of the added scene.

    proc setTitle(title: cstring) {...}{.raises: [WindowNotCreatedError], tags: [].}

  Changes window title.

    proc Window(title: cstring; w: cint = 640; h: cint = 360) {...}{.cdecl,
        raises: [GLerror, Exception], tags: [RootEffect].}

  Creates a new window pointer

  Arguments:

  - `title` - window title.

    proc windowLaunch() {...}{.raises: [GLerror, Exception, MainSceneNotLoadedError],
                        tags: [RootEffect, TimeEffect].}

  Start main window loop.