EngineGUI.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. #include <Engine/Engine.h>
  13. #ifdef ENGINEGUI_EXPORTS
  14. #define ENGINEGUI_API __declspec(dllexport)
  15. #else
  16. #define ENGINEGUI_API __declspec(dllimport)
  17. #ifdef NDEBUG
  18. #pragma comment(lib, "EngineGUI.lib")
  19. #else
  20. #pragma comment(lib, "EngineGUID.lib")
  21. #endif
  22. #endif
  23. class CEngineGUI
  24. {
  25. public:
  26. /* Functions used by application for getting and setting registry keys concerning modes */
  27. ENGINEGUI_API void GetFullScreenModeFromRegistry( CTString strSectionName, CDisplayMode &dm, GfxAPIType &gat);
  28. ENGINEGUI_API void SetFullScreenModeToRegistry( CTString strSectionName, CDisplayMode dm, GfxAPIType gat);
  29. /* Call select mode dialog */
  30. ENGINEGUI_API void SelectMode( CDisplayMode &dm, GfxAPIType &gat);
  31. /* Call create texture dialog */
  32. ENGINEGUI_API CTFileName CreateTexture( CTFileName fnTexFileToRecreate = CTString(""),
  33. CDynamicArray<CTFileName> *pafnCreatedTextures=NULL);
  34. /* Predefined registry key names */
  35. #define KEY_NAME_REQUEST_FILE_DIR "Request file directory"
  36. #define KEY_NAME_DETAIL_TEXTURE_DIR "Detail texture directory"
  37. #define KEY_NAME_BASE_TEXTURE_DIR "Base texture directory"
  38. #define KEY_NAME_CREATE_TEXTURE_DIR "Create texture directory"
  39. #define KEY_NAME_CREATE_ANIMATED_TEXTURE_DIR "Create animated texture directory"
  40. #define KEY_NAME_CREATE_EFFECT_TEXTURE_DIR "Create effect texture directory"
  41. #define KEY_NAME_BACKGROUND_TEXTURE_DIR "Background texture directory"
  42. #define KEY_NAME_REPLACE_TEXTURE_DIR "Replace texture directory"
  43. #define KEY_NAME_SCREEN_SHOT_DIR "Screen shots directory"
  44. /* Predefined file filters for file requester */
  45. #define FILTER_ALL "All files (*.*)\0*.*\0"
  46. #define FILTER_PICTURES "Pictures (*.pcx;*.tga)\0*.pcx;*.tga\0"
  47. #define FILTER_3DOBJ "3D object\0*.lwo;*.obj;*.3ds\0"
  48. #define FILTER_LWO "Lightwave object (*.lwo)\0*.lwo\0"
  49. #define FILTER_OBJ "Alias Wavefront Object (*.obj)\0*.obj\0"
  50. #define FILTER_3DS "3DS object (*.3ds)\0*.3ds\0"
  51. #define FILTER_SCR "Scripts (*.scr)\0*.scr\0"
  52. #define FILTER_PCX "PCX files (*.pcx)\0*.pcx\0"
  53. #define FILTER_TGA "TGA files (*.tga)\0*.tga\0"
  54. #define FILTER_TEX "Textures (*.tex)\0*.tex\0"
  55. #define FILTER_TBN "Thumbnails (*.tbn)\0*.tbn\0"
  56. #define FILTER_MDL "Models (*.mdl)\0*.mdl\0"
  57. #define FILTER_WLD "Worlds (*.wld)\0*.wld\0"
  58. #define FILTER_WAV "Sounds (*.wav)\0*.wav\0"
  59. #define FILTER_ANI "Animations (*.ani)\0*.ani\0"
  60. #define FILTER_TXT "Text files (*.txt)\0*.txt\0"
  61. #define FILTER_LST "List files (*.lst)\0*.lst\0"
  62. #define FILTER_TGA "TGA files (*.tga)\0*.tga\0"
  63. #define FILTER_SMC "SMC files (*.smc)\0*.smc\0"
  64. #define FILTER_END "\0"
  65. /* File requester with thumbnail display */
  66. ENGINEGUI_API CTFileName FileRequester( char *pchrTitle="Choose file",
  67. char *pchrFilters=FILTER_ALL FILTER_END,
  68. char *pchrRegistry=KEY_NAME_REQUEST_FILE_DIR,
  69. CTString strDefaultDir="", CTString strFileSelectedByDefault="",
  70. CDynamicArray<CTFileName> *pafnCreatedTextures=NULL,
  71. BOOL bIfOpen=TRUE);
  72. /* Call browse texture requester */
  73. ENGINEGUI_API CTFileName BrowseTexture(CTFileName fnDefaultSelected=CTString(""),
  74. char *pchrIniKeyName=KEY_NAME_REQUEST_FILE_DIR,
  75. char *pchrWindowTitle="Choose texture",
  76. BOOL bIfOpen=TRUE);
  77. };
  78. // global engine gui handling object
  79. ENGINEGUI_API extern CEngineGUI _EngineGUI;