Major API revision
[convexer.git] / cxr / test.c
diff --git a/cxr/test.c b/cxr/test.c
new file mode 100644 (file)
index 0000000..4529b98
--- /dev/null
@@ -0,0 +1,35 @@
+#include "convexer.c"
+#include "solid.h"
+
+int main(int arc, const char *argv[])
+{
+   cxr_vdf *vdo = cxr_vdf_open(
+      "/home/harry/Documents/blender_addons_remote/addons/convexer/test.vmf" );
+
+   cxr_vmf_context ctx =
+   {
+      .brush_count = 0,
+      .entity_count = 0,
+      .face_count = 0,
+      .detailvbsp = "",
+      .detailmaterial = "",
+      .lightmap_scale = 12,
+      .mapversion = 4,
+      .offset = { 0.0, 0.0, 0.0 },
+      .scale = 32.0,
+      .skyname = "vertigoblue"
+   };
+
+   cxr_world *world = cxr_decompose( &test_mesh );
+   if( world )
+   {
+      cxr_push_world_vmf( world, &ctx, vdo );
+      cxr_free_world( world );
+   }
+
+   cxr_vmf_begin_entities( &ctx, vdo );
+   cxr_end_vmf( &ctx, vdo );
+
+   cxr_vdf_close(vdo);
+   return 0;
+}