-
Notifications
You must be signed in to change notification settings - Fork 3
/
minishadertoy.h
56 lines (49 loc) · 1014 Bytes
/
minishadertoy.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#ifdef _DEBUG
void CheckGLErrors(const char *func, int line);
#define GLCHK glFinish(); CheckGLErrors(__FUNCTION__, __LINE__);
#else
#define GLCHK
#endif
typedef struct FBO
{
const char *id;
GLuint framebuffer;
GLuint framebufferTex;
int floatTex;
} FBO;
typedef struct SAMPLER
{
int filter, wrap, vflip, srgb, internal;
} SAMPLER;
typedef struct SHADER_INPUT
{
const char *id;
GLuint tex;
int is_cubemap, w, h;
SAMPLER sampler;
} SHADER_INPUT;
typedef struct SHADER
{
GLuint prog;
GLuint shader;
SHADER_INPUT inputs[4];
FBO output;
int type;
GLuint iResolution;
GLuint iTime;
GLuint iTimeDelta;
GLuint iFrame;
GLuint iMouse;
GLuint iDate;
GLuint iSampleRate;
GLuint iChannelTime[4];
GLuint iChannelResolution[4];
GLuint iChannel[4];
} SHADER;
typedef struct PLATFORM_PARAMS
{
int winWidth, winHeight, frame;
float mx, my, cx, cy, cur_time, time_last;
struct tm *tm;
} PLATFORM_PARAMS;