This commit is contained in:
ZtRXR 2024-06-29 20:32:54 +08:00
parent cf91c1a687
commit 3e8c6d09eb
1 changed files with 7 additions and 1 deletions

View File

@ -8,12 +8,18 @@
static unsigned int CompileShader(unsigned int fragmentShader,const std::string& source){
auto id = glCreateShader(GL_VERTEX_SHADER);
auto src = source.c_str();
glShaderSource(id,1,&src,nullptr);
glCompileShader(id);
// TODO Error handing
return id;
}
static int CreateShader(const std::string& vertexShader, const std::string& fragmentShader){
auto program = glCreateProgram();
auto vs = CompileShader(GL_VERTEX_SHADER,vertexShader);
auto fs = CompileShader(GL_FRAGMENT_SHADER,fragmentShader);
}
int tests::glfw_shader(unsigned width,unsigned height, std::string title)