This repository was archived by the owner on Feb 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/me/zero/client/api/util/render/gl/shader Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717package me .zero .client .api .util .render .gl .shader ;
1818
19- import me .zero .client .api .util .io .StreamReader ;
2019import me .zero .client .api .util .render .gl .shader .adapter .ShaderAdapter ;
2120import me .zero .client .api .util .render .gl .glenum .GlShaderStatus ;
2221import 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 );
Original file line number Diff line number Diff line change 2222
2323import java .util .Objects ;
2424
25- import static org .lwjgl .opengl .GL11 .GL_FALSE ;
25+ import static org .lwjgl .opengl .GL11 .* ;
2626import static org .lwjgl .opengl .GL20 .*;
2727
2828/**
You can’t perform that action at this time.
0 commit comments