summaryrefslogtreecommitdiff
path: root/test/mstest.cpp
blob: 1a63d6d170cc24d1ac7e1b08633fd014c55d79ab (plain)
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
#include <w32dlib/w32dlib.h>

#include "mingwms.h"
#include "msLib.h"

static const char* GetTitle()
{
    return "Mingw test plugin";
}

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;
    }

    for(int i = 0; i < msModel_GetMeshCount(model); ++i)
    {
	msMesh* mesh = msModel_GetMeshAt(model, i);
	char buf[256];
	msMesh_GetName(mesh, buf, 255);
	W32DLib::Common::Message(NULL, buf);
    }

    return 0;
}

PLUGIN_SPEC void* CreatePlugIn()
{
    return CreateMINGWPlugin(MS_TYPE_TOOL, GetTitle, Execute);
}