Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

eclipse project structure for l6

  • Loading branch information...
commit 43359bc4f3a230980cb30ea2edce41d0f6bbb0bd 1 parent c1cbd38
@alihelmy authored
View
17 LessonSix/.classpath
@@ -0,0 +1,17 @@
+<?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="lib" path="/libs/slick-util.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
17 LessonSix/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>LessonSix</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>
View
2  ...ndstand/lwjgltutorial/lessonsix/Cube.java → LessonSix/lwjgltutorial/lessonsix/Cube.java
@@ -1,4 +1,4 @@
-package com.onehandstand.lwjgltutorial.lessonsix;
+package lwjgltutorial.lessonsix;
import static org.lwjgl.opengl.ARBBufferObject.GL_STATIC_DRAW_ARB;
import static org.lwjgl.opengl.ARBBufferObject.GL_WRITE_ONLY_ARB;
View
2  ...ndstand/lwjgltutorial/lessonsix/Main.java → LessonSix/lwjgltutorial/lessonsix/Main.java
@@ -1,4 +1,4 @@
-package com.onehandstand.lwjgltutorial.lessonsix;
+package lwjgltutorial.lessonsix;
import static org.lwjgl.opengl.ARBShaderObjects.glAttachObjectARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCreateProgramObjectARB;
View
31 ...gltutorial/lessonsix/ShaderUtilities.java → ...gltutorial/lessonsix/ShaderUtilities.java
@@ -1,4 +1,4 @@
-package com.onehandstand.lwjgltutorial.lessonsix;
+package lwjgltutorial.lessonsix;
import static org.lwjgl.opengl.ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB;
import static org.lwjgl.opengl.ARBShaderObjects.glCompileShaderARB;
@@ -6,6 +6,9 @@
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;
}
}
View
BIN  libs/slick-util.jar
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.