|
Trace Engine
A Raycaster Engine in C
|
#include "window_manager.h"#include "log.h"#include "pop_up_windows.h"#include "graphics.h"#include <stdbool.h>#include "SDL.h"#include "glad/glad.h"Macros | |
| #define | SDL_MAIN_HANDLED |
| #define | V_SYNC_OFF 0 /** Immediate update from frame to frame */ |
| #define | V_SYNC_ON 1 /** Updates synchronized with the vertical retrace */ |
| #define | V_SYNC_ADAPT -1 /** Adaptive V-sync */ |
| #define | SDL_INIT_ENGINE (SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS) |
Functions | |
| bool | init_GL (int window_width, int window_height) |
| void | init_glad (SDL_Window *window) |
| void | init_SLD (void) |
| void | create_window (const char *title, const int width, const int height) |
| void | update_window (void) |
| void | swap_window_buffers (void) |
| void | destroy_window (void) |
Variables | |
| SDL_Window * | engine_window |
| #define SDL_INIT_ENGINE (SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS) |
| #define SDL_MAIN_HANDLED |
| #define V_SYNC_ADAPT -1 /** Adaptive V-sync */ |
| #define V_SYNC_OFF 0 /** Immediate update from frame to frame */ |
V-sync modes
| #define V_SYNC_ON 1 /** Updates synchronized with the vertical retrace */ |
| void create_window | ( | const char * | title, |
| const int | width, | ||
| const int | height | ||
| ) |
Creates the window and the context for OpenGL
| title | The title of the window, it'll show up in the upper section of the window |
| width | The window width in pixels |
| height | The window height in pixels |
| void destroy_window | ( | void | ) |
Calls every deleter function for the graphical stuff
| bool init_GL | ( | int | window_width, |
| int | window_height | ||
| ) |
| void init_glad | ( | SDL_Window * | window | ) |
| void init_SLD | ( | void | ) |
| void swap_window_buffers | ( | void | ) |
Swaps the current frame with the one rendered, call it every time at the end of the main loop (when everything has been drawn)
| void update_window | ( | void | ) |
Clears the previous frame and renders the next frame
| SDL_Window* engine_window |