shengine pre-release
shengine by mrsinho
Loading...
Searching...
No Matches
shTime.c File Reference
#include <GLFW/glfw3.h>
#include "shengine/shEngine.h"
#include "shengine/shTime.h"
#include <unistd.h>

Macros

#define GLFW_INCLUDE_NONE
 

Functions

uint8_t shGetTime (ShTime *p_time)
 Gets the current time in the shengine framework.
 
uint8_t shSetTime (double now, ShTime *p_time)
 Sets the time in the shengine framework.
 
uint8_t shCallOnTick (ShTime *p_time, double seconds, uint32_t tick_idx, ShTimeFunc *p_func, void *p_arg, uint64_t *p_return_value)
 Calls a function on a tick in the shengine framework.
 
void shSleep (uint32_t ms)
 Sleeps for a specified number of milliseconds.
 

Macro Definition Documentation

◆ GLFW_INCLUDE_NONE

#define GLFW_INCLUDE_NONE

Function Documentation

◆ shCallOnTick()

uint8_t shCallOnTick ( ShTime p_time,
double  seconds,
uint32_t  tick_idx,
ShTimeFunc p_func,
void *  p_arg,
uint64_t *  p_return_value 
)

Calls a function on a tick in the shengine framework.

Parameters
p_timePointer to a valid ShTime structure.
secondsTime interval in seconds for the tick.
tick_idxIndex of the tick.
p_funcPointer to the time function to call.
p_argPointer to an argument for the time function.
p_return_valuePointer to store the return value of the time function.
Returns
1 on success, 0 on failure.

◆ shGetTime()

uint8_t shGetTime ( ShTime p_time)

Gets the current time in the shengine framework.

Parameters
p_timePointer to a valid ShTime structure.
Returns
1 on success, 0 on failure.

◆ shSetTime()

uint8_t shSetTime ( double  now,
ShTime p_time 
)

Sets the time in the shengine framework.

Parameters
nowCurrent time to set.
p_timePointer to a valid ShTime structure.
Returns
1 on success, 0 on failure.

◆ shSleep()

void shSleep ( uint32_t  ms)

Sleeps for a specified number of milliseconds.

Parameters
msNumber of milliseconds to sleep.