feat: initial commit

This commit is contained in:
2025-09-30 16:12:38 +02:00
commit 1d1d23a148
42 changed files with 9256374 additions and 0 deletions

39
include/prelude.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef PRELUDE_H_
#define PRELUDE_H_
#define GLEW_STATIC
#include <GL/glew.h>
#include "SDL3/SDL.h"
struct RenderContext {
Uint64 time;
Uint64 prev_time;
bool program_failed = false;
GLuint program = 0;
GLint resolution_location = 0;
GLint time_location = 0;
bool pause = false;
};
bool compile_shader_source(const GLchar *source, GLenum shader_type, GLuint *shader);
bool compile_shader_file(const char *file_path, GLenum shader_type, GLuint *shader);
bool link_program(GLuint vert_shader, GLuint frag_shader, GLuint *program);
void reload_shaders(RenderContext*context);
// void key_callback(SDL_Window* window, int key, int scancode, int action, int mods);
void window_size_callback(SDL_Window* window, int width, int height);
void MessageCallback(GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar* message,
const void* userParam);
void process_prelude(RenderContext *context);
#endif // PRELUDE_H_