summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-03-12 01:48:49 -0500
committerrealtradam <[email protected]>2023-03-12 01:48:49 -0500
commitd40275ae9d29b5e10ffca6d1560efb4a21d21985 (patch)
tree00e38801cd2981f5438e8c3bd59664d42ebe860f /src
parent3f150d0f3c4e0c8544686df1f0c8e3dff2041b20 (diff)
downloadrodeo_sample_game-d40275ae9d29b5e10ffca6d1560efb4a21d21985.tar.gz
rodeo_sample_game-d40275ae9d29b5e10ffca6d1560efb4a21d21985.zip
boop rodeo
Diffstat (limited to 'src')
-rw-r--r--src/main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a1b90b1..f21e4fd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,7 +1,9 @@
#include "rodeo.h"
+#include <inttypes.h>
rodeo_string_t renderer;
+float time_var;
const rodeo_rgba_t red =
{
@@ -48,6 +50,10 @@ const rodeo_rgba_t pink_clear =
void
main_loop(void)
{
+ if(rodeo_frame_count_get() % 10 == 0)
+ {
+ time_var = rodeo_frame_persecond_get();
+ }
mrodeo_frame_do()
{
rodeo_rectangle_draw(
@@ -84,6 +90,15 @@ main_loop(void)
pink_clear
);
+ rodeo_rectangle_draw(
+ (rodeo_rectangle_t){
+ rodeo_input_mouse_x_get() - 25,
+ rodeo_input_mouse_y_get() - 25,
+ 50, 50
+ },
+ pink
+ );
+
rodeo_debug_text_draw(
1,
1,
@@ -92,6 +107,20 @@ main_loop(void)
&renderer
)
);
+
+ rodeo_debug_text_draw(
+ 2,
+ 2,
+ " frame count: %"PRIu64" ",
+ rodeo_frame_count_get()
+ );
+
+ rodeo_debug_text_draw(
+ 2,
+ 3,
+ " fps: %.2f ",
+ time_var
+ );
}
}
@@ -113,6 +142,7 @@ main()
mrodeo_window_do(480, 640, "Rodeo Window")
{
renderer = rodeo_renderer_name_get();
+ rodeo_frame_limit_set(60);
rodeo_mainloop_run(
main_loop
);