diff --git a/test/org/lwjgl/opengl/awt/AWTTest.java b/test/org/lwjgl/opengl/awt/AWTTest.java index 8645840..f2339b2 100644 --- a/test/org/lwjgl/opengl/awt/AWTTest.java +++ b/test/org/lwjgl/opengl/awt/AWTTest.java @@ -30,13 +30,15 @@ public void paintGL() { int w = getWidth(); int h = getHeight(); float aspect = (float) w / h; + double now = System.currentTimeMillis() * 0.001; + float width = (float) Math.abs(Math.sin(now * 0.3)); glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, w, h); glBegin(GL_QUADS); glColor3f(0.4f, 0.6f, 0.8f); - glVertex2f(-0.75f / aspect, 0.0f); + glVertex2f(-0.75f * width / aspect, 0.0f); glVertex2f(0, -0.75f); - glVertex2f(+0.75f / aspect, 0); + glVertex2f(+0.75f * width/ aspect, 0); glVertex2f(0, +0.75f); glEnd(); swapBuffers(); diff --git a/test/org/lwjgl/opengl/awt/AWTThreadTest.java b/test/org/lwjgl/opengl/awt/AWTThreadTest.java index dca304f..7d0309a 100644 --- a/test/org/lwjgl/opengl/awt/AWTThreadTest.java +++ b/test/org/lwjgl/opengl/awt/AWTThreadTest.java @@ -49,6 +49,7 @@ public void dispose() { AWTGLCanvasExplicitDispose canvas; frame.add(canvas = new AWTGLCanvasExplicitDispose(data) { private static final long serialVersionUID = 1L; + public void initGL() { System.out.println("OpenGL version: " + effective.majorVersion + "." + effective.minorVersion + " (Profile: " + effective.profile + ")"); createCapabilities(); @@ -58,13 +59,15 @@ public void paintGL() { int w = getWidth(); int h = getHeight(); float aspect = (float) w / h; + double now = System.currentTimeMillis() * 0.001; + float width = (float) Math.abs(Math.sin(now * 0.3)); glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, w, h); glBegin(GL_QUADS); glColor3f(0.4f, 0.6f, 0.8f); - glVertex2f(-0.75f / aspect, 0.0f); + glVertex2f(-0.75f * width / aspect, 0.0f); glVertex2f(0, -0.75f); - glVertex2f(+0.75f / aspect, 0); + glVertex2f(+0.75f * width/ aspect, 0); glVertex2f(0, +0.75f); glEnd(); swapBuffers();