Embedding VSXu

It's not too hard to use VSXu as part of your project.

If you want to utilize the OpenGL features, all you have to do is run vsxu within an OpenGL context. This means it integrates well with Qt or other tools for instance.

If you don't want to use OpenGL - it's still possible, the engine itself doesn't make any use of OpenGL, but of course there is a limited amount of modules available...

An example

This is taken from the engine_helper.h in engine/include/.

Yea, it's really this easy to use VSXu Engine in your own project.

  #ifndef VSX_ENGINE_HELPER_H
  #define VSX_ENGINE_HELPER_H

  class vsx_engine_helper
  {
    vsx_command_list cmd_in;
    vsx_command_list cmd_out;
  public:
    vsx_engine* engine;

    vsx_engine_helper(vsx_string state_name, vsx_module_list_abs* module_list)
    {
      // create the new engine
      engine = new vsx_engine();
      engine->set_module_list( module_list );
      engine->set_no_send_client_time(true);
      engine->start();

      // set the screen to silent mode (no mess with openGL)
      vsx_module_param_int* engine_opengl_silent =
        (vsx_module_param_int*)engine->get_in_param_by_name("screen0", "opengl_silent");
      engine_opengl_silent->set(1);

      engine->load_state(state_name);
    }

    ~vsx_engine_helper()
    {
      engine->stop();
      delete engine;
    }

    void render(float max_time = 120.0f)
    {
      engine->process_message_queue( &cmd_in, &cmd_out, false, false , max_time);
      cmd_out.clear(true);
      engine->render();
    }
  };

  #endif // VSX_ENGINE_HELPER_H

For another example on how to initialize vsxu it's good to look at the code for vsxu_server:

https://github.com/vovoid/vsxu/blob/0.3.0/server/src/application.cpp

Getting help

If you have any questions, come by irc. More info here


VSXu Music Visualizer VSXu.com music/audio visualizer, visual programming language