![]() |
CRM64Pro GDK v0.13.0
A free cross-platform game development kit built on top of SDL 3.0
|
Central hub for CRM64Pro GDK initialization and module access [v25.12.0].
The Main module serves as the central entry point and orchestrator for the CRM64Pro Game Development Kit. It manages the complete lifecycle of the application, from system initialization through shutdown, while providing unified access to all other GDK modules.
| Core | Log • Config • Timer • Tool |
|---|---|
| Data | Archive • XML |
| Audio | Audio Track |
| Graphics | Image • Cursor • Tile • Sprite • Font • GFX |
| Interface | GUI • Widgets |
| Tile engine | TE Core • TE MapData |
| Network | TCP/IP |
The GDK provides two interface complexity levels, allowing simple utilities to coexist with feature-rich systems:
| Standard | Simple interface with a few methods that may or may not be related |
|---|---|
| Advanced | Complex interface with several interconnected methods |
Managers handle object lifecycle and resource sharing. Each manager follows one of these patterns based on its resource requirements:
| Standard | Objects must be unique by name; creation fails if name exists |
|---|---|
| Sharing | Returns shared ID for existing objects; control methods affect all shared instances |
| Cloning | Creates independent copies sharing base data; loaded duplicates auto-clone |
Namespaces | |
| namespace | CRM64Pro::CMem |
| CMem: CRM64Pro Memory Manager. | |
Classes | |
| struct | CRM64Pro::Position |
| Position struct used by Font and GUI Widgets. More... | |
| class | CRM64Pro::Main |
| CRM64Pro GDK Main class. More... | |
Macros | |
| #define | C64_EVENT 0xEC64 |
| #define | C64_EVENT_LOGIC 1 |
| #define | C64_EVENT_RENDER 2 |
| #define | C64_EVENT_WIDGET 4 |
| #define | C64_EVENT_WIDGET_MOUSEOVER 8 |
| #define | C64_EVENT_WIDGET_LOSTFOCUS 16 |
| #define | C64_STATUS_DISABLED 0 |
| #define | C64_STATUS_ENABLED 1 |
| #define | C64_STATUS_PAUSED 2 |
| #define | C64_STATUS_HIDDEN 5 |
| #define | C64_STATUS_SHOWN 9 |
| #define | C64_STATUS_END 16 |
| #define | C64_ERR_INTER 0xFFFFFF00 |
| #define | C64_ERR_PARAM 0xFFFFFE00 |
| #define | C64_ERR_FILOP 0xFFFFFD00 |
| #define | C64_ERR_FILWR 0xFFFFFC00 |
| #define | C64_ERR_FILRE 0xFFFFFB00 |
| #define | C64_ERR_ALLOC 0xFFFFFA00 |
| #define | C64_ERR_OBJNF 0xFFFFF900 |
Enumerations | |
| enum | CRM64Pro::ePositionHelpers { CRM64Pro::PH_NONE = 0 , CRM64Pro::PH_SIZE = 0x60000000 , CRM64Pro::PH_CENTER = 0x61000000 , CRM64Pro::PH_TOP = 0x62000000 , CRM64Pro::PH_BOTTOM = 0x63000000 , CRM64Pro::PH_LEFT = 0x65000000 , CRM64Pro::PH_RIGHT = 0x66000000 } |
| Position helpers used by Cursors, Sprites, Fonts and GUI Widgets. More... | |
Functions | |
| static Main & | CRM64Pro::Main::Instance () |
| Access the Main singleton. | |
| static void | CRM64Pro::Main::Terminate () |
| Main explicit destructor. | |
| Sint32 | CRM64Pro::Main::info (Sint32 iMode=0) |
| Request Main Interface information. | |
| static Sint32 | CRM64Pro::Main::isInit () |
| Check if the GDK is initialized. | |
| const string & | CRM64Pro::Main::getCopyright () |
| Get copyright string. | |
| void | CRM64Pro::Main::printVersion () |
| Print version and build date to the default log. | |
| const string & | CRM64Pro::Main::getVersion () |
| Get version string. | |
| Sint32 | CRM64Pro::Main::requireVersion (Uint8 iMajor, Uint8 iMinor) |
| Check given version against GDK version. | |
| Sint32 | CRM64Pro::Main::intro (Sint32 idScreen=0) |
| Show the MegaStorm and CRM64Pro introduction. | |
| Sint32 | CRM64Pro::Main::update (SDL_Event *evUser=nullptr) |
| Manage the GDK update cycle with a fixed virtual logic frame rate. | |
| float | CRM64Pro::Main::getLogicTime () |
| Get total logic time. | |
| Sint32 | CRM64Pro::Main::getKeyState (SDL_Keycode keycode) |
| Get the current state of a key. | |
| const char * | CRM64Pro::Main::getKeyName (SDL_Keycode keycode) |
| Get a human-readable name for a key. | |
| Sint32 | CRM64Pro::Main::getKeyboardFocus () |
| Get the screen that has keyboard focus. | |
| ConfigMgr & | CRM64Pro::Main::IConfigMgr () |
| Get reference to Config Manager. | |
| Tool & | CRM64Pro::Main::ITool () |
| Get reference to Tool Interface. | |
| LogMgr & | CRM64Pro::Main::ILogMgr () |
| Get reference to Log Manager. | |
| Timer & | CRM64Pro::Main::ITimer () |
| Get reference to Timer Interface. | |
| ArchiveMgr & | CRM64Pro::Main::IArchiveMgr () |
| Get reference to Archive Manager. | |
| XMLMgr & | CRM64Pro::Main::IXMLMgr () |
| Get reference to XML Manager. | |
| AudioTrackMgr & | CRM64Pro::Main::IAudioTrackMgr () |
| Get reference to Audio Track Manager. | |
| ImageMgr & | CRM64Pro::Main::IImageMgr () |
| Get reference to Image Manager. | |
| CursorMgr & | CRM64Pro::Main::ICursorMgr () |
| Get reference to Cursor Manager. | |
| TileMgr & | CRM64Pro::Main::ITileMgr () |
| Get reference to Tile Manager. | |
| SpriteMgr & | CRM64Pro::Main::ISpriteMgr () |
| Get reference to Sprite Manager. | |
| FontMgr & | CRM64Pro::Main::IFontMgr () |
| Get reference to Font Manager. | |
| GFX & | CRM64Pro::Main::IGFX () |
| Get reference to GFX Interface. | |
| GUIMgr & | CRM64Pro::Main::IGUIMgr () |
| Get reference to GUI Manager. | |
| TileEngineMgr & | CRM64Pro::Main::ITileEngineMgr () |
| Get reference to TileEngine Manager. | |
| NetTCP & | CRM64Pro::Main::INetTCP () |
| Get reference to NetTCP Interface. | |
| #define C64_EVENT 0xEC64 |
Event type raised by Main::update() to deliver a CRM64Pro user event code.
| #define C64_EVENT_LOGIC 1 |
event.user.code set by Main::update() when event.type is C64_EVENT. A logic frame occurred.
| #define C64_EVENT_RENDER 2 |
event.user.code set by Main::update() when event.type is C64_EVENT. A render frame occurred.
| #define C64_EVENT_WIDGET 4 |
event.user.code set by Main::update() when event.type is C64_EVENT. A GUI widget triggered a WS_ACTION event.
| #define C64_EVENT_WIDGET_MOUSEOVER 8 |
event.user.code set by Main::update() when event.type is C64_EVENT. The mouse pointer is over a GUI widget.
| #define C64_EVENT_WIDGET_LOSTFOCUS 16 |
event.user.code set by Main::update() when event.type is C64_EVENT. The GUI widget lost focus.
| #define C64_STATUS_DISABLED 0 |
General status: disabled.
| #define C64_STATUS_ENABLED 1 |
General status: enabled.
| #define C64_STATUS_PAUSED 2 |
General status: paused.
| #define C64_STATUS_HIDDEN 5 |
General status: enabled but hidden.
| #define C64_STATUS_SHOWN 9 |
General status: enabled and shown.
| #define C64_STATUS_END 16 |
General status: end.
| #define C64_ERR_INTER 0xFFFFFF00 |
Error code: internal error.
| #define C64_ERR_PARAM 0xFFFFFE00 |
Error code: invalid parameter.
| #define C64_ERR_FILOP 0xFFFFFD00 |
Error code: could not open or create a file.
| #define C64_ERR_FILWR 0xFFFFFC00 |
Error code: could not write to a file.
| #define C64_ERR_FILRE 0xFFFFFB00 |
Error code: could not read from a file.
| #define C64_ERR_ALLOC 0xFFFFFA00 |
Error code: could not allocate memory.
| #define C64_ERR_OBJNF 0xFFFFF900 |
Error code: object not found.
Position helpers used by Cursors, Sprites, Fonts and GUI Widgets.
| Enumerator | |
|---|---|
| PH_NONE | No position helper, absolute positioning. |
| PH_SIZE | Cursor::setHotSpot(): set hotspot to cursor_size. Sprite::setAnimHotSpot(): set hotspot to frame_size. |
| PH_CENTER | Cursor::setHotSpot(): set hotspot to cursor_size/2. Sprite::setAnimHotSpot(): set hotspot to frame_size/2. Widget/Font: center with optional offset (use negative for decrement). |
| PH_TOP | Widget/Font: top with optional offset (use negative for decrement). Valid for Y axis. |
| PH_BOTTOM | Widget/Font: bottom with optional offset (use negative for decrement). Valid for Y axis. |
| PH_LEFT | Widget/Font: left with optional offset (use negative for decrement). Valid for X axis. |
| PH_RIGHT | Widget/Font: right with optional offset (use negative for decrement). Valid for X axis. |
|
static |
Access the Main singleton.
On first call this performs:
|
static |
| Sint32 CRM64Pro::Main::info | ( | Sint32 | iMode = 0 | ) |
|
static |
Check if the GDK is initialized.
| const string & CRM64Pro::Main::getCopyright | ( | ) |
Get copyright string.
| void CRM64Pro::Main::printVersion | ( | ) |
Print version and build date to the default log.
Writes the version information; no return value.
| const string & CRM64Pro::Main::getVersion | ( | ) |
Get version string.
| Sint32 CRM64Pro::Main::requireVersion | ( | Uint8 | iMajor, |
| Uint8 | iMinor ) |
Check given version against GDK version.
| iMajor | required major version. |
| iMinor | required minor version. |
| Sint32 CRM64Pro::Main::intro | ( | Sint32 | idScreen = 0 | ) |
Show the MegaStorm and CRM64Pro introduction.
| idScreen | valid screen handle; defaults to the primary screen. |
| Sint32 CRM64Pro::Main::update | ( | SDL_Event * | evUser = nullptr | ) |
Manage the GDK update cycle with a fixed virtual logic frame rate.
Replaces SDL_PollEvent() and SDL_RenderPresent(), while updating internal systems such as GUI and Timer. Provides the fixed virtual logic frame rate with interpolation.
| evUser | event data pointer. If event.type is C64_EVENT, evUser.user.code contains the event code. If event.type is SDL_EVENT_GUI_WINDOW_CLOSE_REQUESTED, the user clicked to close the window. |
| float CRM64Pro::Main::getLogicTime | ( | ) |
Get total logic time.
| Sint32 CRM64Pro::Main::getKeyState | ( | SDL_Keycode | keycode | ) |
Get the current state of a key.
Uses the SDL keycode representation (layout-independent, character-dependent).
| keycode | SDL_Keycode key to check. |
| const char * CRM64Pro::Main::getKeyName | ( | SDL_Keycode | keycode | ) |
Get a human-readable name for a key.
| keycode | SDL_Keycode key to get its human-readable name. |
| Sint32 CRM64Pro::Main::getKeyboardFocus | ( | ) |
Get the screen that has keyboard focus.
| ConfigMgr & CRM64Pro::Main::IConfigMgr | ( | ) |
Get reference to Config Manager.
| Tool & CRM64Pro::Main::ITool | ( | ) |
Get reference to Tool Interface.
| LogMgr & CRM64Pro::Main::ILogMgr | ( | ) |
Get reference to Log Manager.
| Timer & CRM64Pro::Main::ITimer | ( | ) |
Get reference to Timer Interface.
| ArchiveMgr & CRM64Pro::Main::IArchiveMgr | ( | ) |
Get reference to Archive Manager.
| XMLMgr & CRM64Pro::Main::IXMLMgr | ( | ) |
Get reference to XML Manager.
| AudioTrackMgr & CRM64Pro::Main::IAudioTrackMgr | ( | ) |
Get reference to Audio Track Manager.
| ImageMgr & CRM64Pro::Main::IImageMgr | ( | ) |
Get reference to Image Manager.
| CursorMgr & CRM64Pro::Main::ICursorMgr | ( | ) |
Get reference to Cursor Manager.
| TileMgr & CRM64Pro::Main::ITileMgr | ( | ) |
Get reference to Tile Manager.
| SpriteMgr & CRM64Pro::Main::ISpriteMgr | ( | ) |
Get reference to Sprite Manager.
| FontMgr & CRM64Pro::Main::IFontMgr | ( | ) |
Get reference to Font Manager.
| GFX & CRM64Pro::Main::IGFX | ( | ) |
Get reference to GFX Interface.
| GUIMgr & CRM64Pro::Main::IGUIMgr | ( | ) |
Get reference to GUI Manager.
| TileEngineMgr & CRM64Pro::Main::ITileEngineMgr | ( | ) |
Get reference to TileEngine Manager.
| NetTCP & CRM64Pro::Main::INetTCP | ( | ) |
Get reference to NetTCP Interface.