CRM64Pro GDK v0.11.0
A free cross-platform game development kit built on top of SDL 3.0
|
v4.10 (18 February 2024)
The Config module includes the Config Manager and Screen for handling general, audio and video configuration settings of the GDK.
Control settings:
ConfigMgr automatically uses below default configuration:
iMTFriendly: | 0 (disabled) |
---|---|
Audio.bInit: | false (disabled) |
Audio.iDriver: | 0 (use default audio driver) |
Audio.eAS: | AS_16 (16 bit sampling) |
Audio.eAF: | AF_NORMAL (22050Hz) |
Audio.eAM: | AM_STEREO |
Audio.iMusicVol: | 128 (from 0 to 255) |
Audio.iSoundVol: | 128 (from 0 to 255) |
Audio.iMixingChannels: | 8 (up to 8 audio mixing channels) |
Default screen with: | |
Driver: | CRD_DEFAULT (use default renderer driver) |
Batching: | 1 (enabled) |
Width x Height: | 800 x 600 |
Logical presentation size | 800 x 600 |
Position: | SDL_WINDOWPOS_UNDEFINED |
Name: | CRM64Pro GDK Application |
Window flags: | SDL_WINDOW_SHOWN |
Window border: | 1 (show window border) |
Vertical sync: | 0 (disabled) |
Icon: | default GDK icon |
Clip region: | no clip region set |
Logical presentation mode: | disabled |
Logical presentation quality: | nearest pixel sampling |
The configuration can be modified using provided methods.
In addition, methods for saving and loading the current configuration (general, audio and video) are provided.
This is a standard manager: objects are not shared and must be unique using its name as the key, in other words, you can not create an object with the same name of another one already created.
Only a single instance of the Configuration Manager exists which is created once Main is instantiated.
You can get a reference to this manager using Main::IConfigMgr() method.
Classes | |
class | CRM64Pro::Screen |
Screen Object class. More... | |
class | CRM64Pro::ConfigMgr |
Config Manager class. More... | |
Functions | |
Sint32 | CRM64Pro::Screen::info (Sint32 iMode=0) |
Request screen object information. | |
Sint32 | CRM64Pro::Screen::getName (string &sName) |
Get the name. | |
Uint32 | CRM64Pro::Screen::getID () |
Get the ID. | |
Sint32 | CRM64Pro::Screen::show () |
Show the screen. | |
Sint32 | CRM64Pro::Screen::hide () |
Hide the screen. | |
Sint32 | CRM64Pro::Screen::status () |
Get the screen status. | |
Sint32 | CRM64Pro::Screen::setIcon (SDL_Surface *suIcon) |
Set an icon. | |
Sint32 | CRM64Pro::Screen::setDriver (eConfigRendererDriver eCRD) |
Set the renderer driver. | |
eConfigRendererDriver | CRM64Pro::Screen::getDriver () |
Get the renderer driver. | |
eConfigRendererDriver | CRM64Pro::Screen::getDriverInUse () |
Get the renderer driver in use. | |
Sint32 | CRM64Pro::Screen::setVSync (Uint32 bFlag) |
Set the VSync mode. | |
Uint32 | CRM64Pro::Screen::getVSync () |
Get current VSync mode. | |
Sint32 | CRM64Pro::Screen::setMode (eConfigScreenMode eCSM) |
Set the screen mode. | |
eConfigScreenMode | CRM64Pro::Screen::getMode () |
Get the screen mode. | |
Sint32 | CRM64Pro::Screen::setSize (Sint32 iWidth, Sint32 iHeight) |
Set the size of the screen. | |
Sint32 | CRM64Pro::Screen::getSize (Sint32 *iWidth, Sint32 *iHeight) |
Get the size of the screen. | |
Sint32 | CRM64Pro::Screen::setLogicalPresentation (Sint32 iWidth, Sint32 iHeight, SDL_RendererLogicalPresentation eSDL_RLP=SDL_LOGICAL_PRESENTATION_DISABLED, SDL_ScaleMode eSDL_SM=SDL_SCALEMODE_NEAREST) |
Set the logical presentation size of the screen. | |
Sint32 | CRM64Pro::Screen::getLogicalPresentation (Sint32 *iWidth=nullptr, Sint32 *iHeight=nullptr, SDL_RendererLogicalPresentation *eSDL_RLP=nullptr, SDL_ScaleMode *eSDL_SM=nullptr) |
Get the logical presentation size of the screen. | |
Sint32 | CRM64Pro::Screen::setPosition (Sint32 iX, Sint32 iY) |
Set the position. | |
Sint32 | CRM64Pro::Screen::getPosition (Sint32 *iX, Sint32 *iY) |
Get the position. | |
Sint32 | CRM64Pro::Screen::setClipRect (SDL_Rect *rClip) |
Set clipping rect. | |
Sint32 | CRM64Pro::Screen::getClipRect (SDL_Rect *rClip) |
Get clipping rect. | |
Sint32 | CRM64Pro::Screen::setTitle (const string &sName) |
Set the title. | |
Sint32 | CRM64Pro::Screen::getTitle (string &sName) |
Get the title. | |
Sint32 | CRM64Pro::Screen::setBorder (Uint32 bFlag) |
Set the border for the screen. | |
Uint32 | CRM64Pro::Screen::getBorder () |
Get the border for the screen. | |
SDL_Window * | CRM64Pro::Screen::getWindow () |
Get the SDL_Window associated to this screen. | |
SDL_Renderer * | CRM64Pro::Screen::getRenderer () |
Get the SDL_Renderer associated to this screen. | |
SDL_Surface * | CRM64Pro::Screen::getSnapshot () |
Get a SDL_Surface with a screen snapshot. | |
Sint32 | CRM64Pro::Screen::getSnapshot (const string &sFile) |
Save the screen snapshot to an external PNG file. | |
Sint32 | CRM64Pro::Screen::clear (Uint8 iR=0, Uint8 iG=0, Uint8 iB=0, Uint8 iA=255) |
Clear the screen. | |
Sint32 | CRM64Pro::Screen::setRenderCallback (Sint32(*myRenderFunc)(Sint32 iMode, void *pObj), void *pObj=nullptr) |
Set a callback function for rendering your graphics at Render Frame Rate. | |
Sint32 | CRM64Pro::Screen::fadeToColor (Uint8 iR, Uint8 iG, Uint8 iB, Sint32 iTime, SDL_Rect *rDst=nullptr) |
Perform a fade effect of this screen to the given color. | |
Sint32 | CRM64Pro::Screen::fadeToImage (Sint32 idImage, Sint32 iTime, SDL_Rect *rDst=nullptr, SDL_Rect *rSrc=nullptr) |
Perform a fade effect of this screen to the given Image handler. | |
Sint32 | CRM64Pro::ConfigMgr::info (Sint32 iMode=0) |
Request Configuration Manager information. | |
Sint32 | CRM64Pro::ConfigMgr::audioInit (eAudioFreq eAF=AF_DEFAULT, eAudioSample eAS=AS_DEFAULT, eAudioMode eAM=AM_DEFAULT) |
Initialize the audio system. | |
Sint32 | CRM64Pro::ConfigMgr::audioStatus (eAudioFreq *eAF=nullptr, eAudioSample *eAS=nullptr, eAudioMode *eAM=nullptr) |
Check audio system status. | |
Sint32 | CRM64Pro::ConfigMgr::audioClose () |
Close the audio system. | |
Sint32 | CRM64Pro::ConfigMgr::audioSetDriver (eConfigAudioDriver eCAD) |
Set the audio driver. | |
eConfigAudioDriver | CRM64Pro::ConfigMgr::audioGetDriver () |
Get the audio driver. | |
eConfigAudioDriver | CRM64Pro::ConfigMgr::audioGetDriverInUse () |
Get the audio driver in use. | |
Sint32 | CRM64Pro::ConfigMgr::audioMusicVolume (Sint32 iVolume) |
Music volume control. | |
Sint32 | CRM64Pro::ConfigMgr::audioSoundVolume (Sint32 iVolume) |
Sound volume control. | |
Sint32 | CRM64Pro::ConfigMgr::audioMixingChannels (Sint32 iNum) |
Manage sound mixing channels. | |
Sint32 | CRM64Pro::ConfigMgr::audioHook (void(*mix_func)(void *udata, Uint8 *stream, Sint32 len), void *arg) |
Set a function that is called after all mixing is performed. | |
Sint32 | CRM64Pro::ConfigMgr::create (const string &sName, Uint32 iUnused=0) |
Create a new screen. | |
Sint32 | CRM64Pro::ConfigMgr::close (Sint32 idScreen) |
Close and destroy a screen. | |
Sint32 | CRM64Pro::ConfigMgr::getNum () |
Get number of loaded objects. | |
Sint32 | CRM64Pro::ConfigMgr::setName (Sint32 idScreen, const string &sName) |
Change the object name. | |
void | CRM64Pro::ConfigMgr::reset (Sint32 iMode=0) |
Set all default values, close audio system, remove all existing screens and create the "default" screen. | |
Screen * | CRM64Pro::ConfigMgr::get (Sint32 idScreen=0) |
Get a pointer to the screen using its handler. | |
Screen * | CRM64Pro::ConfigMgr::get (SDL_Window *wScreen) |
Get a pointer to the screen using a SDL_Window pointer. | |
Sint32 | CRM64Pro::ConfigMgr::save (const string &sConfigXML, const string &sCDC="") |
Save current audio/screens configuration. | |
Sint32 | CRM64Pro::ConfigMgr::load (const string &sConfigXML, const string &sCDC="") |
Load audio/screen configuration. | |
Sint32 | CRM64Pro::ConfigMgr::setup (const string &sConfigXML, Sint32 idConfigCDC, const string &sCustomSetupXML="") |
Open the setup window for configurating audio/screen settings. | |
Sint32 | CRM64Pro::ConfigMgr::setup (const string &sConfigXML, const string &sConfigCDC="", const string &sCustomSetupXML="") |
Open the setup window for configurating audio/screen settings. | |
Audio drivers.
enum CRM64Pro::eAudioFreq |
enum CRM64Pro::eAudioMode |
Screen renderer drivers.
Enumerator | |
---|---|
CRD_DEFAULT | Used in Screen::setDriver(), uses the default renderer driver (default value). |
CRD_SOFTWARE | Used in Screen::setDriver(), uses a software renderer driver, it is slow but works on all platforms. |
CRD_OPENGL | Used in Screen::setDriver(), uses OpenGL renderer driver. Supported on Win32/Win64/Linux/MacOS X. |
CRD_OPENGLES2 | Used in Screen::setDriver(), uses OpenGL ES v2.0 renderer driver. Supported on Android/iOS. |
CRD_DIRECT3D | Used in Screen::setDriver(), uses Direct3D v9 renderer driver. Only for Win32/Win64. |
CRD_DIRECT3D11 | Used in Screen::setDriver(), uses Direct3D v11 renderer driver. Only for Win32/Win64 (needs Windows 8+). |
CRD_DIRECT3D12 | Used in Screen::setDriver(), uses Direct3D v12 renderer driver. Only for Win64 (needs Windows 10+). |
CRD_X11 | Used in Screen::setDriver(), uses X11 renderer driver. Only for Linux. |
CRD_ERROR | Returned by Screen::getDriver() in case of error. |
Screen modes.
Enumerator | |
---|---|
CSM_WINDOW | Used in Screen::setMode(), uses a windowed mode (default value). |
CSM_FULLSCREEN | Used in Screen::setMode(), uses a fullscreen window mode which takes the size of the desktop. Recommended fullscreen mode. |
CSM_FULLSCREENEXCLUSIVE | Used in Screen::setMode(), uses an exclusive fullscreen mode which changes the monitor video mode to the closest mode for matching given resolution. |
Sint32 CRM64Pro::Screen::info | ( | Sint32 | iMode = 0 | ) |
Request screen object information.
For displaying the information, it uses the default log.
iMode | unused for the time being. |
Sint32 CRM64Pro::Screen::getName | ( | string & | sName | ) |
Get the name.
sName | a string containing the screen name. |
Uint32 CRM64Pro::Screen::getID | ( | ) |
Get the ID.
Sint32 CRM64Pro::Screen::show | ( | ) |
Show the screen.
This method make the associated window to become visible.
If the screen was not shown before, it creates all needed internal attributes and initialize the screen.
If the screen was hidden, it is shown again without affecting any other attributes.
Sint32 CRM64Pro::Screen::hide | ( | ) |
Hide the screen.
When a screen is hidden, its associated window is hidden but all attributes are kept.
This screen can be shown again using show() or closed using ConfigMgr::close().
Sint32 CRM64Pro::Screen::status | ( | ) |
Get the screen status.
C64_STATUS_DISABLED | screen is uninitialized. |
C64_STATUS_HIDDEN | screen is initialized but hidden. |
C64_STATUS_SHOWN | screen is initialized and visible. |
Sint32 CRM64Pro::Screen::setIcon | ( | SDL_Surface * | suIcon | ) |
Set an icon.
It is used as the window icon.
Once you call this method, you can free the used surface as it is not longer needed.
The screen can be already initialized or not, when calling this method.
suIcon | SDL_Surface pointer with the icon. |
Sint32 CRM64Pro::Screen::setDriver | ( | eConfigRendererDriver | eCRD | ) |
Set the renderer driver.
eCRD | screen renderer driver. Check eConfigRendererDriver enum for further information. |
eConfigRendererDriver CRM64Pro::Screen::getDriver | ( | ) |
Get the renderer driver.
This method return the renderer driver set by default or by setDriver() method.
Note that it could be different to the driver in use, for example, you could set CRD_DEFAULT and the driver in use will be CRD_SOFTWARE, CRD_OPENGL, etc.
For getting the driver in use, you can call to getDriverInUse() method.
eConfigRendererDriver CRM64Pro::Screen::getDriverInUse | ( | ) |
Get the renderer driver in use.
This method return the renderer driver in use, therefore the screen must be initialized.
For getting the driver set by default or by setDriver(), you can use getDriver() method.
Sint32 CRM64Pro::Screen::setVSync | ( | Uint32 | bFlag | ) |
Set the VSync mode.
Enabling the vertical sync. will synchronize the screen rendering with the monitor refresh rate.
In addition, enabling it will limit the maximum Render Frame Rate, check Timer::setRate() for further information.
bFlag | 0 for disabling and 1 for enabling it. Common monitor refresh rates are 60, 70, 75, 120 or 155. |
Uint32 CRM64Pro::Screen::getVSync | ( | ) |
Get current VSync mode.
Sint32 CRM64Pro::Screen::setMode | ( | eConfigScreenMode | eCSM | ) |
Set the screen mode.
eCSM | screen mode. Check eConfigScreenMode enum for further information. |
eConfigScreenMode CRM64Pro::Screen::getMode | ( | ) |
Get the screen mode.
Sint32 CRM64Pro::Screen::setSize | ( | Sint32 | iWidth, |
Sint32 | iHeight | ||
) |
Set the size of the screen.
iWidth | screen width. |
iHeight | screen height. |
Sint32 CRM64Pro::Screen::getSize | ( | Sint32 * | iWidth, |
Sint32 * | iHeight | ||
) |
Get the size of the screen.
This method return the size of the screen's client area.
iWidth | an integer pointer filled in with screen width. If nullptr is passed, the method ignores the retrieving of this value. |
iHeight | an integer pointer filled in with screen height. If nullptr is passed, the method ignores the retrieving of this value. |
Sint32 CRM64Pro::Screen::setLogicalPresentation | ( | Sint32 | iWidth, |
Sint32 | iHeight, | ||
SDL_RendererLogicalPresentation | eSDL_RLP = SDL_LOGICAL_PRESENTATION_DISABLED , |
||
SDL_ScaleMode | eSDL_SM = SDL_SCALEMODE_NEAREST |
||
) |
Set the logical presentation size of the screen.
Allows a device independent resolution rendering.
iWidth | logical presentation width. A negative value for not modifying this value. |
iHeight | logical presentation height. A negative value for not modifying this value. |
eSDL_RLP | set the logical presentation mode. Check SDL_RendererLogicalPresentation for further information. By default, it is set to SDL_LOGICAL_PRESENTATION_DISABLED. |
eSDL_SM | set the logical presentation quality: SDL_SCALEMODE_NEAREST for nearest pixel sampling or SDL_SCALEMODE_LINEAR for linear filtering. By default, it is set to SDL_SCALEMODE_NEAREST. |
Sint32 CRM64Pro::Screen::getLogicalPresentation | ( | Sint32 * | iWidth = nullptr , |
Sint32 * | iHeight = nullptr , |
||
SDL_RendererLogicalPresentation * | eSDL_RLP = nullptr , |
||
SDL_ScaleMode * | eSDL_SM = nullptr |
||
) |
Get the logical presentation size of the screen.
This method return the size of the logical presentation size, mode and quality for this screen.
iWidth | an integer pointer filled in with logical presentation width. If nullptr is passed, the method ignores the retrieving of this value. |
iHeight | an integer pointer filled in with logical presentation height. If nullptr is passed, the method ignores the retrieving of this value. |
eSDL_RLP | a SDL_RendererLogicalPresentation enum pointer that will be filled in with the logical presentation mode. If nullptr is passed, the method ignores the retrieving of this value. |
eSDL_SM | a enum pointer to the logical presentation quality: SDL_SCALEMODE_NEAREST for nearest pixel sampling or SDL_SCALEMODE_LINEAR for linear filtering. If nullptr is passed, the method ignores the retrieving of this value. |
Sint32 CRM64Pro::Screen::setPosition | ( | Sint32 | iX, |
Sint32 | iY | ||
) |
Set the position.
iX | screen X position. |
iY | screen Y position. |
Sint32 CRM64Pro::Screen::getPosition | ( | Sint32 * | iX, |
Sint32 * | iY | ||
) |
Get the position.
This method return the position of a screen.
iX | a pointer filled in with screen X position. If nullptr is passed, the method ignores the retrieving of this value. |
iY | a pointer filled in with screen Y position. If nullptr is passed, the method ignores the retrieving of this value. |
Sint32 CRM64Pro::Screen::setClipRect | ( | SDL_Rect * | rClip | ) |
Set clipping rect.
rClip | pointer to SDL_Rect structure with the clipping area. nullptr for disabling it. |
Sint32 CRM64Pro::Screen::getClipRect | ( | SDL_Rect * | rClip | ) |
Get clipping rect.
rClip | pointer to SDL_Rect structure filled in with current clipping area when clipping is enabled. |
Sint32 CRM64Pro::Screen::setTitle | ( | const string & | sName | ) |
Set the title.
It is used as window title.
The screen can be already initialized or not when calling this method.
sName | title for the screen. |
Sint32 CRM64Pro::Screen::getTitle | ( | string & | sName | ) |
Get the title.
sName | a string variable. Will not be modified when the screen does not exist. |
Sint32 CRM64Pro::Screen::setBorder | ( | Uint32 | bFlag | ) |
Set the border for the screen.
The screen border is only visible on CSM_WINDOW mode so it only has effect on this mode.
bFlag | 0 for disabling and 1 for enabling it. |
Uint32 CRM64Pro::Screen::getBorder | ( | ) |
Get the border for the screen.
SDL_Window * CRM64Pro::Screen::getWindow | ( | ) |
Get the SDL_Window associated to this screen.
SDL_Renderer * CRM64Pro::Screen::getRenderer | ( | ) |
Get the SDL_Renderer associated to this screen.
SDL_Surface * CRM64Pro::Screen::getSnapshot | ( | ) |
Get a SDL_Surface with a screen snapshot.
Sint32 CRM64Pro::Screen::getSnapshot | ( | const string & | sFile | ) |
Save the screen snapshot to an external PNG file.
sFile | string containing the [directory]+filename+[extension]. |
Sint32 CRM64Pro::Screen::clear | ( | Uint8 | iR = 0 , |
Uint8 | iG = 0 , |
||
Uint8 | iB = 0 , |
||
Uint8 | iA = 255 |
||
) |
Clear the screen.
iR | The red color value. Default is 0. |
iG | The green color value. Default is 0. |
iB | The blue color value. Default is 0. |
iA | The alpha value. Default is 255. |
Sint32 CRM64Pro::Screen::setRenderCallback | ( | Sint32(*)(Sint32 iMode, void *pObj) | myRenderFunc, |
void * | pObj = nullptr |
||
) |
Set a callback function for rendering your graphics at Render Frame Rate.
myRenderFunc | pointer to your graphics rendering function or nullptr for removing current assigned function. iMode will be set to 1 right after a Logic Frame update. pObj a pointer to the data/function/static method fixed when calling this method. |
pObj | pointer to data/function/static method. By default, it is not used and set to nullptr. |
Sint32 CRM64Pro::Screen::fadeToColor | ( | Uint8 | iR, |
Uint8 | iG, | ||
Uint8 | iB, | ||
Sint32 | iTime, | ||
SDL_Rect * | rDst = nullptr |
||
) |
Perform a fade effect of this screen to the given color.
iR | The red color value. |
iG | The green color value. |
iB | The blue color value. |
iTime | duration in milliseconds for performing the effect. Minimum of 50ms and maximum of 10000ms. |
rDst | the destination SDL_Rect structure or nullptr for using the whole screen size. By default, it is set to nullptr. |
Sint32 CRM64Pro::Screen::fadeToImage | ( | Sint32 | idImage, |
Sint32 | iTime, | ||
SDL_Rect * | rDst = nullptr , |
||
SDL_Rect * | rSrc = nullptr |
||
) |
Perform a fade effect of this screen to the given Image handler.
idImage | Image handler |
iTime | duration in milliseconds for performing the effect. Minimum of 50ms and maximum of 10000ms. |
rDst | the destination SDL_Rect structure or nullptr for using the whole screen size. By default, it is set to nullptr. |
rSrc | the image source SDL_Rect structure or nullptr for using the whole image. By default, it is set to nullptr. |
Sint32 CRM64Pro::ConfigMgr::info | ( | Sint32 | iMode = 0 | ) |
Request Configuration Manager information.
For displaying the information, it uses the default log.
iMode | -1 for displaying only Manager information. 0 for displaying Manager and all Objects information. This is the default value. idScreen for displaying Manager and given Screen id information. |
Sint32 CRM64Pro::ConfigMgr::audioInit | ( | eAudioFreq | eAF = AF_DEFAULT , |
eAudioSample | eAS = AS_DEFAULT , |
||
eAudioMode | eAM = AM_DEFAULT |
||
) |
Initialize the audio system.
If the audio system is initialized, this method closes it and try to open with new parameters.
eAF | Audio frequency. Check eAudioFreq enum for further information. |
eAS | Audio sampling. Check eAudioSample enum for further information. |
eAM | Audio mode. Check eAudioMode enum for further information. |
Sint32 CRM64Pro::ConfigMgr::audioStatus | ( | eAudioFreq * | eAF = nullptr , |
eAudioSample * | eAS = nullptr , |
||
eAudioMode * | eAM = nullptr |
||
) |
Check audio system status.
eAF | eAudioFreq enum pointer filled in with audio frequency. If nullptr is passed (value by default), the method ignores the retrieving of this value. |
eAS | eAudioSample enum pointer filled in with audio sampling. If nullptr is passed (value by default), the method ignores the retrieving of this value. |
eAM | eAudioMode enum pointer filled in with audio mode. If nullptr is passed (value by default), the method ignores the retrieving of this value. |
Sint32 CRM64Pro::ConfigMgr::audioClose | ( | ) |
Close the audio system.
It is recommended to call this method at the very end of your application, once you have closed/removed all your resources and right before the call to Main::Terminate().
In any case, if not called by your application, it will be automatically called on Main::Terminate()
Sint32 CRM64Pro::ConfigMgr::audioSetDriver | ( | eConfigAudioDriver | eCAD | ) |
Set the audio driver.
eCAD | audio driver. Check eConfigAudioDriver enum for further information. |
eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriver | ( | ) |
Get the audio driver.
This method return the audio driver set by default or by audioSetDriver() method.
Note that it could be different to the driver in use, for example, you could set CAD_DEFAULT and the driver in use will be CAD_WASAPI, CAD_WINMM, etc.
For getting the driver in use, you can call to audioGetDriverInUse() method.
eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriverInUse | ( | ) |
Get the audio driver in use.
This method return the audio driver in use, therefore the audio must be initialized.
For getting the driver set by default or by audioSetDriver(), you can use audioGetDriver() method.
Sint32 CRM64Pro::ConfigMgr::audioMusicVolume | ( | Sint32 | iVolume | ) |
Music volume control.
iVolume | volume ranging from 0 to 128. A negative value has not any effect. |
Sint32 CRM64Pro::ConfigMgr::audioSoundVolume | ( | Sint32 | iVolume | ) |
Sound volume control.
The sound volume affects to all channels.
iVolume | volume ranging from 0 to 128. A negative value has not any effect. |
Sint32 CRM64Pro::ConfigMgr::audioMixingChannels | ( | Sint32 | iNum | ) |
Manage sound mixing channels.
The mixing channels number can be modified at any time.
iNum | number of mixing channels or maximum number of sounds played at the same time. Minimum of 8 (set it by default) and up to 128. A negative value will do nothing just return current number of mixing channels. |
Sint32 CRM64Pro::ConfigMgr::audioHook | ( | void(*)(void *udata, Uint8 *stream, Sint32 len) | mix_func, |
void * | arg | ||
) |
Set a function that is called after all mixing is performed.
This can be used to provide real-time visual display of the audio stream or add a custom mixer filter for the stream data.
mix_func | function pointer. |
arg | pointer to extra arguments passed to the mixing function. |
Sint32 CRM64Pro::ConfigMgr::create | ( | const string & | sName, |
Uint32 | iUnused = 0 |
||
) |
Create a new screen.
sName | The name to give to the screen object (e.g. 'myScreen'). The object name must be unique and with a maximum size of 64 characters or will be truncated. |
iUnused | unused for the time being. |
Sint32 CRM64Pro::ConfigMgr::close | ( | Sint32 | idScreen | ) |
Close and destroy a screen.
idScreen | 0 for closing all screens or the Screen id. This will totally remove the screen and all the specific resources associated to it (SDL window, SDL renderer, etc.). In addition, it will inform the ImageMgr in order to remove all textures created for the screen. |
Sint32 CRM64Pro::ConfigMgr::getNum | ( | ) |
Get number of loaded objects.
Sint32 CRM64Pro::ConfigMgr::setName | ( | Sint32 | idScreen, |
const string & | sName | ||
) |
Change the object name.
idScreen | Screen id. |
sName | The name to give to the screen object (e.g. 'myScreen'). The object name must be unique and with a maximum size of 64 characters or will be truncated. |
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 | ) |
Get a pointer to the screen using its handler.
idScreen | Screen id. By default, it closes the default screen. |
Screen * CRM64Pro::ConfigMgr::get | ( | SDL_Window * | wScreen | ) |
Get a pointer to the screen using a SDL_Window pointer.
wScreen | SDL_Window pointer. |
Sint32 CRM64Pro::ConfigMgr::save | ( | const string & | sConfigXML, |
const string & | sConfigCDC = "" |
||
) |
Save current audio/screens configuration.
sConfigXML | string containing the [directory]+filename+[extension] of the config XML file. Directory separators '\' and '/' are supported. |
sConfigCDC | string containing the [directory]+filename+[extension] of a CDC file where the config XML will be saved to. Directory separators '\' and '/' are supported. This parameter is optional. |
Sint32 CRM64Pro::ConfigMgr::load | ( | const string & | sConfigXML, |
const string & | sConfigCDC = "" |
||
) |
Load audio/screen configuration.
sConfigXML | string containing the [directory]+filename+[extension] of the config XML file. Directory separators '\' and '/' are supported. |
sConfigCDC | string containing the [directory]+filename+[extension] of a CDC file that contains the config XML file. Directory separators '\' and '/' are supported. This parameter is optional. |
Sint32 CRM64Pro::ConfigMgr::setup | ( | const string & | sConfigXML, |
Sint32 | idConfigCDC, | ||
const string & | sCustomSetupXML = "" |
||
) |
Open the setup window for configurating audio/screen settings.
sConfigXML | string containing the name of the config XML file. |
idConfigCDC | id of an open CDC file that contains the config XML and the custom setup XML files. Directory separators '\' and '/' are supported. Using the id instead of the CDC name allows to open secured CDC files. |
sCustomSetupXML | string containing the name of the custom setup XML file. This parameter is optional. |
Sint32 CRM64Pro::ConfigMgr::setup | ( | const string & | sConfigXML, |
const string & | sConfigCDC = "" , |
||
const string & | sCustomSetupXML = "" |
||
) |
Open the setup window for configurating audio/screen settings.
sConfigXML | string containing the name of the config XML file. |
sConfigCDC | string containing the [directory]+filename+[extension] of a CDC file that contains the config and the custom setup XML files. Directory separators '\' and '/' are supported. |
sCustomSetupXML | string containing the name of the custom setup XML file. This parameter is optional. |