Example #1
0
int main(int argc, char** argv)
{
    caWorld* world = circa_initialize();

    circa_add_module_search_path(world, "tests/embed");

    int iteration = 0;

    while (true) {

        caValue* value = circa_alloc_value();
        circa_set_int(value, iteration);

        circa_actor_run_message(world, "TestA", value);
        sleep(1);
        iteration++;
    }

    circa_shutdown(world);
}
Example #2
0
extern "C" int main(int argc, char *argv[])
{
    if (argc <= 1) {
        printf("Missing script argument\n");
        return 1;
    }
    
    caWorld* world = circa_initialize();

    improv::fix_current_directory();

    circa_use_local_filesystem(world, "");
    circa_add_module_search_path(world, "ca");

    improv::setup_native_patches(world);
    improv::setup_sdl_audio();

    improv::ImprovWindow window;
    window.init(world);

    const char* arg = argv[1];
    circa_set_string(circa_env_insert(window._stack, "scriptName"), arg);

    if (!improv::sdl_init())
        return 1;

    const int width = 1000;
    const int height = 600;

    window.setSize(width, height);

    SDL_PauseAudio(0);

    window.mainLoop();
    return 0;
}