From 71c1ae31007891ecfd59236ba8564bc4b5deb1e4 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 15 Apr 2005 00:53:56 +0000 Subject: Initial import --- opengl/main.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 opengl/main.cpp (limited to 'opengl/main.cpp') 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 +#include + +#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 -- cgit v1.2.3