summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-08 23:52:28 +0100
committerSven Gothel <[email protected]>2011-11-08 23:52:28 +0100
commit769b17ac6ebc5ae49fe37eba13d43fea77fdfd40 (patch)
treea34777b70b9d29c4ec1f68296829741721dd5124 /src/jogl/classes/javax/media/opengl/awt
parent297c97d28bb3490177b5ff9441f3d6494d09b819 (diff)
OSX: SharedResource add knowledge of NPOT-, RECT- and Float-Texture features, used by pbuffer drawable before a current context.
- Also extract getNextPowerOf2() -> GLBuffers (remove redundancy)
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 92be62b4d..94fb250ce 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -83,6 +83,8 @@ import javax.media.opengl.GLProfile;
import javax.media.opengl.GLRunnable;
import javax.media.opengl.Threading;
import com.jogamp.opengl.util.FBObject;
+import com.jogamp.opengl.util.GLBuffers;
+
import jogamp.opengl.Debug;
import jogamp.opengl.GLContextImpl;
import jogamp.opengl.GLDrawableFactoryImpl;
@@ -776,17 +778,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (number == 0) {
return 2;
}
-
- if (((number-1) & number) == 0) {
- //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
- return number;
- }
- int power = 0;
- while (number > 0) {
- number = number>>1;
- power++;
- }
- return (1<<power);
+ return GLBuffers.getNextPowerOf2(number);
}
private int getGLInteger(GL gl, int which) {