~mika/sofa

ref: 0646871a3b71d14d3dd9f39367be1ceff3794b8c sofa/render.h -rw-r--r-- 633 bytes
0646871a — m1ka sofa sitting 27 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef SOFA_RENDER_H
#define SOFA_RENDER_H

#include <glad/gl.h>
#include <GLFW/glfw3.h>

#include "util.h"
#include "canvas.h"

static u8 placeholderTexture[4 * 4] = {
    0,   0,   0,   255,
    255, 0,   255, 255,
    255, 0,   255, 255,
    0,   0,   0,   255,
};

typedef struct {
    GLFWwindow* win;
    GLuint backingTexture;
    GLuint vao;
    GLuint* bufs;
    GLuint shaders;
} renderer_t;

renderer_t renderer_create(const char* title, u16 x, u16 y);

int renderer_healthy(const renderer_t* self);
void renderer_present(const renderer_t* self, const canvas_t* canvas);

void renderer_destroy(renderer_t* self);

#endif