summaryrefslogtreecommitdiff
path: root/opengl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/main.cpp')
-rw-r--r--opengl/main.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/opengl/main.cpp b/opengl/main.cpp
new file mode 100644
index 0000000..19ca5a9
--- /dev/null
+++ b/opengl/main.cpp
@@ -0,0 +1,74 @@
+// msGLExport - OpenGL exporter for Milkshape
+//
+// Copyright (C) 2005 Ian Cowburn (ianc@noddybox.demon.co.uk)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// -------------------------------------------------------------------------
+//
+static const char rcs_id[]="$Id$";
+
+#include <cstring>
+#include <cstdio>
+
+#include "mingwms.h"
+#include "msLib.h"
+
+#include "gldialog.h"
+
+
+// ----------------------------------------------------------------------
+// MINGW WRAPPER FUNCTIONS
+//
+static const char* GetTitle()
+{
+ return "Simple OpenGL";
+}
+
+static int Execute(msModel* model)
+{
+ if (!model)
+ {
+ return -1;
+ }
+
+ if (msModel_GetMeshCount(model)<1)
+ {
+ W32DLib::Common::Error(NULL,"No meshes in the model!");
+ return 0;
+ }
+
+ W32DLib::Common::Initialise();
+
+ Generate gen(model);
+ GLDialog dlg(gen);
+
+ if (dlg.ShowModal(W32DLib::Common::GetInstance(),NULL)==IDOK)
+ {
+ SetCursor(LoadCursor(NULL,IDC_WAIT));
+ gen.MakeFiles();
+ SetCursor(LoadCursor(NULL,IDC_ARROW));
+ }
+
+ return 1;
+}
+
+PLUGIN_SPEC void* CreatePlugIn()
+{
+ return CreateMINGWPlugin(MS_TYPE_EXPORT, GetTitle, Execute);
+}
+
+
+// END OF FILE