CRM64Pro GDK  v0.94
A free cross-platform game development kit built on top of SDL 2.0
Classes | Functions
Config

Classes

class  CRM64Pro::ScreenObj
 
class  CRM64Pro::ConfigMgr
 

Functions

Sint32 CRM64Pro::ScreenObj::info (Sint32 iMode=0)
 
Sint32 CRM64Pro::ScreenObj::getName (string &sName)
 
Uint32 CRM64Pro::ScreenObj::getID ()
 
Sint32 CRM64Pro::ScreenObj::show ()
 
Sint32 CRM64Pro::ScreenObj::hide ()
 
Sint32 CRM64Pro::ScreenObj::status ()
 
Sint32 CRM64Pro::ScreenObj::setIcon (SDL_Surface *suIcon)
 
Sint32 CRM64Pro::ScreenObj::setDriver (eConfigRendererDriver eCRD)
 
eConfigRendererDriver CRM64Pro::ScreenObj::getDriver ()
 
eConfigRendererDriver CRM64Pro::ScreenObj::getDriverInUse ()
 
Sint32 CRM64Pro::ScreenObj::setVSync (Uint32 bFlag)
 
Uint32 CRM64Pro::ScreenObj::getVSync ()
 
Sint32 CRM64Pro::ScreenObj::setMode (eConfigScreenMode eCSM)
 
eConfigScreenMode CRM64Pro::ScreenObj::getMode ()
 
Sint32 CRM64Pro::ScreenObj::setSize (Sint32 iWidth, Sint32 iHeight)
 
Sint32 CRM64Pro::ScreenObj::getSize (Sint32 *iWidth, Sint32 *iHeight)
 
Sint32 CRM64Pro::ScreenObj::setLogicalSize (Sint32 iWidth, Sint32 iHeight, eConfigScreenAspectRatio eCSA=CSA_LETTERBOX)
 
Sint32 CRM64Pro::ScreenObj::getLogicalSize (Sint32 *iWidth, Sint32 *iHeight, eConfigScreenAspectRatio *eCSA)
 
Sint32 CRM64Pro::ScreenObj::setPosition (Sint32 iX, Sint32 iY)
 
Sint32 CRM64Pro::ScreenObj::getPosition (Sint32 *iX, Sint32 *iY)
 
Sint32 CRM64Pro::ScreenObj::setClipRect (SDL_Rect *rClip)
 
Sint32 CRM64Pro::ScreenObj::getClipRect (SDL_Rect *rClip)
 
Sint32 CRM64Pro::ScreenObj::setTitle (const string &sName)
 
Sint32 CRM64Pro::ScreenObj::getTitle (string &sName)
 
Sint32 CRM64Pro::ScreenObj::setBorder (Uint32 bFlag)
 
Uint32 CRM64Pro::ScreenObj::getBorder ()
 
SDL_Window * CRM64Pro::ScreenObj::getWindow ()
 
SDL_Renderer * CRM64Pro::ScreenObj::getRenderer ()
 
SDL_Surface * CRM64Pro::ScreenObj::getSnapshot ()
 
Sint32 CRM64Pro::ScreenObj::clear (Uint8 iR=0, Uint8 iG=0, Uint8 iB=0, Uint8 iA=255)
 
Sint32 CRM64Pro::ScreenObj::setRenderCallback (Sint32(*myRenderFunc)(Sint32 iMode))
 
Sint32 CRM64Pro::ScreenObj::fadeToColor (Uint8 iR, Uint8 iG, Uint8 iB, Sint32 iTime, SDL_Rect *rDst=nullptr)
 
Sint32 CRM64Pro::ScreenObj::fadeToImage (Sint32 idImage, Sint32 iTime, SDL_Rect *rDst=nullptr, SDL_Rect *rSrc=nullptr)
 
Sint32 CRM64Pro::ConfigMgr::info (Sint32 iMode=0)
 
Sint32 CRM64Pro::ConfigMgr::audioInit (eAudioFreq eAF=AF_DEFAULT, eAudioSample eAS=AS_DEFAULT, eAudioMode eAM=AM_DEFAULT)
 
Sint32 CRM64Pro::ConfigMgr::audioStatus (eAudioFreq *eAF=nullptr, eAudioSample *eAS=nullptr, eAudioMode *eAM=nullptr)
 
Sint32 CRM64Pro::ConfigMgr::audioClose ()
 
Sint32 CRM64Pro::ConfigMgr::audioSetDriver (eConfigAudioDriver eCAD)
 
eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriver ()
 
eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriverInUse ()
 
Sint32 CRM64Pro::ConfigMgr::audioMusicVolume (Sint32 iVolume)
 
Sint32 CRM64Pro::ConfigMgr::audioSoundVolume (Sint32 iVolume)
 
Sint32 CRM64Pro::ConfigMgr::audioMixingChannels (Sint32 iNum)
 
Sint32 CRM64Pro::ConfigMgr::audioHook (void(*mix_func)(void *udata, Uint8 *stream, Sint32 len), void *arg)
 
Sint32 CRM64Pro::ConfigMgr::create (const string &sName, Uint32 iUnused=0)
 
Sint32 CRM64Pro::ConfigMgr::close (Sint32 idScreen)
 
Sint32 CRM64Pro::ConfigMgr::getNum ()
 
Sint32 CRM64Pro::ConfigMgr::setName (Sint32 idScreen, const string &sName)
 
void CRM64Pro::ConfigMgr::reset (Sint32 iMode=0)
 
ScreenObj * CRM64Pro::ConfigMgr::get (Sint32 idScreen=0)
 
ScreenObj * CRM64Pro::ConfigMgr::get (SDL_Window *wScreen)
 

Detailed Description

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
Audio.iSoundVol:128
Default screen with:
Driver:CRD_DEFAULT (use default renderer driver)
Width x Height:640 x 480
Position:SDL_WINDOWPOS_UNDEFINED
Name:CRM64Pro GDK Application
Window flags:SDL_WINDOW_SHOWN
Renderer flags:0
Icon:default GDK icon

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.

Note
The Configuration Manager is automatically released when Main::Terminate() is called.
At this time, if any resource is still loaded, it will be released avoding a resource leak.

Enumeration Type Documentation

Audio drivers.

Enumerator
CAD_DEFAULT 

Used in Config::audioSetDriver(), uses the default audio driver (default value).

CAD_XAUDIO2 

Used in Config::audioSetDriver(), uses XAudio2 driver. Only for Win32/Win64.

CAD_DIRECTSOUND 

Used in Config::audioSetDriver(), uses DirectSound driver. Only for Win32/Win64.

CAD_WINMM 

Used in Config::audioSetDriver(), uses Windows Multimedia API. Only for Win32/Win64.

CAD_ERROR 

Returned by Config::audioGetDriver() if the method call failed.

Audio frequency.

Enumerator
AF_DEFAULT 

Default value.

AF_NORMAL 

22050 Hz output.

AF_HIGH 

44100 Hz output.

AF_ULTRA 

48000 Hz output.

Audio sample.

Enumerator
AS_DEFAULT 

Default value.

AS_8 

8bits samples output.

AS_16 

16bits samples output.

AS_32 

32bits floating point samples output.

Audio mode.

Enumerator
AM_DEFAULT 

Default value.

AM_MONO 

Mono output.

AM_STEREO 

Stereo output.

AM_SURROUND 

Surround output.

AM_SURROUNDPLUS 

Surround with center and lfe.

Screen renderer drivers.

Enumerator
CRD_DEFAULT 

Used in ScreenObj::setDriver(), uses the default renderer driver (default value).

CRD_SOFTWARE 

Used in ScreenObj::setDriver(), uses a software renderer driver, it is slow but works on all platforms.

CRD_OPENGL 

Used in ScreenObj::setDriver(), uses OpenGL renderer driver. Supported on Win32/Win64/Linux/MacOS X.

CRD_OPENGLES2 

Used in ScreenObj::setDriver(), uses OpenGL ES v2.0 renderer driver. Supported on Android/iOS.

CRD_DIRECT3D 

Used in ScreenObj::setDriver(), uses Direct3D v9 renderer driver. Only for Win32/Win64.

CRD_DIRECT3D11 

Used in ScreenObj::setDriver(), uses Direct3D v11 renderer driver. Only for Win32/Win64 (needs Windows 8+).

CRD_X11 

Used in ScreenObj::setDriver(), uses X11 renderer driver. Only for Linux.

CRD_ERROR 

Returned by ScreenObj::getDriver() in case of error.

Screen modes.

Enumerator
CSM_WINDOW 

Used in ScreenObj::setMode(), uses a windowed mode (default value).

CSM_FULLSCREEN 

Used in ScreenObj::setMode(), uses a real fullscreen mode which changes the monitor video mode.

CSM_FULLSCREENWINDOW 

Used in ScreenObj::setMode(), uses an fullscreen window mode which takes the size of the desktop.

Screen aspect ratio.

Enumerator
CSA_LETTERBOX 

Used in ScreenObj::setLogicalSize(), keep the original aspect ratio using(if needed) as filler the required side-bars (default value).

CSA_OVERSCAN 

Used in ScreenObj::setLogicalSize(), expand to fill the entire screen, even if some parts draw off the screen. CRD_DIRECT3D does not support this value.

Function Documentation

Sint32 CRM64Pro::ScreenObj::info ( Sint32  iMode = 0)

Request screen object information.

For displaying the information, it uses the default log.

Parameters
iModeunused for the time being.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::getName ( string &  sName)

Get the name.

Parameters
sNamea string containing the screen name.
Returns
0 on success or a negative error code on failure.
Uint32 CRM64Pro::ScreenObj::getID ( )

Get the ID.

Returns
the object ID.
Sint32 CRM64Pro::ScreenObj::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.

Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::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().

Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::status ( )

Get the screen status.

Returns
C64_STATUS_DISABLEDscreen is uninitialized.
C64_STATUS_HIDDENscreen is initialized but hidden.
C64_STATUS_SHOWNscreen is initialized and visible.
Sint32 CRM64Pro::ScreenObj::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.

Parameters
suIconSDL_Surface pointer with the icon.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::setDriver ( eConfigRendererDriver  eCRD)

Set the renderer driver.

Parameters
eCRDscreen renderer driver. Check eConfigRendererDriver enum for further information.
Returns
0 on success or a negative error code on failure.
Note
A change of the renderer driver will destroy all created textures for this screen.
They will be automatically re-built when needed but also can be built in advance using ImageMgr::optimize() or ScreenObj::optimize().
eConfigRendererDriver CRM64Pro::ScreenObj::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.

Returns
eConfigRendererDriver enum value on success or CRD_ERROR code on failure.
eConfigRendererDriver CRM64Pro::ScreenObj::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.

Returns
eConfigRendererDriver enum value on success or CRD_ERROR code on failure.
Sint32 CRM64Pro::ScreenObj::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.

Parameters
bFlag0 for disabling and 1 for enabling it.
Common monitor refresh rates are 60, 70, 75, 80 or 120.
Returns
0 on success or a negative error code on failure.
Note
A change of the vsync will recreate the renderer, hence, destroying all created textures for this screen.
They will be automatically re-built when needed but also can be built in advance using ImageMgr::optimize() or ScreenObj::optimize().
Uint32 CRM64Pro::ScreenObj::getVSync ( )

Get the VSync modes.

Returns
0 if VSync is disabled, 1 if it is enabled.
Sint32 CRM64Pro::ScreenObj::setMode ( eConfigScreenMode  eCSM)

Set the screen mode.

Parameters
eCSMscreen mode. Check eConfigScreenMode enum for further information.
Returns
0 on success or a negative error code on failure.
Note
A change of the mode will destroy all created textures for this screen.
They will be automatically re-built when needed but also can be built in advance using ImageMgr::optimize() or ScreenObj::optimize().
eConfigScreenMode CRM64Pro::ScreenObj::getMode ( )

Get the screen mode.

Returns
eConfigScreenMode enum value on success.
Sint32 CRM64Pro::ScreenObj::setSize ( Sint32  iWidth,
Sint32  iHeight 
)

Set the size of the screen.

We also change the logical size of the screen.

Parameters
iWidthscreen width.
iHeightscreen height.
Returns
0 on success or a negative error code on failure.
Note
If the screen is using CSM_FULLSCREEN or CSM_FULLSCREENWINDOW, the size can not be changed.
A change of the size will destroy all created textures for this screen.
They will be automatically re-built when needed but also can be built in advance using ImageMgr::optimize() or ScreenObj::optimize().
Sint32 CRM64Pro::ScreenObj::getSize ( Sint32 *  iWidth,
Sint32 *  iHeight 
)

Get the size of the screen.

This method return the size of the screen's client area.

Parameters
iWidthan integer pointer filled in with screen width.
If nullptr is passed, the method ignores the retrieving of this value.
iHeightan integer pointer filled in with screen height.
If nullptr is passed, the method ignores the retrieving of this value.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::setLogicalSize ( Sint32  iWidth,
Sint32  iHeight,
eConfigScreenAspectRatio  eCSA = CSA_LETTERBOX 
)

Set the logic size of the screen.

Allows a device independent resolution rendering.

Parameters
iWidthlogical screen width.
iHeightlogical screen height.
eCSAset the aspect ratio adjustment. Check eConfigScreenAspectRatio enum for further information. By default, it is set to CSA_LETTERBOX.
Returns
0 on success or a negative error code on failure.
Note
CRD_DIRECT3D driver does not support CSA_OVERSCAN mode.
Sint32 CRM64Pro::ScreenObj::getLogicalSize ( Sint32 *  iWidth,
Sint32 *  iHeight,
eConfigScreenAspectRatio eCSA 
)

Get the logical size of the screen.

This method return the size of the logical screen and the current aspect ratio mode.

Parameters
iWidthan integer pointer filled in with screen width.
If nullptr is passed, the method ignores the retrieving of this value.
iHeightan integer pointer filled in with screen height.
If nullptr is passed, the method ignores the retrieving of this value.
eCSAa eConfigScreenAspectRatio enum pointer filled in with the aspect ratio adjustment.
If nullptr is passed, the method ignores the retrieving of this value.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::setPosition ( Sint32  iX,
Sint32  iY 
)

Set the position.

Parameters
iXscreen X position.
iYscreen Y position.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::getPosition ( Sint32 *  iX,
Sint32 *  iY 
)

Get the position.

This method return the position of a screen.

Parameters
iXa pointer filled in with screen X position.
If nullptr is passed, the method ignores the retrieving of this value.
iYa pointer filled in with screen Y position.
If nullptr is passed, the method ignores the retrieving of this value.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::setClipRect ( SDL_Rect *  rClip)

Set clipping rect.

Parameters
rClippointer to SDL_Rect structure with the clipping area.
nullptr for disabling it.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::getClipRect ( SDL_Rect *  rClip)

Get clipping rect.

Parameters
rClippointer to SDL_Rect structure filled in with current clipping area.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::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.

Parameters
sNametitle for the screen.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::getTitle ( string &  sName)

Get the title.

Parameters
sNamea string variable.
Will not be modified when the screen does not exist.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::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.

Parameters
bFlag0 for disabling and 1 for enabling it.
Returns
0 on success or a negative error code on failure.
Uint32 CRM64Pro::ScreenObj::getBorder ( )

Get the border for the screen.

Returns
0 if the border is disabled, 1 if it is enabled.
SDL_Window * CRM64Pro::ScreenObj::getWindow ( )

Get the SDL_Window associated to this screen.

Returns
a pointer to the SDL_Window or nullptr on failure.
Warning
Use carefully this method and in general, only for read-only checks.
SDL_Renderer * CRM64Pro::ScreenObj::getRenderer ( )

Get the SDL_Renderer associated to this screen.

Returns
a pointer to the SDL_Renderer or nullptr on failure.
Warning
Use carefully this method and in general, only for read-only checks.
SDL_Surface * CRM64Pro::ScreenObj::getSnapshot ( )

Get a SDL_Surface with a screen snapshot.

Returns
a pointer to the SDL_Surface or nullptr on failure.
The created surface must be removed by the user to avoid a resource leak.
Note
Getting a screen snapshot is quite slow.
Sint32 CRM64Pro::ScreenObj::clear ( Uint8  iR = 0,
Uint8  iG = 0,
Uint8  iB = 0,
Uint8  iA = 255 
)

Clear the screen.

Parameters
iRThe red color value. Default is 0.
iGThe green color value. Default is 0.
iBThe blue color value. Default is 0.
iAThe alpha value. Default is 255.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ScreenObj::setRenderCallback ( Sint32(*)(Sint32 iMode)  myRenderFunc)

Set a callback function for rendering your graphics at Render Frame Rate.

Parameters
myRenderFuncpointer to your graphics rendering function or nullptr for removing current assigned function.
iMode will be set to 1 right after a Logic Frame update.
Returns
0 on success or a negative error code on failure.
Note
There are some alternative ways of rendering your graphics at Render Frame Rate, but the best of all will be to use callback.
For further information, please check Rendering your graphics: standard and advance methods.
Sint32 CRM64Pro::ScreenObj::fadeToColor ( Uint8  iR,
Uint8  iG,
Uint8  iB,
Sint32  iTime,
SDL_Rect *  rDst = nullptr 
)

Perform a fade effect of this screen to the given color.

Parameters
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iTimeduration in milliseconds for performing the effect.
Minimum of 50ms and maximum of 10000ms.
rDstthe destination SDL_Rect structure or nullptr for using the whole screen size.
By default, it is set to nullptr.
Returns
0 on success or a negative error code on failure.
Note
This method will "block" the execution until the duration is over and the effect done.
Sint32 CRM64Pro::ScreenObj::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.

Parameters
idImageImage handler
iTimeduration in milliseconds for performing the effect.
Minimum of 50ms and maximum of 10000ms.
rDstthe destination SDL_Rect structure or nullptr for using the whole screen size.
By default, it is set to nullptr.
rSrcthe image source SDL_Rect structure or nullptr for using the whole image.
By default, it is set to nullptr.
Returns
0 on success or a negative error code on failure.
Note
This method will "block" the execution until the duration is over and the effect done.
Sint32 CRM64Pro::ConfigMgr::info ( Sint32  iMode = 0)

Request Configuration Manager information.

For displaying the information, it uses the default log.

  • General information: multithread friendly flag
  • Graphics information: number of displays, renderer drivers availables and screens
  • Audio information: audio devices, audio drivers and current audio output
Parameters
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.
Returns
0 on success or a negative error code on failure.
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.

Parameters
eAFAudio frequency. Check eAudioFreq enum for further information.
eASAudio sampling. Check eAudioSample enum for further information.
eAMAudio mode. Check eAudioMode enum for further information.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConfigMgr::audioStatus ( eAudioFreq eAF = nullptr,
eAudioSample eAS = nullptr,
eAudioMode eAM = nullptr 
)

Check audio system status.

Parameters
eAFeAudioFreq enum pointer filled in with audio frequency.
If nullptr is passed (value by default), the method ignores the retrieving of this value.
eASeAudioSample enum pointer filled in with audio sampling.
If nullptr is passed (value by default), the method ignores the retrieving of this value.
eAMeAudioMode enum pointer filled in with audio mode.
If nullptr is passed (value by default), the method ignores the retrieving of this value.
Returns
0 on success (audio output is enabled) or -1 value when audio output is disabled.
Sint32 CRM64Pro::ConfigMgr::audioClose ( )

Close the audio system.

Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConfigMgr::audioSetDriver ( eConfigAudioDriver  eCAD)

Set the audio driver.

Parameters
eCADaudio driver. Check eConfigAudioDriver enum for further information.
Returns
0 on success or a negative error code on failure.
Note
Once the audio is initialized, this method has not any effect.
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_XAUDIO2, CAD_WINMM, etc.
For getting the driver in use, you can call to audioGetDriverInUse() method.

Returns
eConfigAudioDriver enum value on success or CAD_ERROR code on failure.
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.

Returns
eConfigAudioDriver enum value on success or CAD_ERROR code on failure.
Sint32 CRM64Pro::ConfigMgr::audioMusicVolume ( Sint32  iVolume)

Music volume control.

Parameters
iVolumevolume ranging from 0 to 128.
A negative value has not any effect.
Returns
current music volume.
Sint32 CRM64Pro::ConfigMgr::audioSoundVolume ( Sint32  iVolume)

Sound volume control.

The sound volume affects to all channels.

Parameters
iVolumevolume ranging from 0 to 128.
A negative value has not any effect.
Returns
current sound volume.
Sint32 CRM64Pro::ConfigMgr::audioMixingChannels ( Sint32  iNum)

Manage sound mixing channels.

The mixing channels number can be modified at any time.

Parameters
iNumnumber 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.
Returns
greater than 0 specifying the number of mixing channels or a negative error code on failure.
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.

Parameters
mix_funcfunction pointer.
argpointer to extra arguments passed to the mixing function.
Returns
0 on success or a negative error code on failure.
Sint32 CRM64Pro::ConfigMgr::create ( const string &  sName,
Uint32  iUnused = 0 
)

Create a new screen.

Parameters
sNameThe 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.
iUnusedunused for the time being.
Returns
greater than 0 on success(the Screen id) or a negative error code on failure.
Note
Once the screen is created, it is ready for being modified and eventually shown using ScreenObj::show().
Sint32 CRM64Pro::ConfigMgr::close ( Sint32  idScreen)

Close and destroy a screen.

Parameters
idScreen0 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.
Returns
0 on success or a negative error code on failure.
Note
If you forget to close a Screen, it will be automatically closed once the GDK is terminated.
Sint32 CRM64Pro::ConfigMgr::getNum ( )

Get number of loaded objects.

Returns
the number of screen objects.
Sint32 CRM64Pro::ConfigMgr::setName ( Sint32  idScreen,
const string &  sName 
)

Change the object name.

Parameters
idScreenScreen id.
sNameThe 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.
Returns
0 on success or a negative error code on failure.
void CRM64Pro::ConfigMgr::reset ( Sint32  iMode = 0)

Set all default values, close audio system, remove all existing screens and create the "default" screen.

Parameters
iMode0 for resetting general, audio and screen values or 1 for resetting only the screen values.
ScreenObj * CRM64Pro::ConfigMgr::get ( Sint32  idScreen = 0)

Get a pointer to the screen using its handler.

Parameters
idScreenScreen id.
By default, it closes the default screen.
Returns
nullptr the screen object was not found or a valid pointer to the screen object.
ScreenObj * CRM64Pro::ConfigMgr::get ( SDL_Window *  wScreen)

Get a pointer to the screen using a SDL_Window pointer.

Parameters
wScreenSDL_Window pointer.
Returns
nullptr no screen with that SDL_Window found or a valid pointer to the screen object.
Sint32 CRM64Pro::ConfigMgr::load ( const string &  sCDC,
const string &  sXML 
)
Todo:
Implement load to CDC/XML
Sint32 CRM64Pro::ConfigMgr::save ( const string &  sCDC,
const string &  sXML 
)
Todo:
Implement save to CDC/XML