archivemuh
This commit is contained in:
19
archive/dusksdl2/time.c
Normal file
19
archive/dusksdl2/time.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "time.h"
|
||||
#include "dusksdl2.h"
|
||||
|
||||
uint32_t TIME_LAST = 0;
|
||||
|
||||
float_t timeDeltaGet(void) {
|
||||
// Get the current time in milliseconds
|
||||
uint32_t currentTime = SDL_GetTicks();
|
||||
float_t delta = (currentTime - TIME_LAST) / 1000.0f;
|
||||
TIME_LAST = currentTime;
|
||||
return delta;
|
||||
}
|
Reference in New Issue
Block a user