33 lines
644 B
C++
33 lines
644 B
C++
#ifndef GRAPHICS_HPP
|
|
#define GRAPHICS_HPP
|
|
#define GL_GLEXT_PROTOTYPES
|
|
|
|
// Includes
|
|
#include <SDL3/SDL_opengl.h>
|
|
#include "window.hpp"
|
|
#include "shader.hpp"
|
|
#include "texture.hpp"
|
|
#include <iostream>
|
|
|
|
// Constants
|
|
const int open_gl_major_version = 3;
|
|
const int open_gl_minor_version = 3;
|
|
const int enable_vsync = 1;
|
|
|
|
// Variables
|
|
extern Uint32 last_time;
|
|
extern Uint32 current_time;
|
|
extern float frame_time;
|
|
extern float fps;
|
|
extern float frame_time_graph[100];
|
|
extern SDL_GLContext gl_context;
|
|
#define delta_time frame_time
|
|
|
|
// Functions
|
|
int initialize_opengl();
|
|
void cleanup_opengl();
|
|
|
|
// Frame time calculation
|
|
void calc_frame_time();
|
|
|
|
#endif |