-
Notifications
You must be signed in to change notification settings - Fork 0
/
obj2gl.cpp
46 lines (36 loc) · 863 Bytes
/
obj2gl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// obj2gl.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "ObjFile.h"
#include "GLFile.h"
int wmain(int argc, wchar_t* argv[])
{
try
{
if( argc != 3 )
{
throw swException(wstring_make() << "usage: input.obj output.gl" );
}
wstring InputFileName = argv[1];
wstring OutputFileName = argv[2];
TriMesh mesh;
cout << endl << "Loading: " << toNarrowString(InputFileName.c_str()).c_str() << endl;
ObjFile InputFile(InputFileName, mesh);
cout << endl << "Writing: " << toNarrowString(OutputFileName.c_str()) << endl;
GLFile OutputFile(OutputFileName, mesh);
return EXIT_SUCCESS;
}
catch(swException& e)
{
cout << toNarrowString(e.What()) << endl;
}
catch(exception& e)
{
cout << e.what() << endl;
}
catch(...)
{
cout << "unknown exception" << endl;
}
return EXIT_FAILURE;
}