Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis15/src/tests/new-tests/vr-lite/main.c
ViewVC logotype

View of /branches/vis15/src/tests/new-tests/vr-lite/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4419 - (download) (as text) (annotate)
Wed Aug 17 12:49:55 2016 UTC (2 years, 10 months ago) by jhr
File size: 999 byte(s)
  working on merge: added EXPLICIT_TEMPLATES configuration parameter
/*! \file main.c
 *
 * \author John Reppy
 */

/*
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 */

#include "vr-lite-cam.h"

int main (int argc, const char **argv)
{
    VR_world_t *wrld = VR_new_world ();

    if (VR_init_world (wrld)) {
	char *err = biffGetDone(NRRD);
        fprintf(stderr, "Trouble saving nrrd struct: %s\n", err);
        return 1;
    }

    VR_set_verbose (wrld, true);

    VR_create_strands (wrld);

    uint32_t nSteps = VR_run (wrld, 0);

  // get results
    Nrrd *nData = nrrdNew();
    if (VR_output_get_outRGBA (wrld, nData)) {
      // error
	fprintf(stderr, "Error getting nrrd data: %s\n", VR_get_errors(wrld));
	return 1;
    }

    if (nrrdSave("out.nrrd", nData, NULL)) {
        char *err = biffGetDone(NRRD);
        fprintf(stderr, "Trouble saving nrrd struct: %s\n", err);
        return 1;
    }

    VR_shutdown (wrld);

    return 0;
}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0