Started creating some outlines for s=how some components might work

This commit is contained in:
Warwick 2025-09-25 16:46:18 +01:00
parent e383f8bf93
commit c1aa2130af
5 changed files with 34 additions and 3 deletions

View file

@ -1,13 +1,11 @@
#include <GL/glew.h>
#include <SDL3/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "SDL3/SDL_events.h"
#include "SDL3/SDL_keycode.h"
#include "camera.h"
#include "cglm/io.h"
// settings
const unsigned int SCR_WIDTH = 800;
@ -171,7 +169,7 @@ int main(int argc, char *argv[]) {
// Handle camera
camera_tick(&camera);
// TODO: make shader file
// TODO: make shader handler
mat4 mvp;
camera_calc_mvp(&mvp, &camera);
// glm_mat4_print(mvp,stdout);

0
src/shader.c Normal file
View file

15
src/shader.h Normal file
View file

@ -0,0 +1,15 @@
#pragma once
typedef struct {
const char *vertex_shader_source_path;
const char *fragment_shader_source_path;
} wn_shader_code_location;
struct wn_shader_s {
unsigned int shaderProgram;
};
typedef struct wn_shader_s wn_shader;
wn_shader wn_shader_init(wn_shader_code_location shader_code_location);
void wn_shader_deinit(wn_shader shader);

0
src/window.c Normal file
View file

18
src/window.h Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include "SDL3/SDL_events.h"
#include "SDL3/SDL_render.h"
#include "SDL3/SDL_video.h"
struct wn_window_s {
SDL_Window *window;
SDL_Renderer *renderer;
SDL_GLContext *glcontext;
SDL_Event *event;
};
typedef struct wn_window_s wn_window;
wn_window *wn_window_init(wn_window *window);
void wn_window_deinit(wn_window *window);
void wn_swapwindow(wn_window*);