blob: 3ecd8c4b22fb9ac9b8f38a73e9393c5cc29c2d82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "shader.h"
GLuint vshader_comp(const char* shader_src){
GLuint vertid = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertid,1,(const GLchar**)&shader_src, NULL);
glCompileShader(vertid);
return vertid;
}
GLuint fshader_comp(const char* shader_src){
GLuint fragid = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragid,1,(const GLchar**)&shader_src, NULL);
glCompileShader(fragid);
return fragid;
}
GLuint build_shader(GLuint vertid, GLuint fragid){
GLuint progid = glCreateProgram();
glAttachShader(progid,vertid);
glAttachShader(progid,fragid);
glLinkProgram(progid);
return progid;
}
|