source: OGRE/trunk/ogrenew/Tools/3dsmaxExport/OgreExport/src/dllmain.cpp @ 692

Revision 692, 3.5 KB checked in by mattausch, 18 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25
26#include "max.h"
27#include "plugapi.h"
28#include "impexp.h"
29
30#include "OgreExport.h"
31
32static int controlsInit = FALSE;
33static HINSTANCE hInstance;
34
35BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) {
36        hInstance = hinstDLL;
37
38        if ( !controlsInit ) {
39                controlsInit = TRUE;
40               
41                // jaguar controls
42                InitCustomControls(hInstance);
43
44                // initialize Chicago controls
45                InitCommonControls();
46                }
47        switch(fdwReason) {
48                case DLL_PROCESS_ATTACH:
49                        //MessageBox(NULL,_T("3DSIMP.DLL: DllMain"),_T("3DSIMP"),MB_OK);
50                        if (FAILED(CoInitialize(NULL)))
51                                return FALSE;
52                        break;
53                case DLL_THREAD_ATTACH:
54                        break;
55                case DLL_THREAD_DETACH:
56                        break;
57                case DLL_PROCESS_DETACH:
58                        break;
59                }
60        return(TRUE);
61        }
62
63
64//------------------------------------------------------
65static OgreMaxExportClassDesc OgreMaxExportDescInst;
66
67int OgreMaxExportClassDesc::IsPublic() {
68        return 1;
69}
70
71void * OgreMaxExportClassDesc::Create(BOOL loading) {
72        OgreMaxExport *inst = new OgreMaxExport(hInstance);
73        return inst;
74}
75
76const TCHAR * OgreMaxExportClassDesc::ClassName() {
77        return _T("Ogre 3DSMax Exporter");
78}
79
80SClass_ID OgreMaxExportClassDesc::SuperClassID() {
81        return SCENE_EXPORT_CLASS_ID;
82}
83
84Class_ID OgreMaxExportClassDesc::ClassID() {
85        return Class_ID(0x2a961d1d, 0x8160db1);
86}
87
88const TCHAR* OgreMaxExportClassDesc::Category() {
89        return _T("Ogre 3DSMax Exporter");
90}
91
92extern "C" {
93//------------------------------------------------------
94// This is the interface to Jaguar:
95//------------------------------------------------------
96
97// what does this DLL contain?
98__declspec( dllexport ) const TCHAR *
99LibDescription() {
100        return _T("Ogre 3DSMax Exporter");
101}
102
103// how many plugin classes do we implement in this DLL?
104__declspec( dllexport ) int
105LibNumberClasses() {
106        return 1;
107}
108
109// return a class descriptor class for each plugin class in this DLL;
110// 0-based, so i==0 is the first plugin in this DLL, and so on
111__declspec( dllexport ) ClassDesc *
112LibClassDesc(int i) {
113        switch(i) {
114                case 0:
115                        return &OgreMaxExportDescInst;
116                        break;
117                default:
118                        return 0;
119                        break;
120        }
121}
122
123// Return version so can detect obsolete DLLs
124__declspec( dllexport ) ULONG
125LibVersion() {
126        return VERSION_3DSMAX;
127}
128
129// Let the plug-in register itself for deferred loading
130__declspec( dllexport ) ULONG CanAutoDefer()
131{
132        return 1;
133}
134
135}
Note: See TracBrowser for help on using the repository browser.