myou_engine

  Source   Edit

This module containst the functions to start using Myou Engine.

let engine = newMyouEngine(1024, 768, "My Game")

# Create or load your initial scene here

engine.run()

Procs

proc get_builtin_shader_library(use_cubemap_prefiltering = true): string {.
    ...raises: [IOError], tags: [ReadIOEffect].}
Returns a string with the code of the default shader library of the engine. If you use this, you may want to also add the textures given by get_builtin_shader_textures.   Source   Edit
proc get_builtin_shader_textures(): Table[string, Texture] {....raises: [],
    tags: [].}
Returns a table of textures to be used with the library that is returned by get_builtin_shader_library.   Source   Edit
proc loadScene(self: MyouEngine; uri: string;
               callback: proc (err: string; scene: Scene); name = ""; ext = "") {.
    ...raises: [ValueError, KeyError, Exception], tags: [RootEffect].}
  Source   Edit
proc myou_main_loop(self: MyouEngine) {....raises: [ValueError, Exception],
                                        tags: [RootEffect, TimeEffect].}

Runs one iteration of the engine main loop. It doesn't swap buffers.

You usually don't need to call this. Use run instead.

  Source   Edit
proc newMyouEngine(width, height: int32; title = "Myou Engine window";
                   opengl_version = default_gl_version;
                   opengl_es = default_gl_es; glsl_version = "";
                   use_glsl_tone_mapping = true): MyouEngine {.
    ...raises: [Exception], tags: [RootEffect].}
Creates a Myou Engine instance. You need to call this before you can use the engine. You also need to call run at the end of your main project file.   Source   Edit
proc run(self: MyouEngine) {....raises: [], tags: [TimeEffect].}
Starts the main loop of the engine. You should call it at the end of your main file. In mobile platforms and on web, this function doesn't block, and instead it just configures the main loop function. Therefore you shouldn't run any code after calling it.   Source   Edit