aboutsummaryrefslogtreecommitdiffstats
path: root/src/oculusvr
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/oculusvr
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/oculusvr')
-rw-r--r--src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java12
-rw-r--r--src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java8
-rw-r--r--src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java4
-rw-r--r--src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java10
4 files changed, 18 insertions, 16 deletions
diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
index eebd771d8..cf6eb5dda 100644
--- a/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
+++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
@@ -45,7 +45,7 @@ public class OVRVersion extends JogampVersion {
protected static volatile OVRVersion jogampCommonVersionInfo;
- protected OVRVersion(String packageName, Manifest mf) {
+ protected OVRVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -95,11 +95,11 @@ public class OVRVersion extends JogampVersion {
if(null==sb) {
sb = new StringBuilder();
}
- ovrHmdDesc hmdDesc = ovrHmdDesc.create();
+ final ovrHmdDesc hmdDesc = ovrHmdDesc.create();
OVR.ovrHmd_GetDesc(ovrHmdCtx, hmdDesc);
getAvailableCapabilitiesInfo(hmdDesc, ovrHmdIndex, sb);
- ovrSensorDesc sensorDesc = ovrSensorDesc.create();
+ final ovrSensorDesc sensorDesc = ovrSensorDesc.create();
if( OVR.ovrHmd_GetSensorDesc(ovrHmdCtx, sensorDesc) ) {
sb.append("\thmd."+ovrHmdIndex+".sensor.productId:\t0x"+Integer.toHexString(sensorDesc.getProductId())).append(Platform.getNewline());
sb.append("\thmd."+ovrHmdIndex+".sensor.vendorId:\t0x"+Integer.toHexString(sensorDesc.getVendorId())).append(Platform.getNewline());
@@ -116,7 +116,7 @@ public class OVRVersion extends JogampVersion {
* @param sb
* @return
*/
- public static StringBuilder getAvailableCapabilitiesInfo(ovrHmdDesc hmdDesc, final int ovrHmdIndex, StringBuilder sb) {
+ public static StringBuilder getAvailableCapabilitiesInfo(final ovrHmdDesc hmdDesc, final int ovrHmdIndex, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -129,7 +129,7 @@ public class OVRVersion extends JogampVersion {
sb.append("\thmd."+ovrHmdIndex+".sensorCaps:\t"+hmdDesc.getSensorCaps()).append(Platform.getNewline());
final ovrSizei resolution = hmdDesc.getResolution();
sb.append("\thmd."+ovrHmdIndex+".resolution:\t"+resolution.getW()+"x"+resolution.getH()).append(Platform.getNewline());
- ovrVector2i winPos = hmdDesc.getWindowsPos();
+ final ovrVector2i winPos = hmdDesc.getWindowsPos();
sb.append("\thmd."+ovrHmdIndex+".winPos:\t"+winPos.getX()+" / "+winPos.getY()).append(Platform.getNewline());
return sb;
}
@@ -144,7 +144,7 @@ public class OVRVersion extends JogampVersion {
return sb;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
// System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
index 026345067..9af3397cf 100644
--- a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
+++ b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
@@ -96,7 +96,7 @@ public class OVRSBSRendererDualFBO implements GLEventListener {
final FBObject ssink0 = new FBObject();
{
ssink0.reset(gl, width, height);
- ssink0.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink0.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink0.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbos[0].setSamplingSink(ssink0);
@@ -108,16 +108,16 @@ public class OVRSBSRendererDualFBO implements GLEventListener {
final FBObject ssink1 = new FBObject();
{
ssink1.reset(gl, width, height);
- ssink1.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink1.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink1.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbos[1].setSamplingSink(ssink1);
fbos[1].resetSamplingSink(gl); // validate
fboTexs[1] = fbos[1].getSamplingSink();
} else {
- fboTexs[0] = fbos[0].attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTexs[0] = fbos[0].attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbos[0].attachRenderbuffer(gl, Type.DEPTH, 24);
- fboTexs[1] = fbos[1].attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTexs[1] = fbos[1].attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbos[1].attachRenderbuffer(gl, Type.DEPTH, 24);
}
fbos[0].unbind(gl);
diff --git a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
index bfc0dd57a..b18d1634e 100644
--- a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
+++ b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
@@ -97,14 +97,14 @@ public class OVRSBSRendererSingleFBO implements GLEventListener {
final FBObject ssink = new FBObject();
{
ssink.reset(gl, width, height);
- ssink.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbo.setSamplingSink(ssink);
fbo.resetSamplingSink(gl); // validate
fboTex = fbo.getSamplingSink();
} else {
- fboTex = fbo.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTex = fbo.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbo.attachRenderbuffer(gl, Type.DEPTH, 24);
}
fbo.unbind(gl);
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
index 902429900..c32270ac4 100644
--- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
@@ -37,6 +37,8 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLUniformData;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.os.Platform;
import com.jogamp.oculusvr.OVR;
@@ -163,7 +165,7 @@ public class OVRDistortion {
vboTexCoordsG = null;
vboTexCoordsB = null;
}
- indices = GLArrayDataServer.createData(1, GL2ES2.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indices = GLArrayDataServer.createData(1, GL.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
// Setup: eyeToSourceUVScale, eyeToSourceUVOffset
{
@@ -356,7 +358,7 @@ public class OVRDistortion {
return "OVRDist[caps 0x"+Integer.toHexString(distortionCaps)+", "+
", tex "+textureSize[0]+"x"+textureSize[1]+
", vignette "+useVignette()+", chromatic "+useChromatic()+", timewarp "+useTimewarp()+
- ", "+Platform.NEWLINE+" "+eyes[0]+", "+Platform.NEWLINE+" "+eyes[1]+"]";
+ ", "+PlatformPropsImpl.NEWLINE+" "+eyes[0]+", "+PlatformPropsImpl.NEWLINE+" "+eyes[1]+"]";
}
public static OVRDistortion create(final OvrHmdContext hmdCtx, final boolean sbsSingleTexture,
@@ -567,7 +569,7 @@ public class OVRDistortion {
eye.updateUniform(gl, sp);
eye.enableVBO(gl, true);
if( usesDistMesh ) {
- gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
} else {
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, eye.vertexCount);
}
@@ -622,7 +624,7 @@ public class OVRDistortion {
eye.updateUniform(gl, sp);
eye.enableVBO(gl, true);
if( usesDistMesh ) {
- gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
} else {
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, eye.vertexCount);
}