Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
ProjectSettings Namespace Reference

Runtime project settings loaded from dproject.bin. More...

Classes

struct  FileHeader
 Binary file header for project settings. More...
struct  DisplaySettings
 Display/rendering settings. More...
struct  RuntimeSettings
 Runtime settings (version 3+). More...
struct  PipelineConfig

Functions

bool Load (const uint8_t *data, size_t size)
 Load project settings from binary file.
int32_t GetTargetFPS ()
 Get the target FPS from loaded project settings.
const char * GetStartupScene ()
 Get the startup scene path from loaded project settings.
const char * GetRenderPipeline ()
 Get the render pipeline renderer name (version 4+).
int GetPassCount ()
 Get the number of render passes in the pipeline (version 4+).
const char * GetPassName (int index)
 Get the name of a render pass by index (version 4+).
bool LoadFromFile (const char *path=nullptr)
 Load project settings from filesystem.
bool ReadPackageSettingBool (const char *section, const char *key, bool &out)
 Runtime lookup of one package setting from the last Load().
bool ReadPackageSettingInt32 (const char *section, const char *key, int32_t &out)
bool ReadPackageSettingFloat (const char *section, const char *key, float &out)
std::vector< uint8_t > Write (int32_t displayWidth, int32_t displayHeight, uint8_t colorFormat, int32_t targetFPS=0, const char *startupScene=nullptr, const char *rendererName=nullptr, const char *const *passNames=nullptr, int passCount=0)
 Serialize project settings to a dproject.bin image (editor only).

Variables

constexpr const char * FILENAME = "F:/dproject.bin"
constexpr const char * EXPORT_FILENAME = "dproject.bin"
constexpr uint32_t MAGIC = 0x444B5052
constexpr uint16_t VERSION = 5
constexpr size_t MAX_FILE_SIZE = 16384
static constexpr int MAX_PIPELINE_NAME = 32
 Render pipeline configuration (version 4+).
static constexpr int MAX_PASSES = 8

Detailed Description

Runtime project settings loaded from dproject.bin.

This file is exported by the editor alongside scenes and contains project-wide settings that affect engine behavior at runtime.

Function Documentation

◆ Load()

bool ProjectSettings::Load ( const uint8_t * data,
size_t size )

Load project settings from binary file.

Parameters
dataPointer to file data
sizeSize of file data
Returns
true if loaded successfully

◆ GetTargetFPS()

int32_t ProjectSettings::GetTargetFPS ( )

Get the target FPS from loaded project settings.

Returns
Target FPS (0 = no limit)

◆ GetStartupScene()

const char * ProjectSettings::GetStartupScene ( )

Get the startup scene path from loaded project settings.

Returns
Startup scene path (empty if not set)

◆ GetRenderPipeline()

const char * ProjectSettings::GetRenderPipeline ( )

Get the render pipeline renderer name (version 4+).

Returns
Renderer name (e.g., "standard2d"), or "standard2d" if not set

◆ GetPassCount()

int ProjectSettings::GetPassCount ( )

Get the number of render passes in the pipeline (version 4+).

Returns
Pass count (0 if not set)

◆ GetPassName()

const char * ProjectSettings::GetPassName ( int index)

Get the name of a render pass by index (version 4+).

Parameters
indexPass index (0-based)
Returns
Pass name (e.g., "clip2d"), or empty string if out of range

◆ LoadFromFile()

bool ProjectSettings::LoadFromFile ( const char * path = nullptr)

Load project settings from filesystem.

Parameters
pathPath to dproject.bin file (optional, uses FILENAME if nullptr)
Returns
true if loaded successfully

◆ ReadPackageSettingBool()

bool ProjectSettings::ReadPackageSettingBool ( const char * section,
const char * key,
bool & out )

Runtime lookup of one package setting from the last Load().

section is the DEKI_PROJECT_SETTINGS_SECTION name (e.g. "Rendering"), key the reflected field name. Works without the settings registry, which device builds do not have (the generic hydration in Load() needs the registry's metadata); editor builds should read the registry instance. Returns false when no file is loaded, the section or key is absent, or the stored type is not the one asked for.

◆ ReadPackageSettingInt32()

bool ProjectSettings::ReadPackageSettingInt32 ( const char * section,
const char * key,
int32_t & out )

◆ ReadPackageSettingFloat()

bool ProjectSettings::ReadPackageSettingFloat ( const char * section,
const char * key,
float & out )

◆ Write()

std::vector< uint8_t > ProjectSettings::Write ( int32_t displayWidth,
int32_t displayHeight,
uint8_t colorFormat,
int32_t targetFPS = 0,
const char * startupScene = nullptr,
const char * rendererName = nullptr,
const char *const * passNames = nullptr,
int passCount = 0 )

Serialize project settings to a dproject.bin image (editor only).

Returns the bytes rather than filling a caller-supplied pointer. The v5 packageSettings chunk grows with the settings registry, so no call site can know the size up front — the previous signature took a bare uint8_t* with no capacity argument and a doc comment claiming 256 bytes would do, while the three call sites each guessed a 4096-byte stack array and LoadFromFile accepted files up to MAX_FILE_SIZE (16384) back.

Parameters
displayWidthTarget display width
displayHeightTarget display height
colorFormatColor format (0=RGB565, 1=RGB888, 2=ARGB8888)
targetFPSTarget FPS (0 = no limit)
startupSceneStartup scene path (can be nullptr)
Returns
The serialized image; empty only if nothing could be written

Variable Documentation

◆ FILENAME

const char* ProjectSettings::FILENAME = "F:/dproject.bin"
constexpr

◆ EXPORT_FILENAME

const char* ProjectSettings::EXPORT_FILENAME = "dproject.bin"
constexpr

◆ MAGIC

uint32_t ProjectSettings::MAGIC = 0x444B5052
constexpr

◆ VERSION

uint16_t ProjectSettings::VERSION = 5
constexpr

◆ MAX_FILE_SIZE

size_t ProjectSettings::MAX_FILE_SIZE = 16384
constexpr

◆ MAX_PIPELINE_NAME

int ProjectSettings::MAX_PIPELINE_NAME = 32
staticconstexpr

Render pipeline configuration (version 4+).

Baked from .rpipeline asset at export time. Specifies which renderer and render passes to activate.

◆ MAX_PASSES

int ProjectSettings::MAX_PASSES = 8
staticconstexpr