-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.h
41 lines (32 loc) · 851 Bytes
/
app.h
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
33
34
35
36
37
38
39
40
41
#ifndef APP_H_
#define APP_H_
#include <GLFW/glfw3.h>
#define W_WIDTH 1920
#define W_HEIGHT 1080
#define W_NAME "gldvd"
#define DEFAULT_IMAGE "dvd.png"
#define GL_UNIFORM_MATRIX_4FV(shader, name, a, b, ptr) \
(glUniformMatrix4fv(glGetUniformLocation(shader, name), a, \
b, ptr))
#define GL_UNIFORM_4F(shader, name, r, g, b, a) \
(glUniform4f(glGetUniformLocation(shader, name), r, g, b, a))
struct application {
GLFWwindow *window;
int width, height;
const char *name;
const char *image_name;
unsigned int program;
unsigned int fullscreen;
};
#ifdef __cplusplus
extern "C" {
#endif
void app_init(void);
struct application *app_alloc(void);
void app_free(struct application *app);
void app_destroy(struct application *app);
void app_loop(struct application *app);
#ifdef __cplusplus
}
#endif
#endif