Trace Engine
A Raycaster Engine in C
Loading...
Searching...
No Matches
pop_up_windows.c File Reference
#include "pop_up_windows.h"
#include <stdio.h>
#include "nuklear_includes.h"
#include "log.h"
#include "trc_timer.h"
#include "game_state.h"

Macros

#define FPS_IN_CHART   33 /** How many last FPS to show in the performance graph, think of it as a FPS history count */
 

Functions

void start_nk_input_hanlder (void)
 
void run_nk_input_hanlder (SDL_Event *event)
 
void stop_nk_input_hanlder (void)
 
void update_fps_history (void)
 
void init_nk_windows (SDL_Window *current_window)
 
void close_nk (void)
 
void show_debug_console (void)
 
void set_style (const nk_theme_t theme)
 

Variables

const char * themes_names [THEME_COUNT]
 
nk_theme_t current_theme = THEME_RED
 
struct nk_context * nk_ctx = NULL
 
trc_timer_t debug_fps_timer
 
int last_fps [FPS_IN_CHART] = {0}
 

Macro Definition Documentation

◆ FPS_IN_CHART

#define FPS_IN_CHART   33 /** How many last FPS to show in the performance graph, think of it as a FPS history count */

Function Documentation

◆ close_nk()

void close_nk ( void  )

Close all Nuklear functionality

◆ init_nk_windows()

void init_nk_windows ( SDL_Window *  current_window)

Initialize everything for the Nuklear windows (like themes)

◆ run_nk_input_hanlder()

void run_nk_input_hanlder ( SDL_Event *  event)

Nuklear hanlder for an SDL_Event, call it every frame

◆ set_style()

void set_style ( const nk_theme_t  theme)

Sets the given theme to the floating windows, sliders, buttons and stuff

◆ show_debug_console()

void show_debug_console ( void  )

It creates the debug console, from which you can access all the data and info of the engine

◆ start_nk_input_hanlder()

void start_nk_input_hanlder ( void  )

Nuklear needs to start seeing mouse and keyboard input, call it every frame

◆ stop_nk_input_hanlder()

void stop_nk_input_hanlder ( void  )

Nuklear needs to stop seeing mouse and keyboard input, call it every frame

◆ update_fps_history()

void update_fps_history ( void  )

Update the current FPS history, you can see the chart in the debug window

Variable Documentation

◆ current_theme

nk_theme_t current_theme = THEME_RED

◆ debug_fps_timer

trc_timer_t debug_fps_timer

◆ last_fps

int last_fps[FPS_IN_CHART] = {0}

◆ nk_ctx

struct nk_context* nk_ctx = NULL

The context for Nuklear, it is necessary to create all the windows

◆ themes_names

const char* themes_names[THEME_COUNT]
Initial value:
= {"Black", "White", "Red", "Blue", "Dark", "Dracula",
"Catppucin Latte", "Catppucin Frappe", "Catppucin Macchiato", "Catppucin Mocha"}