libbubulle/tools/read_obj.c

65 lines
1.1 KiB
C

/*
tentatives de lecture des OBJ
*/
#include <stdio.h>
#include <stdlib.h>
#include <libgen.h> // for basename(3)
#include <unistd.h>
#include "../bubulles.h"
#include "../edges.h"
#include "objtrucs.h"
int verbosity = 0;
/* --------------------------------------------------------------------- */
void help(void)
{
printf("nothing to say...\n");
exit(0);
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo, opt;
// char *fname; /* see manpage basename(3) */
fprintf(stderr, "\n### READ_OBJ compiled %s at %s\n", __DATE__, __TIME__);
if (1 == argc) {
bubulles_version(1);
exit(0);
}
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch(opt) {
case 'h':
help(); break;
case 'v':
verbosity++; break;
default:
exit(1);
break;
}
}
if (optind < argc) {
// fprintf(stderr, "ARG = %s\n", argv[optind]);
foo = try_to_read_an_OBJ_file(argv[optind], 0);
if (foo) {
fprintf(stderr, "Error number %d on '%s'\n", foo, argv[optind]);
exit(1);
}
}
else {
fprintf(stderr, "%s need a input filename\n", argv[0]);
exit(1);
}
return 0;
}