Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 7b50824

Browse files
committed
Vertex and Fragment parameters are the source, not the path
1 parent 7162428 commit 7b50824

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/main/java/me/zero/client/api/util/render/gl/shader/ShaderHelper.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package me.zero.client.api.util.render.gl.shader;
1818

19-
import me.zero.client.api.util.io.StreamReader;
2019
import me.zero.client.api.util.render.gl.shader.adapter.ShaderAdapter;
2120
import me.zero.client.api.util.render.gl.glenum.GlShaderStatus;
2221
import me.zero.client.api.util.render.gl.glenum.GlShaderType;
@@ -34,16 +33,16 @@ private ShaderHelper() {}
3433
/**
3534
* Loads a shader of the specified type from the specified path
3635
*
37-
* @param path Shader path
36+
* @param adapter The shader adapter used by the system
37+
* @param src Shader source code
3838
* @param type Shader type
3939
* @return The Shader's Object ID
4040
*/
41-
static int loadShader(ShaderAdapter adapter, String path, GlShaderType type) {
41+
static int loadShader(ShaderAdapter adapter, String src, GlShaderType type) {
4242
int shaderID = adapter.createShader(type);
4343
if (shaderID == 0)
4444
return 0;
4545

46-
String src = new StreamReader(Shader.class.getResourceAsStream(path)).read();
4746
adapter.shaderSource(shaderID, src);
4847
adapter.compileShader(shaderID);
4948
adapter.checkStatus(shaderID, GlShaderStatus.COMPILE);

src/main/java/me/zero/client/api/util/render/gl/shader/adapter/GL20ShaderAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import java.util.Objects;
2424

25-
import static org.lwjgl.opengl.GL11.GL_FALSE;
25+
import static org.lwjgl.opengl.GL11.*;
2626
import static org.lwjgl.opengl.GL20.*;
2727

2828
/**

0 commit comments

Comments
 (0)