DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
Deki::ProjectSettings Namespace Reference

Project-wide runtime settings, read from the project_data.bin the editor exports. More...

Classes

struct  DisplaySettings
 Display section of project_data.bin, after the FileHeader. More...
struct  FileHeader
 Header at the start of project_data.bin. More...
struct  RuntimeSettings
 Runtime section of project_data.bin: target frame rate and startup scene. More...

Functions

Storage::Location GetAssetStorage ()
 Whether this build's assets are on internal or external storage.
int GetPassCount ()
 Number of render passes, 0 when not set.
const char * GetPassName (int index)
 Name of render pass index (such as "clip2d"), or "" when out of range.
const char * GetRenderPipeline ()
 Renderer name, such as "standard2d"; "standard2d" when not set.
float GetScreenDiagonalInches ()
 The screen's diagonal in inches, from the board's platform file; 0 when unknown.
const char * GetStartupScene ()
 Startup scene path, empty when not set.
int32_t GetTargetFPS ()
 Target frame rate, 0 for no limit.
bool Load (const uint8_t *data, size_t size)
 Reads project settings from the bytes of a project_data.bin.
bool LoadFromFile (const char *path=nullptr)
 Loads project settings from path, or from kFilename when it is nullptr.
bool ReadPackageSettingBool (const char *section, const char *key, bool &out)
 Reads one package setting from the last Load().
bool ReadPackageSettingEnum (const char *section, const char *key, size_t enumSize, int32_t &out)
 An enum setting, stored at the enum's own width: pass sizeof the enum (1, 2 or 4).
bool ReadPackageSettingFloat (const char *section, const char *key, float &out)
bool ReadPackageSettingInt32 (const char *section, const char *key, int32_t &out)
void Unload ()
 Frees what the last Load() kept (the packages' settings), so the engine's shutdown does not count it as a leak.
std::vector< uint8_t > Write (Storage::Location assetStorage, int32_t targetFPS=0, const char *startupScene=nullptr, const char *rendererName=nullptr, const char *const *passNames=nullptr, int passCount=0, float screenDiagonalInches=0.0f)
 Builds a project_data.bin image (editor only).

Variables

constexpr const char * kExportFilename = "project_data.bin"
constexpr const char * kFilename = "F:/project_data.bin"
constexpr uint16_t kFlagAssetsExternal = 1u << 0
constexpr uint32_t kMagic = 0x444B5052
constexpr size_t kMaxFileSize = 16384
constexpr uint16_t kVersion = 7

Detailed Description

Project-wide runtime settings, read from the project_data.bin the editor exports.

Function Documentation

◆ GetAssetStorage()

Storage::Location Deki::ProjectSettings::GetAssetStorage ( )

Whether this build's assets are on internal or external storage.

◆ GetPassCount()

int Deki::ProjectSettings::GetPassCount ( )

Number of render passes, 0 when not set.

◆ GetPassName()

const char * Deki::ProjectSettings::GetPassName ( int index)

Name of render pass index (such as "clip2d"), or "" when out of range.

◆ GetRenderPipeline()

const char * Deki::ProjectSettings::GetRenderPipeline ( )

Renderer name, such as "standard2d"; "standard2d" when not set.

◆ GetScreenDiagonalInches()

float Deki::ProjectSettings::GetScreenDiagonalInches ( )

The screen's diagonal in inches, from the board's platform file; 0 when unknown.

◆ GetStartupScene()

const char * Deki::ProjectSettings::GetStartupScene ( )

Startup scene path, empty when not set.

◆ GetTargetFPS()

int32_t Deki::ProjectSettings::GetTargetFPS ( )

Target frame rate, 0 for no limit.

◆ Load()

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

Reads project settings from the bytes of a project_data.bin.

Returns false on failure.

◆ LoadFromFile()

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

Loads project settings from path, or from kFilename when it is nullptr.

Returns false on failure.

◆ ReadPackageSettingBool()

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

Reads one package setting from the last Load().

section is the DEKI_PROJECT_SETTINGS_SECTION name (such as "Rendering"), key the reflected field name. Works without the settings registry, which device builds lack; editor builds should read the registry instance instead. Returns false when no file is loaded, the section or key is missing, or the stored type is a different one.

◆ ReadPackageSettingEnum()

bool Deki::ProjectSettings::ReadPackageSettingEnum ( const char * section,
const char * key,
size_t enumSize,
int32_t & out )

An enum setting, stored at the enum's own width: pass sizeof the enum (1, 2 or 4).

out is the enumerator's value.

◆ ReadPackageSettingFloat()

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

◆ ReadPackageSettingInt32()

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

◆ Unload()

void Deki::ProjectSettings::Unload ( )

Frees what the last Load() kept (the packages' settings), so the engine's shutdown does not count it as a leak.

Package settings read after it are absent, and packages take their defaults.

◆ Write()

std::vector< uint8_t > Deki::ProjectSettings::Write ( Storage::Location assetStorage,
int32_t targetFPS = 0,
const char * startupScene = nullptr,
const char * rendererName = nullptr,
const char *const * passNames = nullptr,
int passCount = 0,
float screenDiagonalInches = 0.0f )

Builds a project_data.bin image (editor only).

targetFPS 0 means no limit; startupScene may be nullptr; screenDiagonalInches 0 means unknown. Returns the bytes, rather than filling a caller's buffer, because the packageSettings chunk grows with the settings registry and no caller can know the size. Empty only when nothing could be written.

Variable Documentation

◆ kExportFilename

const char* Deki::ProjectSettings::kExportFilename = "project_data.bin"
constexpr

◆ kFilename

const char* Deki::ProjectSettings::kFilename = "F:/project_data.bin"
constexpr

◆ kFlagAssetsExternal

uint16_t Deki::ProjectSettings::kFlagAssetsExternal = 1u << 0
constexpr

◆ kMagic

uint32_t Deki::ProjectSettings::kMagic = 0x444B5052
constexpr

◆ kMaxFileSize

size_t Deki::ProjectSettings::kMaxFileSize = 16384
constexpr

◆ kVersion

uint16_t Deki::ProjectSettings::kVersion = 7
constexpr