Created
August 10, 2012 05:51
-
-
Save ra4king/3311471 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void readShader(String filePath, int shaderType) | |
{ | |
try(BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(vShaderPath)))) | |
{ | |
StringBuilder str = new StringBuilder(); | |
String line; | |
while ((line = reader.readLine()) != null) | |
{ | |
str.append(line).append("\n"); | |
} | |
if(shaderType == GL_VERTEX_SHADER) | |
vShader = str.toString(); | |
if(shaderType == GL_FRAGMENT_SHADER) | |
fShader = str.toString(); | |
} | |
catch (Exception e) | |
{ | |
e.printStackTrace(); | |
throw new RuntimeException("Failure to load vertex shader", e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment