Trace Engine
A Raycaster Engine in C
Loading...
Searching...
No Matches
graphics.c File Reference
#include "graphics.h"
#include "glad/glad.h"
#include "game_state.h"
#include "raycaster.h"
#include "trc_camera.h"
#include "pop_up_windows.h"
#include "map.h"

Functions

resolutions_t get_actual_resolution (void)
 
void set_actual_resolution (const resolutions_t new_resolution)
 
void set_background_color (const rgb_t color)
 
void render_screen (void)
 
void draw_square (const trc_world_position_t position, const trc_world_position_t size, const int border, const rgb_t color)
 
void draw_point (const trc_world_position_t position, const int size, const rgb_t color)
 
void draw_line (const trc_world_position_t start_point, const trc_world_position_t end_point, const int thickness, const rgb_t color)
 

Variables

resolutions_t resolution = LOW_RESOLUTION
 

Function Documentation

◆ draw_line()

void draw_line ( const trc_world_position_t  start_point,
const trc_world_position_t  end_point,
const int  thickness,
const rgb_t  color 
)

Draw a line of the given thickness from the given start point to the given end point with the given color

◆ draw_point()

void draw_point ( const trc_world_position_t  position,
const int  size,
const rgb_t  color 
)

Draw a point of the given size in the given position with the given color

◆ draw_square()

void draw_square ( const trc_world_position_t  position,
const trc_world_position_t  size,
const int  border,
const rgb_t  color 
)

Draw a point of the given size (plus the border) in the given position with the given color

Note
If you wan't a full square, pass a border of 0

◆ get_actual_resolution()

resolutions_t get_actual_resolution ( void  )

Returns the current selected resolution

◆ render_screen()

void render_screen ( void  )

Draw the objects in the window

◆ set_actual_resolution()

void set_actual_resolution ( const resolutions_t  new_resolution)

Updates the current resolution to the given new one

◆ set_background_color()

void set_background_color ( const rgb_t  color)

Change the color of the screen when called glClear()

Parameters
colorThe color to change to

Variable Documentation

◆ resolution