/** * Called by the object manager to reset all object IDs. This causes * the shader to be reuploaded to the GPU incase the display was restarted. */ @Override public void resetObject() { this.id = -1; for (ShaderSource source : shaderSourceList){ source.resetObject(); } setUpdateNeeded(); }
/** * Adds source code to a certain pipeline. * * @param type The pipeline to control * @param source The shader source code (in GLSL). * @param defines Preprocessor defines (placed at the beginning of the shader) * @param language The shader source language, currently accepted is GLSL### * where ### is the version, e.g. GLSL100 = GLSL 1.0, GLSL330 = GLSL 3.3, etc. */ public void addSource(ShaderType type, String name, String source, String defines, String language){ ShaderSource shaderSource = new ShaderSource(type); shaderSource.setSource(source); shaderSource.setName(name); shaderSource.setLanguage(language); if (defines != null) { shaderSource.setDefines(defines); } shaderSourceList.add(shaderSource); setUpdateNeeded(); }
/** * Adds an existing shader source to this shader. * @param source */ private void addSource(ShaderSource source){ shaderList.add(source); setUpdateNeeded(); }
/** * Called by the object manager to reset all object IDs. This causes * the shader to be reuploaded to the GPU incase the display was restarted. */ @Override public void resetObject() { this.id = -1; this.usable = false; for (ShaderSource source : shaderList){ source.resetObject(); } setUpdateNeeded(); }
/** * Called by the object manager to reset all object IDs. This causes * the shader to be reuploaded to the GPU incase the display was restarted. */ @Override public void resetObject() { this.id = -1; for (ShaderSource source : shaderSourceList){ source.resetObject(); } setUpdateNeeded(); }
/** * Adds source code to a certain pipeline. * * @param type The pipeline to control * @param source The shader source code (in GLSL). */ public void addSource(ShaderType type, String name, String source, String defines){ ShaderSource shader = new ShaderSource(type); shader.setSource(source); shader.setName(name); if (defines != null) shader.setDefines(defines); shaderList.add(shader); setUpdateNeeded(); }
/** * Adds source code to a certain pipeline. * * @param type The pipeline to control * @param source The shader source code (in GLSL). * @param defines Preprocessor defines (placed at the beginning of the shader) * @param language The shader source language, currently accepted is GLSL### * where ### is the version, e.g. GLSL100 = GLSL 1.0, GLSL330 = GLSL 3.3, etc. */ public void addSource(ShaderType type, String name, String source, String defines, String language){ ShaderSource shaderSource = new ShaderSource(type); shaderSource.setSource(source); shaderSource.setName(name); shaderSource.setLanguage(language); if (defines != null) { shaderSource.setDefines(defines); } shaderSourceList.add(shaderSource); setUpdateNeeded(); }