doc, fin
All checks were successful
Linux arm64 / Build (push) Successful in 34s

This commit is contained in:
2025-05-18 23:30:30 +02:00
parent 97950403a5
commit c741044469
18 changed files with 465 additions and 45 deletions

View File

@@ -30,6 +30,11 @@ public abstract class ShaderProgram implements Closeable {
GL30.glUseProgram(0);
}
/**
* Load the shader program.
* @param vertexSource the source code of the vertex shader.
* @param fragmentSource the source code of the fragment shader.
*/
public void LoadProgram(String vertexSource, String fragmentSource) {
this.vertexShaderId = LoadShader(vertexSource, GL30.GL_VERTEX_SHADER);
this.fragmentShaderId = LoadShader(fragmentSource, GL30.GL_FRAGMENT_SHADER);
@@ -47,6 +52,12 @@ public abstract class ShaderProgram implements Closeable {
GetAllUniformLocation();
}
/**
* Load a shader from source code.
* @param source
* @param type
* @return
*/
private int LoadShader(String source, int type) {
int shaderId = GL30.glCreateShader(type);