summaryrefslogtreecommitdiffstats
path: root/src/demos/j2d
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/j2d')
-rwxr-xr-xsrc/demos/j2d/CustomText.java5
-rwxr-xr-xsrc/demos/j2d/FlyingText.java4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/demos/j2d/CustomText.java b/src/demos/j2d/CustomText.java
index bfcbc79..c3194be 100755
--- a/src/demos/j2d/CustomText.java
+++ b/src/demos/j2d/CustomText.java
@@ -190,6 +190,8 @@ public class CustomText extends Demo {
}
public void init(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
+
// Create the background texture
BufferedImage bgImage = new BufferedImage(2, 2, BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g = bgImage.createGraphics();
@@ -199,7 +201,7 @@ public class CustomText extends Demo {
g.fillRect(0, 0, 1, 1);
g.fillRect(1, 1, 1, 1);
g.dispose();
- backgroundTexture = AWTTextureIO.newTexture(bgImage, false);
+ backgroundTexture = AWTTextureIO.newTexture(gl.getGLProfile(), bgImage, false);
backgroundTexture.bind();
backgroundTexture.setTexParameteri(GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
backgroundTexture.setTexParameteri(GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
@@ -231,7 +233,6 @@ public class CustomText extends Demo {
((SystemTime) time).rebase();
// Set up properties; note we don't need the depth buffer in this demo
- GL gl = drawable.getGL();
gl.glDisable(GL.GL_DEPTH_TEST);
// Turn off vsync if we can
gl.setSwapInterval(0);
diff --git a/src/demos/j2d/FlyingText.java b/src/demos/j2d/FlyingText.java
index f46dac2..d8d156c 100755
--- a/src/demos/j2d/FlyingText.java
+++ b/src/demos/j2d/FlyingText.java
@@ -231,6 +231,7 @@ public class FlyingText extends Demo {
}
public void init(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
// Create the background texture
BufferedImage bgImage = new BufferedImage(2, 2, BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g = bgImage.createGraphics();
@@ -240,7 +241,7 @@ public class FlyingText extends Demo {
g.fillRect(0, 0, 1, 1);
g.fillRect(1, 1, 1, 1);
g.dispose();
- backgroundTexture = AWTTextureIO.newTexture(bgImage, false);
+ backgroundTexture = AWTTextureIO.newTexture(gl.getGLProfile(), bgImage, false);
backgroundTexture.bind();
backgroundTexture.setTexParameteri(GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
backgroundTexture.setTexParameteri(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
@@ -271,7 +272,6 @@ public class FlyingText extends Demo {
((SystemTime) time).rebase();
// Set up properties; note we don't need the depth buffer in this demo
- GL gl = drawable.getGL();
gl.glDisable(GL2.GL_DEPTH_TEST);
// Turn off vsync if we can
gl.setSwapInterval(0);