I am not sure how to extend it apart from saying that it seems that my LWJGL coordinates differently The picture for the system and the painting of the mouse is that the texture has a way of inserting the (0, 0) in the upper-left corner of the Java-DD, while the mouse is more intelligent in the lower-left corner. Goes from I have checked my code in a bunch, but I do not see anything in modifying those values from where I read them and how I use them. This has thrown me for a loop and I can not understand it.
I will post that code which contains mouse input and textured painting, which you can see.
private static void pollHelpers () {while (Mouse.next ()) {InputHelper.acceptMouseInput (Mouse.getEventButton (), Mouse.getEventX (), Mouse.getEventY ()); } While (keyboard.next ()) {if. (Keyboard.getEventKeyState ()) {InputHelper.acceptKeyboardInput (Keyboard.getEventKey (), true); } Else {InputHelper.acceptKeyboardInput (Keyboard.getEventKey (), Incorrect); }}} Public static void acceptMouseInput (int mouseButton, int x, int y) to {(InputHelper namely: InputHelper.instances) {if (ie.checkRectangle (x, y)) {ie.sendMouseInputToParent (mousebutton); }}} Private Zero sendMouseInputToParent (Int mouseButton) {parent.onClick (mousebutton); } Public Boolean checkercode (int x, int y) {// y = InputManager.HEIGHT - y; See below for details return x & gt; Parent.getX () & amp; Amp; X & lt; Parent.getX () + parent.getWidth () & amp; Amp; Y & gt; Parent.getY () & amp; Amp; Y & lt; Parent.getY () + parent.getHeight (); } I have put this line in code because it has temporarily fixed the problem of coordination system. However, I want my code to be as independent as possible, so it is possible that I want to remove as much dependence on other classes as possible.
This is the only way to touch the mouse input, and as far as I can tell, none of them can change anything, so that's all right. Now for the texture methods:
public void draw () (if (clicked || passive image == NULL) {activatedImage.bind (); glBegin (GL_QUADS); {DrawHelper. DrawGLQuad (active Aymej, x, y, width, height);} Glend ();} else (passive Image.bind (); glBegin (GL_QUADS); {DrawHelper.drawGLQuad (passive image, x, y, width, height) ;} Glend ();}} public static void Dyuelkwad (texture texture, float x, float y, float width, float height) {glTexCoord2f (x, y); GlVertex2f (x, y); GlTexCoord2f (x, y + texture .getHeight ()); G lVertex2f (x, y + height); GlTexCoord2f (x + texture.getWidth (), y + texture.getHeight ()); GlVertex2f (x + width, y + height); GlTexCoord2f (x + texture.getWidth (), y ); GlVertex2f (x + width, y);} I will be honest, I do not have an unconscious clue about what is happening in this method, but I I found it to work together with me. My guess is that this is the problem.
Thanks for any help!
This looks correct, honestly. Both texture and mouse input (0,0) work from the top left corner, and I'm sure 100% on it. Have you tried logging in to the mouse X and Y?
Comments
Post a Comment