public Shader(String vertPath, String fragPath) { vertex = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertex, Resources.read(vertPath)); glCompileShader(vertex); fragment = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragment, Resources.read(fragPath)); glCompileShader(fragment); program = glCreateProgram(); glAttachShader(program, vertex); glAttachShader(program, fragment); glLinkProgram(program); glValidateProgram(program); }
public Shader(String shaderName) { this(Resources.getShaderPath(shaderName)); }