From 562f366a2be90740e4c965a9b017b0ade78ae0a9 Mon Sep 17 00:00:00 2001 From: Antonin Boyon Date: Tue, 16 Mar 2021 15:18:00 +0100 Subject: [PATCH] bug fix for the 2D engine --- src/lsystem/screen/gl2d/JoglEventListener2D.java | 2 +- src/lsystem/screen/gl2d/JoglMouseListener2D.java | 1 - src/lsystem/screen/gl2d/SwingGLCanvas2D.java | 1 + src/lsystem/screen/gl3d/DrawHelper.java | 5 ----- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lsystem/screen/gl2d/JoglEventListener2D.java b/src/lsystem/screen/gl2d/JoglEventListener2D.java index 547a5c3..bfb494d 100644 --- a/src/lsystem/screen/gl2d/JoglEventListener2D.java +++ b/src/lsystem/screen/gl2d/JoglEventListener2D.java @@ -51,7 +51,7 @@ public class JoglEventListener2D implements GLEventListener { float xDefault = -1.0f, yDefault = -1.0f; DrawHelper.drawStick(gl, 0.1f, xDefault, yDefault, 0); - DrawHelper.drawStick(gl, 0.2f, -0.9f, -0.9f, 90); + DrawHelper.drawStick(gl, 0.2f, 1.1f, 1.1f, 90); } @Override diff --git a/src/lsystem/screen/gl2d/JoglMouseListener2D.java b/src/lsystem/screen/gl2d/JoglMouseListener2D.java index b11cfff..0fdc4de 100644 --- a/src/lsystem/screen/gl2d/JoglMouseListener2D.java +++ b/src/lsystem/screen/gl2d/JoglMouseListener2D.java @@ -30,7 +30,6 @@ public class JoglMouseListener2D implements MouseListener, MouseMotionListener, button = 0; origine = null; } - } @Override diff --git a/src/lsystem/screen/gl2d/SwingGLCanvas2D.java b/src/lsystem/screen/gl2d/SwingGLCanvas2D.java index f6396ef..faa981e 100644 --- a/src/lsystem/screen/gl2d/SwingGLCanvas2D.java +++ b/src/lsystem/screen/gl2d/SwingGLCanvas2D.java @@ -7,6 +7,7 @@ public class SwingGLCanvas2D extends AbstractCanvas { @Override protected void addEventsListeners() { + glCanvas.addGLEventListener(new JoglEventListener2D(this)); JoglMouseListener2D mouse = new JoglMouseListener2D(this); glCanvas.addMouseListener(mouse); diff --git a/src/lsystem/screen/gl3d/DrawHelper.java b/src/lsystem/screen/gl3d/DrawHelper.java index b1db104..0ff56bc 100644 --- a/src/lsystem/screen/gl3d/DrawHelper.java +++ b/src/lsystem/screen/gl3d/DrawHelper.java @@ -167,11 +167,6 @@ public class DrawHelper { gl.glVertex2f(x, y); gl.glVertex2f(x + (echelle * newX), y + (echelle * newY)); gl.glEnd(); - /* System.out.println("X : " +(x + (echelle * newX))); - System.out.println("Y : " +(y + (echelle * newY))); - System.out.println("angle : " +angle); - System.out.println("newX : " +newX); - System.out.println("newY : " +newY);*/ } }