Hello Guest

[SOLVED]Image moving after drawing a new image

  • 0 Replies
[SOLVED]Image moving after drawing a new image
« on: August 04, 2018, 15:18:23 »
Hi, i´m new to the forum and using the tool LWJGL. I have little experience with Java as well so I apologize if I´m asking somehting dumb.
I started a game and I´m just experimenting with the library, so I tried to display an image inside my window (Display).
The problem is, the image is beeing drawn inside the typical while(!Display.isCloseRequested()), and i configured it to be at 1 frame per second, for debbuging purposes.
Well, every time it draws the image, it first moves the same image (the previous frame drawn one) down and right, and then draws the one from this frame, both of the images staying on screen, overlapping each other.
After trying to draw it at 0, 0, i realized it didn´t happen, and made me think it takes the previous image´s coordinates and sums them to the new image one, hence the moving. And if i draw it at 0, 0, since 0+0=0 it stays in the corner without moving.
Honestly I don´t, and I would be glad to recieve any help for this.
If more information is needed, like the code itself, i´ll be glad to show it.
« Last Edit: August 04, 2018, 23:17:00 by KLMNT »