Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected int createShader(String shaderCode, int shaderType) throws Exception {
- int shaderId = glCreateShader(shaderType);
- glShaderSource(shaderId, shaderCode);
- glCompileShader(shaderId);
- glAttachShader(programId, shaderId);
- if (glGetShaderi(shaderId, GL_COMPILE_STATUS) == 0) {
- throw new Exception("Error compiling Shader code: " + glGetShaderInfoLog(shaderId, 1024));
- }
- if (shaderId == 0) {
- throw new Exception("Error creating shader. Type: " + shaderType);
- }
- return shaderId;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement