Add FPS counter
Added console FPS counter. Thise required me to create some time functions and remove FPS cap from Vulkan Signed-off-by: Piotr Krygier <piotrkrygier@everyonecancode@xyz>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
rse_utilities_srcs = [
|
||||
'src/file_utils.c'
|
||||
'src/file_utils.c',
|
||||
'src/time_utils.c'
|
||||
]
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "time_utils.h"
|
||||
#include <stdint.h>
|
||||
#include "SDL3/SDL_timer.h"
|
||||
|
||||
#define NS_TO_S(time) (time/1000000000)
|
||||
double time_get_sec_from_start(void)
|
||||
{
|
||||
return NS_TO_S((double)SDL_GetTicksNS());
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @file file_utils.h
|
||||
* @author Piotr Krygier (everyonecancode@gmail.com)
|
||||
* @brief Common functionality for all modules
|
||||
* @version 0.1
|
||||
* @date 2026-02-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TIME_UTILS_H_
|
||||
#define TIME_UTILS_H_
|
||||
|
||||
double time_get_sec_from_start(void);
|
||||
|
||||
#endif // !TIME_UTILS_H_
|
||||
Reference in New Issue
Block a user