forked from Wren6991/shadertoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
33 lines (28 loc) · 756 Bytes
/
util.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
#include <iostream>
#include "shadertoyMain.h"
struct vert
{
float x, y, z;
float nx, ny, nz;
float u, v; //32 byte aligned :D
};
struct texture
{
void *data;
int width;
int height;
};
void *fileContents(const char *filename, GLint &length);
texture readTGA(const char *filename, int &width, int &height);
GLuint makeShader(GLenum type, const char* filename);
GLuint makeShader(GLenum type, const char* filename, wxTextCtrl* output);
GLuint makeProgram(GLuint vertex_shader, GLuint fragment_shader);
GLuint makeBuffer(GLenum target, const void* buffer_data, GLsizei buffer_size);
GLuint makeTexture(const char* filename);
class error
{
public:
std::string errstring;
error();
error(std::string);
};