![]() |
CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
|
Config Manager class. More...
Config Manager class.
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request Configuration Manager information. | |
| void | setMTFriendly (Uint8 iDelayMS) |
| Set the multithread-friendly scheduler yield. | |
| Uint8 | getMTFriendly () const |
| Get the multithread-friendly scheduler yield. | |
| bool | audioInit (eConfigAudioFreq eAF=CAF_DEFAULT, eConfigAudioSample eAS=CAS_DEFAULT, eConfigAudioMode eAM=CAM_DEFAULT) |
| Initialize the audio system. | |
| bool | audioIsReady (eConfigAudioFreq *eAF=nullptr, eConfigAudioSample *eAS=nullptr, eConfigAudioMode *eAM=nullptr) |
| Check whether the audio system is ready. | |
| bool | audioClose () |
| Close the audio system. | |
| bool | audioSetDriver (eConfigAudioDriver eCAD) |
| Set the audio driver. | |
| eConfigAudioDriver | audioGetDriver () const |
| Get the audio driver. | |
| const char * | audioGetDriverInUse () const |
| Get the audio driver name in use. | |
| bool | audioSetMasterGain (float fGain) |
| Set Master gain (Volume). | |
| float | audioGetMasterGain () const |
| Get Master gain (Volume). | |
| bool | audioSetTagGain (eAudioTrackTag eTag, float fGain) |
| Set Gain (Volume) for a specific audio track tag category. | |
| float | audioGetTagGain (eAudioTrackTag eTag) const |
| Get the current gain for a specific audio track tag category. | |
| MIX_Mixer * | audioGetMixer () |
| Get the internal SDL3 Mixer Device handle. | |
| Sint32 | create (const string &sName, Uint32 iReserved=0) override |
| Create a new screen. | |
| Sint32 | close (Sint32 idScreen) override |
| Close and destroy a screen. | |
| Sint32 | getCount () const override |
| Get number of loaded objects. | |
| Sint32 | setName (Sint32 idScreen, const string &sName) override |
| Change the object name. | |
| void | reset (Sint32 iMode=0) |
| Set all default values, close audio system, remove all existing screens and create the "default" screen. | |
| Screen * | get (Sint32 idScreen=0) |
| Get a pointer to the screen using its handle. | |
| Screen * | get (SDL_Window *wScreen) |
| Get a pointer to the screen using a SDL_Window pointer. | |
| Sint32 | save (const string &sConfigXML, const string &sCDCFile="") |
| Save current audio/screens configuration. | |
| Sint32 | loadFromFile (const string &sConfigXML) |
| Load audio/screen configuration from a file. | |
| Sint32 | load (const string &sCDCFile, const string &sConfigXML) |
| Load audio/screen configuration from a CDC file. | |
| Sint32 | load (Sint32 idCDC, const string &sConfigXML) |
| Load audio/screen configuration from a CDC file. | |
| Sint32 | setup (const string &sConfigXML, const string &sConfigCDC="", const string &sCustomSetupXML="") |
| Open the setup window for configuring audio/screen settings. | |
| Sint32 | setup (const string &sConfigXML, Sint32 idConfigCDC, const string &sCustomSetupXML="") |
| Open the setup window for configuring audio/screen settings. | |
|
override |
Request Configuration Manager information.
Writes manager information to the default log. Displays: general settings (multithread friendly flag), graphics information (displays, renderer drivers, screens), and audio information (devices, drivers, output).
| iMode | -1 to display only manager information. 0 (default) to display manager and all screens. A specific screen ID displays manager information and only that screen. |
| void CRM64Pro::ConfigMgr::setMTFriendly | ( | Uint8 | iDelayMS | ) |
Set the multithread-friendly scheduler yield.
| iDelayMS | Delay in milliseconds after each render frame. Use 0 to disable it. Valid range: [0, 255]. |
| Uint8 CRM64Pro::ConfigMgr::getMTFriendly | ( | ) | const |
Get the multithread-friendly scheduler yield.
| bool CRM64Pro::ConfigMgr::audioInit | ( | eConfigAudioFreq | eAF = CAF_DEFAULT, |
| eConfigAudioSample | eAS = CAS_DEFAULT, | ||
| eConfigAudioMode | eAM = CAM_DEFAULT ) |
Initialize the audio system.
The first call to this method initializes the SDL audio subsystem.
| eAF | Audio frequency. Default ::CAF_DEFAULT resolves to ::CAF_44K (44100 Hz). |
| eAS | Audio sample format. Default ::CAS_DEFAULT resolves to ::CAS_16. |
| eAM | Audio mode. Default CAM_DEFAULT (Stereo). |
| bool CRM64Pro::ConfigMgr::audioIsReady | ( | eConfigAudioFreq * | eAF = nullptr, |
| eConfigAudioSample * | eAS = nullptr, | ||
| eConfigAudioMode * | eAM = nullptr ) |
Check whether the audio system is ready.
| eAF | ::eConfigAudioFreq enum pointer filled in with audio frequency. If nullptr (default), this value is not retrieved. |
| eAS | ::eConfigAudioSample enum pointer filled in with audio sampling. If nullptr (default), this value is not retrieved. |
| eAM | ::eConfigAudioMode enum pointer filled in with audio mode. If nullptr (default), this value is not retrieved. |
| bool CRM64Pro::ConfigMgr::audioClose | ( | ) |
Close the audio system.
Recommended to call at the very end of your application, after closing all resources and before Main::terminate(). If not called, it will be automatically called on Main::terminate().
| bool CRM64Pro::ConfigMgr::audioSetDriver | ( | eConfigAudioDriver | eCAD | ) |
Set the audio driver.
| eCAD | audio driver. Check ::eConfigAudioDriver enum for further information. |
| eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriver | ( | ) | const |
Get the audio driver.
Returns the audio driver set by default or by audioSetDriver() method. Note that it could differ from the driver in use. Use audioGetDriverInUse() to get the actual driver.
| const char * CRM64Pro::ConfigMgr::audioGetDriverInUse | ( | ) | const |
Get the audio driver name in use.
Returns the audio driver name in use (e.g., "wasapi", "directsound", "pulseaudio"). The audio must be initialized.
| bool CRM64Pro::ConfigMgr::audioSetMasterGain | ( | float | fGain | ) |
Set Master gain (Volume).
Sets the global volume for the mixer device.
| fGain | Volume float (0.0f to 2.0f). 1.0f is nominal. |
| float CRM64Pro::ConfigMgr::audioGetMasterGain | ( | ) | const |
Get Master gain (Volume).
| bool CRM64Pro::ConfigMgr::audioSetTagGain | ( | eAudioTrackTag | eTag, |
| float | fGain ) |
Set Gain (Volume) for a specific audio track tag category.
Updates the stored volume for the tag category and immediately updates all active tracks of that type.
| eTag | The tag category to update (Music, SFX, etc). |
| fGain | Volume (0.0f - 2.0f). 1.0f is nominal. |
| float CRM64Pro::ConfigMgr::audioGetTagGain | ( | eAudioTrackTag | eTag | ) | const |
Get the current gain for a specific audio track tag category.
Retrieves the stored volume multiplier for the given tag.
| eTag | The tag category to query (Music, SFX, etc). |
| MIX_Mixer * CRM64Pro::ConfigMgr::audioGetMixer | ( | ) |
Get the internal SDL3 Mixer Device handle.
Returns the raw pointer to the initialized MIX_Mixer device.
|
override |
Create a new screen.
| sName | the name to give to the screen object (e.g. 'pScreen'). Must be unique and shorter than 64 characters. |
| iReserved | Reserved for future use. Pass 0. |
|
override |
Close and destroy a screen.
| idScreen | 0 for closing all screens or the Screen id. This removes the screen and all associated resources (SDL window, SDL renderer, etc.). Additionally, it informs ImageMgr to remove all textures created for the screen. |
|
override |
Get number of loaded objects.
|
override |
Change the object name.
| idScreen | Screen id. |
| sName | the name to give to the screen object (e.g. 'pScreen'). Must be unique and shorter than 64 characters. |
| void CRM64Pro::ConfigMgr::reset | ( | Sint32 | iMode = 0 | ) |
Set all default values, close audio system, remove all existing screens and create the "default" screen.
| iMode | 0 for resetting general, audio and screen values or 1 for resetting only the screen values. |
| Screen * CRM64Pro::ConfigMgr::get | ( | Sint32 | idScreen = 0 | ) |
| Screen * CRM64Pro::ConfigMgr::get | ( | SDL_Window * | wScreen | ) |