Cafu Engine
PlatformAux.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_PLATFORM_AUX_HPP_INCLUDED
8 #define CAFU_PLATFORM_AUX_HPP_INCLUDED
9 
10 #ifdef _WIN32
11 #define WIN32_LEAN_AND_MEAN
12 #include <windows.h>
13 #elif __linux__
14 #define HMODULE void*
15 #endif
16 
17 #include <string>
18 
19 namespace MatSys
20 {
21  class RendererI;
22  class TextureMapManagerI;
23 }
24 
25 class SoundSysI;
26 
27 
28 namespace PlatformAux
29 {
30  /// Returns a file suffix that indicates the platform, the compiler, and the debug/release switch setting.
31  /// Examples include "_win32_ow_r", "_li686_g++_d", etc.
32  /// @return The suffix that indicates the platform, compiler, and debug/release built.
33  std::string GetEnvFileSuffix();
34 
35  /// Gets the renderer by name.
36  /// @param DLLName The path and full name of the desired renderer DLL, e.g. "Renderers/RendererNull_win32_vc60_r.dll".
37  /// @param OutRendererDLL On success, returns the DLL handle of the renderer.
38  /// @return On success, the pointer to the implementation of the MatSys::RendererI. NULL on failure.
39  MatSys::RendererI* GetRenderer(const std::string& DLLName, HMODULE& OutRendererDLL);
40 
41  /// Auto-selects the "best" renderer from the "Renderers/" subdirectory.
42  /// @param OutRendererDLL On success, returns the DLL handle of the best renderer.
43  /// @return On success, the pointer to the implementation of the best MatSys::RendererI. NULL on failure.
44  MatSys::RendererI* GetBestRenderer(HMODULE& OutRendererDLL);
45 
46  /// Returns the MatSys::TextureMapManagerI implementation of the RendererDLL.
47  /// @param RendererDLL The renderer DLL for which the texture manager should be returned.
48  /// @return On success the MatSys::TextureMapManagerI implementation of the RendererDLL. NULL on failure.
49  MatSys::TextureMapManagerI* GetTextureMapManager(HMODULE RendererDLL);
50 
51  /// Gets the sound system by name.
52  /// @param DLLName The path and full name of the desired sound system DLL.
53  /// @param OutSoundSysDLL On success, returns the DLL handle of the sound system.
54  /// @return On success, the pointer to the implementation of the SoundSysI. NULL on failure.
55  SoundSysI* GetSoundSys(const std::string& DLLName, HMODULE& OutSoundSysDLL);
56 
57  /// Auto-selects the "best" sound system from the "SoundSys/" subdirectory.
58  /// @param OutSoundSysDLL On success, returns the DLL handle of the best sound system.
59  /// @return On success, the pointer to the implementation of the best SoundSysI. NULL on failure.
60  SoundSysI* GetBestSoundSys(HMODULE& OutSoundSysDLL);
61 
62 }
63 
64 #endif
This is an interface to the sound system.
Definition: SoundSys.hpp:19
This is an interface to the texture-map manager.
Definition: TextureMap.hpp:38
This class provides an interface to a renderer.
Definition: Renderer.hpp:31