
Describe the solution you'd like
- Add
LCUI_Settings settings to src/main.c:MainApp.
- Add files:
- src/setttings.c
- include/LCUI/settings.h
- Change related files to apply settings:
- src/main.c
- src/gui/widget_task.c
- src/display.c
- ...
Usage:
LCUI_SettingsRec settings;
// Get global settings of the LCUI
Settings_Init(&settings);
// default settings:
// settings.paint_flashing = FALSE
// settings.Frame_rate_cap = 120
// settings.fps_meter = FALSE
// settings.record_profile = FALSE
// settings.parallel_rendering_threads = 4
// Set frame rate cap to 30
settings.frame_rate_cap = 30;
// Set parallel rendering threads to 8
settings.parallel_rendering_threads = 8;
// enable paint flashing
settings.paint_flashing = TRUE;
// start record performance profile
settings.record_profile = TRUE;
// show fps meter
settings.fps_meter = TRUE;
// apply this new settings, and trigger LCUI_SETTINGS_CHANGE event
LCUI_ApplySettings(&settings);
// Reset settings to default
LCUI_ResetSettings();
Additional context
settings.frame_rate_cap:
Call StepTimer_SetFrameLimit(MainApp.settings.frame_rate_cap) when LCUI_SETTINGS_CHANGE event trigger
|
StepTimer_SetFrameLimit(MainApp.timer, LCUI_MAX_FRAMES_PER_SEC); |
settings.paint_flashing:
- Remove
display.show_rect_border, LCUIDisplay_ShowRectBorder(), LCUIDisplay_HideRectBorder().
- Add
LCUI_Settings settings to the display struct, and replace display.show_rect_border with display.settings->paint_flashing
|
if (display.show_rect_border) { |
settings.parallel_rendering_threads:
- Use
display.settings->parallel_rendering_threads instead of PARALLEL_RENDERING_THREADS
- The minimum value of
parallel_rendering_threads is 1
|
DirtyLayerRec layers[PARALLEL_RENDERING_THREADS]; |
settings.record_profile:
- Save profile data to
MainApp.profile
- Add
LCUI_GetProfile() to get performance profile
|
void LCUI_RunFrameWithProfile(LCUI_FrameProfile profile) |
settings.show_fps_meter:
No related code needs to be modified
IssueHunt Summary
jduo has been rewarded.
Backers (Total: $50.00)
Submitted pull Requests
Tips
Describe the solution you'd like
LCUI_Settings settingsto src/main.c:MainApp.Usage:
Additional context
settings.frame_rate_cap:
Call
StepTimer_SetFrameLimit(MainApp.settings.frame_rate_cap)when LCUI_SETTINGS_CHANGE event triggerLCUI/src/main.c
Line 474 in 949db38
settings.paint_flashing:
display.show_rect_border,LCUIDisplay_ShowRectBorder(),LCUIDisplay_HideRectBorder().LCUI_Settings settingsto the display struct, and replacedisplay.show_rect_borderwithdisplay.settings->paint_flashingLCUI/src/display.c
Line 233 in 949db38
settings.parallel_rendering_threads:
display.settings->parallel_rendering_threadsinstead ofPARALLEL_RENDERING_THREADSparallel_rendering_threadsis 1LCUI/src/display.c
Line 132 in 949db38
settings.record_profile:
MainApp.profileLCUI_GetProfile()to get performance profileLCUI/src/main.c
Line 183 in 949db38
settings.show_fps_meter:
No related code needs to be modified
IssueHunt Summary
Backers (Total: $50.00)
Submitted pull Requests
Tips