GSDP:GAM100/CProcessing/CP System GetSeconds()
From Inside
< GSDP:GAM100 | CProcessing
CP_System_GetSeconds()
Description
Returns the total number of seconds from the start of the program.
NOTE: This number is always increasing and cannot be changed or reset by the user.
Example
void init(void)
{
// initialize settings
CP_Settings_TextSize(150);
CP_Settings_TextAlignment(CP_TEXT_ALIGN_H_CENTER, CP_TEXT_ALIGN_V_MIDDLE);
CP_Settings_Fill(CP_Color_Create(100, 20, 100, 255));
}
void update(void)
{
// clear the background
CP_Settings_Background(CP_Color_Create(200, 200, 200, 255));
// print seconds since program start
float totalSeconds = CP_System_GetSeconds();
char buffer[16] = { 0 };
sprintf_s(buffer, _countof(buffer), "%.2f", totalSeconds);
CP_Font_DrawText(buffer, 200, 200);
}