Fixes the sample count

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9963 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
jul..om 2012-11-06 19:02:09 +00:00
parent 3002e5e057
commit 2ca9775aef

View File

@ -42,8 +42,10 @@ import com.jme3.system.JmeContext;
import com.jme3.system.NanoTimer;
import com.jme3.system.SystemListener;
import com.jme3.system.Timer;
import java.nio.IntBuffer;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.media.opengl.GL;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLContext;
public abstract class JoglContext implements JmeContext {
@ -141,10 +143,17 @@ public abstract class JoglContext implements JmeContext {
GL gl = GLContext.getCurrentGL();
if (gl.hasFullFBOSupport()) {
return gl.getMaxRenderbufferSamples();
} else {
if (gl.isExtensionAvailable("GL_ARB_framebuffer_object")
|| gl.isExtensionAvailable("GL_EXT_framebuffer_multisample")) {
IntBuffer intBuf1 = IntBuffer.allocate(1);
gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, intBuf1);
return intBuf1.get(0);
} else {
return Integer.MAX_VALUE;
}
}
}
protected int getNumSamplesToUse() {
int samples = 0;