PlugIn.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. // PlugIn.h: interface for the CPlugIn class.
  19. //
  20. //////////////////////////////////////////////////////////////////////
  21. #if !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)
  22. #define AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_
  23. #if _MSC_VER >= 1000
  24. #pragma once
  25. #endif // _MSC_VER >= 1000
  26. class CPlugIn : public CObject
  27. {
  28. private:
  29. HMODULE m_hDLL;
  30. PFN_QERPLUG_INIT m_pfnInit;
  31. PFN_QERPLUG_GETNAME m_pfnGetName;
  32. PFN_QERPLUG_GETCOMMANDLIST m_pfnGetCommandList;
  33. PFN_QERPLUG_DISPATCH m_pfnDispatch;
  34. PFN_QERPLUG_GETFUNCTABLE m_pfnGetFuncTable;
  35. PFN_QERPLUG_GETTEXTUREINFO m_pfnGetTextureInfo;
  36. PFN_QERPLUG_LOADTEXTURE m_pfnLoadTexture;
  37. PFN_QERPLUG_GETSURFACEFLAGS m_pfnGetSurfaceFlags;
  38. PFN_QERPLUG_REGISTERPLUGINENTITIES m_pfnRegisterPluginEntities;
  39. PFN_QERPLUG_INITSURFACEPROPERTIES m_pfnInitSurfaceProperties;
  40. PFN_QERPLUG_REQUESTINTERFACE m_pfnRequestInterface;
  41. CWordArray m_CommandIDs;
  42. CStringArray m_CommandStrings;
  43. CString m_strName;
  44. CString m_strVersion;
  45. // for plugins that provide plugin entities
  46. _QERPlugEntitiesFactory* m_pQERPlugEntitiesFactory;
  47. public:
  48. void InitBSPFrontendPlugin();
  49. IPluginEntity * CreatePluginEntity( entity_t * );
  50. HMODULE GetDLLModule() { return m_hDLL; }
  51. void InitSurfacePlugin();
  52. void RegisterPluginEntities();
  53. void* getFuncTable();
  54. bool ownsCommandID(int n);
  55. void addMenuID(int n);
  56. CPlugIn();
  57. virtual ~CPlugIn();
  58. bool load(const char *p);
  59. void free();
  60. const char* getVersionStr();
  61. const char* getMenuName();
  62. int getCommandCount();
  63. const char* getCommand(int n);
  64. void dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush);
  65. _QERTextureInfo *getTextureInfo();
  66. void loadTexture(LPCSTR pFilename);
  67. LPVOID getSurfaceFlags();
  68. };
  69. #endif // !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)