Permalink
Browse files

eclipse project structure for l5

  • Loading branch information...
1 parent 7e249ef commit c1cbd3881e7e5c04c4584a95e69ff5cf7c2c331e @alihelmy committed Apr 22, 2012
View
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="/libs/lwjgl_util.jar">
+ <attributes>
+ <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="libs/native/windows"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="/libs/lwjgl.jar">
+ <attributes>
+ <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="libs/native/windows"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>LessonFive</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -1,4 +1,4 @@
-package com.onehandstand.lwjgltutorial.lessonfive;
+package lwjgltutorial.lessonFive;
import static org.lwjgl.opengl.ARBBufferObject.GL_STATIC_DRAW_ARB;
import static org.lwjgl.opengl.ARBBufferObject.GL_WRITE_ONLY_ARB;
@@ -1,4 +1,4 @@
-package com.onehandstand.lwjgltutorial.lessonfive;
+package lwjgltutorial.lessonFive;
import static org.lwjgl.opengl.ARBShaderObjects.glAttachObjectARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCreateProgramObjectARB;
@@ -1,11 +1,14 @@
-package com.onehandstand.lwjgltutorial.lessonfive;
+package lwjgltutorial.lessonFive;
import static org.lwjgl.opengl.ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCompileShaderARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCreateShaderObjectARB;
import static org.lwjgl.opengl.ARBShaderObjects.glGetInfoLogARB;
import static org.lwjgl.opengl.ARBShaderObjects.glGetObjectParameterARB;
import static org.lwjgl.opengl.ARBShaderObjects.glShaderSourceARB;
+import static org.lwjgl.opengl.GL11.GL_TRUE;
+import static org.lwjgl.opengl.GL20.GL_COMPILE_STATUS;
+import static org.lwjgl.opengl.GL20.glGetShader;
import java.io.BufferedReader;
import java.io.File;
@@ -70,29 +73,9 @@ private static String readInShaderCodeFromShaderFile(String pathToShaderFile) {
}
}
- public static boolean isShaderValid(int shaderToCheck) {
- IntBuffer iVal=BufferUtils.createIntBuffer(1);
- glGetObjectParameterARB(shaderToCheck, GL_OBJECT_INFO_LOG_LENGTH_ARB,
- iVal);
- int length=iVal.get();
- boolean isValid=length>1;
-
- if (isValid&&verboseValidityCheck) {
- printShaderLogInfo(shaderToCheck, iVal, length);
- }
-
- return isValid;
- }
-
- private static void printShaderLogInfo(int shaderToCheck, IntBuffer iVal,
- int length) {
- ByteBuffer infoLog=BufferUtils.createByteBuffer(length);
- iVal.flip();
- glGetInfoLogARB(shaderToCheck, iVal, infoLog);
- byte[] infoBytes=new byte[length];
- infoLog.get(infoBytes);
- String out=new String(infoBytes);
- System.out.println("Info log:\n"+out);
+ public static boolean isShaderValid(int shaderToCheck) {
+ int status=glGetShader(shaderToCheck, GL_COMPILE_STATUS);
+ return status == GL_TRUE;
}
}
@@ -1,4 +1,4 @@
-package lwjgltutorial.lessonfour;
+package lwjgltutorial.lessonFour;
import static org.lwjgl.opengl.GL11.GL_BLEND;
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
@@ -1,4 +1,4 @@
-package lwjgltutorial.lessonfour;
+package lwjgltutorial.lessonFour;
import static org.lwjgl.opengl.ARBBufferObject.GL_STATIC_DRAW_ARB;
import static org.lwjgl.opengl.ARBBufferObject.GL_WRITE_ONLY_ARB;
@@ -1,4 +1,4 @@
-package lwjgltutorial.lessonfour;
+package lwjgltutorial.lessonFour;
import static org.lwjgl.opengl.ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCompileShaderARB;

0 comments on commit c1cbd38

Please sign in to comment.