Пример #1
0
  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);
  }
Пример #2
0
 public Shader(String shaderName) {
   this(Resources.getShaderPath(shaderName));
 }