aboutsummaryrefslogtreecommitdiff
path: root/src/debug.h
blob: 7b004538c4eec95f579eafb703494b875364dca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef PW_DEBUG_H
#define PW_DEBUG_H

#include <SDL3/SDL_render.h>

struct pw_debug {
  SDL_Texture *font;
  struct {
    uint64_t clock;
    uint64_t count;
    double sample;
  } fps;
};

/**
 * Initializes debug state.
 */
struct pw_debug *pw_debug_init(SDL_Renderer *renderer);

/**
 * Frees debug state.
 */
void pw_debug_free(struct pw_debug *debug);

/**
 * Iterates a new frame and updates debug information.
 */
bool pw_debug_iterate(struct pw_debug *debug);

/**
 * Prints debug information to screen.
 */
bool pw_debug_render(struct pw_debug *debug);

#endif