Added function that returns the current time in milliseconds

This commit is contained in:
abdelrahman committed 2022-10-25 00:57:59 +01:00
1 parent cc052ed02c
commit 4659a4cd49
2 files changed
+4

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ bool init_engine(const char *game_name, WindowSize window_size,
bool game_running(); bool game_running();
void close_engine(); void close_engine();
int64_t get_time();
// END GENERAL ENGINE API // END GENERAL ENGINE API
// ASSET MANAGEMENT API // ASSET MANAGEMENT API
+2
View File
@@ -172,6 +172,8 @@ void close_engine() {
#endif /* DEBUG_ENGINE */ #endif /* DEBUG_ENGINE */
} }
int64_t get_time() { return SDL_GetTicks64(); }
ObjectID add_object(void *object, EventHandlerPtr event_handler, ObjectID add_object(void *object, EventHandlerPtr event_handler,
UpdateFuncPtr update_func, RenderFuncPtr render_func) { UpdateFuncPtr update_func, RenderFuncPtr render_func) {
if (!(GameEngine.running) || !(GameEngine.object_store)) { if (!(GameEngine.running) || !(GameEngine.object_store)) {